Last active
September 8, 2019 02:47
-
-
Save remarkablemark/e56ce969c4d5fe81f7a639f519cb417b to your computer and use it in GitHub Desktop.
Build FirefoxDriver with specified binary: https://remarkablemark.org/blog/2016/06/15/firefox-binary-webdriverjs/
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
{ | |
"scripts": { | |
"start": "node webdriverjs-set-binary" | |
}, | |
"dependencies": { | |
"selenium-webdriver": "^3.6.0" | |
}, | |
"engines": { | |
"node": ">=8", | |
"npm": ">=6" | |
} | |
} |
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
const { Builder } = require('selenium-webdriver'); | |
const { Options } = require('selenium-webdriver/firefox'); | |
// replace `path/to/binary` with your binary path | |
const options = new Options().setBinary('path/to/binary'); | |
const driver = new Builder() | |
.forBrowser('firefox') | |
.setFirefoxOptions(options) | |
.build(); | |
driver.sleep(3000); | |
driver.quit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
not working