Firefox 61.0.1 "geckodriver": "^1.11.0", "selenium-webdriver": "^4.0.0-alpha.1"
However when I execute the command
let driver = await new webDr.Builder().withCapabilities(webDr.Capabilities.firefox()).build();
I get the error
“SessionNotCreatedError: Expected browser binary location, but unable to find binary in default locaion, no ‘moz:firefoxOptions.binary’ capability provided, and no Binary flag set on the command line”
“Add the chromedriver and geckodriver driver’s location to your system PATH variable. This should be an absolute path from the root of your hard disk, to the directory containing the drivers. For example, if we were using a Mac OS X machine, our user name was bob, and we put our drivers in the root of our home folder, the path would be /Users/bob.”
however, our company laptop has restricted modifying the following: System folders, registries and unfortunately.. PATH variables.
How can I point to my Firefox binaries without modifying PATH variable?
If I switch to firefoxdriver, will I still have the same dillema?
I tried the following based on the documentation on the firefox file:
const firefox = require('selenium-webdriver/firefox'); let options = new firefox.Options().setBinary(os.homedir() + '/AppData/Local/Mozilla Firefox'); let driver = new webDr.Builder() .forBrowser('firefox').setFirefoxOptions(options).build();
However, the error now says…
“SessionNotCreatedError: Failed to start browser (the path) : Permission Denied”
how can I get around this?
Source link https://sqa.stackexchange.com/questions/34851/nodejs-selenium-webdriver-firefox-geckodriver-set-browser-binary-location-withou