2017-06-16 73 views
0

當我通過硒webdriver打開我的同一個Firefox配置文件,每次我必須手動激活shockwave播放器和更改沒有得到保存在Firefox的配置文件。無法保存使用硒webdriver Firefox的配置文件插件激活更改

是否有任何方法通過腳本自動激活插件或保存更改在Firefox的配置文件供以後使用。

ProfilesIni profile = new ProfilesIni(); 
System.setProperty("webdriver.gecko.driver","C:\\Users\\Test-pc1\\geckodriver-v0.16.1-win64\\geckodriver.exe"); 
FirefoxProfile myprofile = profile.getProfile("SeleniumTest"); 
WebDriver driver = new FirefoxDriver(myprofile); 
myprofile.setPreference("dom.ipc.plugins.enabled.Shockwaveflash.exe", "true"); 

回答

0

我希望它能幫助你實現你想要的。

http://toolsqa.com/selenium-webdriver/custom-firefox-profile/你可以參考這個。 創建完FF配置文件後,啓動它並點擊右上角的選項菜單,選擇選項。

enter image description here

選擇應用程序,並選擇應用程序,並說SAVEFILE

enter image description here

一旦你做了,它就會運行你測試這個profile.As在上面的鏈接提到。

+0

謝謝蘇哈的解決方案,但它並沒有爲我工作:((其實我沒能找到在應用Shockwave播放器插件的內容類型 – Amu

+0

有沒有辦法通過硒的webdriver腳本 激活Adobe Shockwave播放器插件myprofile.setPreference(「dom.ipc.plugins.enabled.Shockwaveflash.exe」,「true」); – Amu

+0

現在我對此沒有任何線索。但是如果我找到任何東西,我會回到你身邊。 –

相關問題