问题
How can I tell webdriver-io to use firefox developer edition instead of normal firefox? I need to use CSS4 selectors which normal firefox does not support. I read the documentation but I can not find the option.
回答1:
You need to redefine the location of Firefox by either setting set the binary
capability:
var webdriverio = require('webdriverio');
var options = {
desiredCapabilities: {
browserName: 'firefox',
firefox_binary: 'C:\\...\\firefox.exe'
}
};
Or by starting the standalone server with a new binary path:
java -jar "selenium-server-standalone-x.x.x.jar" -Dwebdriver.firefox.bin="C:\...\firefox.exe"
回答2:
Florent, thanks for answer, I used it to test my application with Firefox Quantum. I used Firefox Developer Version, which already contains Firefox Quantum Beta 14, and added in my BrowserFactory Class:
else if (browserName.equals ("quantum") {
FirefoxOptions options = new FirefoxOptions();
System.setProperty ("webdriver.gecko.driver", "src/test/resources/drivers/geckodriver.exe");
System.setProperty(FirefoxDriver.SystemProperty.DRIVER_USE_MARIONETTE,"true");
System.setProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE,javaIoTmpDir+"\\geckodriverlogs.txt");
System.setProperty("webdriver.firefox.bin", "C:\\Portable\\FirefoxPortableDeveloper\\App\\Firefox64\\firefox.exe");
driver = new FirefoxDriver(options);
来源:https://stackoverflow.com/questions/36877971/how-can-i-tell-webdriver-io-to-use-firefox-developer-edition