Selenium - FirefoxDriver is opening Firefox+Windows10 welcome page instead of test URL
当我在Firefox上运行Selenium Webdriver(Java)脚本时,它会打开Firefox Windows 10欢迎屏幕,因此我的脚本失败了。我看过以下类似的帖子
链接1
和Link2
并实现了所有提及的内容,但毫无用处。
PFB我尝试过的代码:
1 2 3 4 5 6 7 8 9 10 | FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("browser.startup.homepage_override.mstone","ignore"); profile.setPreference("startup.homepage_welcome_url","about:blank"); profile.setPreference("startup.homepage_welcome_url.additional","about:blank"); profile.setPreference("browser.startup.homepage","about:blank"); profile.setPreference("xpinstall.signatures.required", false); profile.setPreference("toolkit.telemetry.reportingpolicy.firstRun", false); System.setProperty("webdriver.gecko.driver","F:\\\\Selenium\\\\geckodriver.exe"); driver = new FirefoxDriver(profile); driver.get(url); |
使用的版本
Firefox-48.0.2
selenium-V3.0.0-beta3
蚀火星
Java 1.8
我在URL中输入了错误。
这是我的网址:
1 |
我将其更改为
1 |
现在可以正常工作了。