xGI*_*GIx 7 selenium webdriver selenium-webdriver geckodriver
自升级到Selenium的最新版本以来,以下代码似乎已被弃用:
Selenium 3.6.0 & webdriver = new FirefoxDriver(capabilities) - deprecated?
Run Code Online (Sandbox Code Playgroud)
完整代码:
System.setProperty("webdriver.gecko.driver", Base_Page.getConstant(Constant.GECKO_DRIVER_DIRECTORY));
DesiredCapabilities capabilities=DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
webdriver = new FirefoxDriver(capabilities); //deprecated
Run Code Online (Sandbox Code Playgroud)
Dav*_*tti 11
来自https://raw.githubusercontent.com/SeleniumHQ/selenium/master/rb/CHANGES
3.4.1 (2017-06-13)
==================
Firefox:
* Added new Firefox::Options class that should be used to customize browser
behavior (command line arguments, profile, preferences, Firefox binary, etc.).
The instance of options class can be passed to driver initialization using
:options key. Old way of passing these customization directly to driver
initialization is deprecated.
Run Code Online (Sandbox Code Playgroud)
从3.4.1版本开始,应该使用FirefoxOptions.
改变后的代码" FirefoxDriver(capabilities),以firefoxOptions它使用.setCapcability()
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.setCapability("marionette", true);
webdriver = new FirefoxDriver(firefoxOptions);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10151 次 |
| 最近记录: |