gpt4 book ai didi

Selenium 3.6.0 & webdriver = 新的 FirefoxDriver(功能) - 已弃用?

转载 作者:行者123 更新时间:2023-12-03 06:31:14 26 4
gpt4 key购买 nike

自从升级到最新版本的 Selenium 以来,以下代码似乎已被弃用:

Selenium 3.6.0 & webdriver = new FirefoxDriver(capabilities) - deprecated? 

完整代码:

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

最佳答案

来自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.

从 3.4.1 版本开始,应使用 FirefoxOptions。

关于Selenium 3.6.0 & webdriver = 新的 FirefoxDriver(功能) - 已弃用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46669361/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com