Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #593 from vania-pooh/master
Browse files Browse the repository at this point in the history
Added webdriver.io example to file upload section
  • Loading branch information
vania-pooh authored Oct 31, 2018
2 parents 43ec668 + e31a453 commit 35e6e21
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/file-upload.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ driver.file_detector = LocalFileDetector()
input.send_keys("/path/to/file/on/machine/which/runs/tests")
----

.Uploading files with Webdriver.io
[source,javascript]
----
var filePath = path.join('/path/to/file/on/machine/which/runs/tests');
browser.uploadFile(filePath);
browser.chooseFile("input[type='file']", filePath);
----

Read the following note if you are using Selenoid **without Docker**.

NOTE: This feature is supported in WebDriver protocol by sending zipped file contents to `/file` handle. However not all driver binaries support this feature. For example this is not implemented in http://github.com/mozilla/geckodriver[Geckodriver] or https://github.com/SeleniumHQ/selenium/tree/master/cpp/iedriver[IEDriver]. When proxying requests **directly** to these drivers (i.e. when **not using Docker**) you need to start Selenoid with `-enable-file-upload` flag. In that case Selenoid will provide required API to tests. Firefox container images already include this parameter where needed.

0 comments on commit 35e6e21

Please sign in to comment.