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()
358358 public function sendKeys ($ value )
359359 {
360360 $ local_file = $ this ->fileDetector ->getLocalFile ($ value );
361+
361362 if ($ local_file === null ) {
362363 if ($ this ->isW3cCompliant ) {
363364 $ params = [
@@ -370,22 +371,18 @@ public function sendKeys($value)
370371 ':id ' => $ this ->id ,
371372 ];
372373 }
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- ];
384374 } 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+ }
389386 }
390387
391388 $ 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
2626 /**
2727 * @group exclude-edge
2828 * 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
2931 */
3032 public function testShouldUploadAFile ()
3133 {
You can’t perform that action at this time.
0 commit comments