The constructor FirefoxDriver(FirefoxBinary, FirefoxProfile) is undefined

来源:互联网 发布:金融机构利用电话网络 编辑:程序博客网 时间:2024/06/06 19:55

The constructor FirefoxDriver(FirefoxBinary, FirefoxProfile) is undefined



FirefoxDriver Constructor (FirefoxBinary, FirefoxProfile)WebDriver

Note: This API is now obsolete.


selenium-java-3.6.0 这种构造函数已经不用了

[ObsoleteAttribute("FirefoxDriver should not be constructed with a FirefoxBinary object. Use FirefoxOptions instead. This constructor will be removed in a future release.")]public FirefoxDriver(FirefoxBinary binary,FirefoxProfile profile)


使用如下可解决

System.setProperty("webdriver.gecko.driver", "D:\\Software\\GeckoDriver32\\geckodriver.exe");
MyLog.logger.info("Initializing the Firefox webdriver.....");
System.setProperty("webdriver.firefox.bin",
                "D:\\Software\\firefox\\firefox.exe");
driver =new FirefoxDriver();

阅读全文
0 0
原创粉丝点击