2016-05-20 7 views
0

私はFirefoxに多くの問題があります。それらのほとんどの場合、私はFirefoxDriverオブジェクトを使用する多くのソリューションを見つけました。しかし、私はRemoteWebDriverを使用する必要があります。IWebDriverでFirefoxProfileを使用する方法

私の問題のすべての解決策はFirefoxProfileオブジェクトを使用します。 IWebDriverにこのプロファイルを使用する方法はありますか?

私がする必要があるものの一つは、これを行うためにプロファイルを使用している:ここ

Firefox webdriver opens first run page all the time

は、私は私のIWebDriverを使用する方法である:

driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), DesiredCapabilities.Firefox(), TimeSpan.FromSeconds(timeout)); 

答えて

1

まずFirefoxProfileを作成し、機能に追加してください:

// create the profile 
var profile = new FirefoxProfile(); 

// create the capabilities 
var capabilities = DesiredCapabilities.Firefox(); 
capabilities.SetCapability(FirefoxDriver.ProfileCapabilityName, profile.ToBase64String()); 

// start the remote driver 
IWebDriver driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), capabilities); 
+0

thx I jusそれも見つけました!しかし、証明書を要求しないようにするには、どのような財産がありますか?プロファイルで設定できる設定のリストはどこにありますか? –

+0

アドレスバーに 'about:config'と入力してすべての設定を取得します。 –

+0

、証明書は 'profile.AcceptUntrustedCertificates = True;' –

関連する問題