diff --git a/docs/file-upload.adoc b/docs/file-upload.adoc index b04ce2ab..3dd9d5f8 100644 --- a/docs/file-upload.adoc +++ b/docs/file-upload.adoc @@ -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. \ No newline at end of file