Windowsマシンでセレンサーバー2.28を使用しています。ハブとノードをセットアップしました。私は.netを使ってテストケースを書いています。次のコードを使用して、ユーザー エージェントを (iPhone に) 変更したカスタム FireFox (17.0.1) プロファイルを使用しています。
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);
プリファレンスは正しく設定されています。何か不足していますか?