[英]How to disable Insecure Password Warning in Firefox using Selenium Webdriver with Java
[英]How to disable geolocation permissions for a website using firefox capabilities in selenium webdriver
我想在Selenium Webdriver中使用Firefox功能禁用网站的地理位置许可,但是我不能这样做。
我尝试这样做...
WebDriver d = null;
cap = cap.merge(DesiredCapabilities.firefox());
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability("geo.enabled", false);
cap.setCapability("geo.provider.use_corelocation", false);
cap.setCapability("geo.prompt.testing", false);
cap.setCapability("geo.prompt.testing.allow", false);
附件是相同的屏幕截图
我没有尝试使用您的特定参数,但对于其他参数来说,效果很好,如下所示:
FirefoxProfile profile = new FirefoxProfile();
// Turn off updates
profile.setPreference("app.update.enabled", false);
WebDriver driver = new FirefoxDriver(profile);
使用Selenium 2.48和FF 42.0(但其他版本也应如此)。
这对我有用
caps.setCapability("locationContextEnabled", false);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.