How can I tell webdriver-io to use firefox developer edition?

二次信任 提交于 2019-12-22 08:03:43

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!