This repository was archived by the owner on Mar 4, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -358,6 +358,7 @@ public function isSelected()
358
358
public function sendKeys ($ value )
359
359
{
360
360
$ local_file = $ this ->fileDetector ->getLocalFile ($ value );
361
+
361
362
if ($ local_file === null ) {
362
363
if ($ this ->isW3cCompliant ) {
363
364
$ params = [
@@ -370,22 +371,18 @@ public function sendKeys($value)
370
371
':id ' => $ this ->id ,
371
372
];
372
373
}
373
-
374
- $ this ->executor ->execute (DriverCommand::SEND_KEYS_TO_ELEMENT , $ params );
375
-
376
- return $ this ;
377
- }
378
-
379
- if ($ this ->isW3cCompliant ) {
380
- $ params = [
381
- 'text ' => $ local_file ,
382
- ':id ' => $ this ->id ,
383
- ];
384
374
} else {
385
- $ params = [
386
- 'value ' => WebDriverKeys::encode ($ this ->upload ($ local_file )),
387
- ':id ' => $ this ->id ,
388
- ];
375
+ if ($ this ->isW3cCompliant ) {
376
+ $ params = [
377
+ 'text ' => $ local_file ,
378
+ ':id ' => $ this ->id ,
379
+ ];
380
+ } else {
381
+ $ params = [
382
+ 'value ' => WebDriverKeys::encode ($ this ->upload ($ local_file )),
383
+ ':id ' => $ this ->id ,
384
+ ];
385
+ }
389
386
}
390
387
391
388
$ this ->executor ->execute (DriverCommand::SEND_KEYS_TO_ELEMENT , $ params );
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ class FileUploadTest extends WebDriverTestCase
26
26
/**
27
27
* @group exclude-edge
28
28
* https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/6052385/
29
+ * @group exclude-saucelabs
30
+ * W3C protocol does not support remote file upload: https://github.com/w3c/webdriver/issues/1355
29
31
*/
30
32
public function testShouldUploadAFile ()
31
33
{
You can’t perform that action at this time.
0 commit comments