Tag: 偏好

Selenium Grid 2 – 远程Webdriver未在FireFox中设置用户代理首选项

我在Windows机器上使用selenium server 2.28。 我已经设置了集线器和节点。 我正在使用.net来编写我的测试用例。 我使用以下代码使用自定义FireFox(17.0.1)配置文件与用户代理更改(到iPhone)。 FirefoxProfileManager profileManager = new FirefoxProfileManager(); FirefoxProfile profile = profileManager.GetProfile(FireFox_Profile_Name); profile.SetPreference(“general.useragent.override”, _sUserAgent); DesiredCapabilities capability = DesiredCapabilities.Firefox(); capability.SetCapability(FirefoxDriver.ProfileCapabilityName, profile); 我正在实例化一个这样的RemoteWebDriver实例: driver = new RemoteWebDriver(new Uri(“hub_uri”), capability); 当我在节点机器上检查firefox实例中的about:config时,我根本看不到general.useragent.override首选项。 如果我使用: driver = new FirefoxDriver(profile); 首选项设置正确。 我错过了什么吗?