2
我在位置感知网站上运行测试。我可以告诉Chrome或IE浏览器始终允许为该页面进行地理定位,但是一旦关闭浏览器,Firefox就会一直忘记。使用GeoLocate进行硒测试 - FireFox一直关闭它
其他人都遇到过这个?
我在位置感知网站上运行测试。我可以告诉Chrome或IE浏览器始终允许为该页面进行地理定位,但是一旦关闭浏览器,Firefox就会一直忘记。使用GeoLocate进行硒测试 - FireFox一直关闭它
其他人都遇到过这个?
Firefox的Selenium驱动程序默认情况下似乎创建了a new, anonymous profile with each run。因此,您的设置不会持续,因为它们将在运行后与配置文件一起丢弃。
您应该:
FirefoxProfile
例如使用.setPreference("geo.prompt.testing", true);
和.setPreference("geo.prompt.testing.allow", true);
。webdriver.firefox.profile
Java系统属性或使用public FirefoxProfile(File profileDir)
构造函数来使用该现有配置文件。
第一点为我工作! 我做了: FirefoxProfile profile = new FirefoxProfile(); profile.setPreference(“geo.prompt.testing”,true); profile.setPreference(“geo.prompt.testing.allow”,true); – Flyview