Created
April 11, 2017 14:02
-
-
Save Xotabu4/13c81465e959974429e2bba9a3408b71 to your computer and use it in GitHub Desktop.
Usage of FileDetector in protractorjs. Uploading file to remote selenium node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uploadFile(absFilePath) { | |
const FileDetector = require('selenium-webdriver/remote/index.js').FileDetector; | |
browser.setFileDetector(new FileDetector()); | |
this.hiddenInputField.sendKeys(absFilePath).then(() => {console.log('Uploading file:', absFilePath)}) | |
// File upload could take a lot of time. Try to use as small file as possible. | |
browser.wait(your_condition_to_wait, 30000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment