3

Firefox Selenium webdriverでFlashを自動的に有効にする必要があります。FirefoxProfileでFireFox Selenium webdriverでAdobe Flashを有効にする方法

私が試してみました:

FirefoxProfile profile = new FirefoxProfile(); 
//As 0 is to disable, I used 1. I don"t know what to use. 
profile.setPreference("plugin.state.flash", 1); 
WebDriver driver = new FirefoxDriver(profile); 

をしかし、これはまだ "許可" をクリックして、私を必要とします。

This is shown all the time, even with the code above

+0

エラーはありません。 ちょうど働かなかった。 "Allow"ボタンを手動でクリックしなければならなかったので。 –

+0

私がここに間違っていれば私を訂正してください。しかし、 'driver'オブジェクトに優先権を渡したのと同じように私には見えます。あなたはそれをどこかに伝える必要もあります。 – Brian

+0

私が行くサイト: driver.get(リンク); Flashプラグインが許可されている必要があります。そして私はそれを手動で押す必要があります。 あまりにも自動化する方法が必要です。 –

答えて

1

私は解決策を自分自身を発見しました。

This Post Shows how to disable Adobe flash Player in Python

だけtrueに偽を変更、 "JAVA" でそれを有効にします。

profile.setPreference("dom.ipc.plugins.enabled.libflashplayer.so","true"); 

そして、それは動作します:)

+0

こんにちは、私たちはまだSelenium 3.5.3、geckodriver:0.19.0 Firefox 55.0.3(64ビット)で問題があります。 firefoxProfile.setPreference( "dom.ipc.plugins.enabled.libflashplayer.so"、 "true"); firefoxProfile.setPreference( "plugin.state.flash"、2); – zoram

+0

上記の投稿はクロームブラウザとクロムドライバのみのものでした。 –

2

これは私のために動作しませんでした: profile.setPreference("dom.ipc.plugins.enabled.libflashplayer.so","true");

代わりに私が使用: profile.setPreference("plugin.state.flash", 2);

を私は "2" はまた、プラグインを起動させると推定します。

関連する問題