【发布时间】:2017-10-10 07:25:17
【问题描述】:
我正在尝试处理 www.naukri.com 中的多个弹出窗口阻止程序;为此,我在 Firefox 中创建了一个自定义配置文件,命名为“AutoProfile”。但我在 Firefox 驱动程序中加载此自定义配置文件时遇到问题;
System.setProperty("webdriver.gecko.driver", "F:\\abc\\geckodriver-v0.18.0-win64\\geckodriver.exe");
ProfilesIni profile2=new ProfilesIni();
FirefoxProfile profile3=profile2.getProfile("AutoProfile");
profile3.setPreference("browser.popups.showPopupBlocker", false);
driver =new FirefoxDriver(profile3);
driver.get("www.naukri.com");
但我在driver=new FirefoxDriver(profile3); 中收到错误消息:
The constructor FirefoxDriver(FirefoxProfile) is undefined.
有时我会收到一条消息,因为构造函数已被弃用。
【问题讨论】:
标签: selenium firefox selenium-webdriver geckodriver