2017-06-16 70 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

现在我对此没有任何线索。但是如果我找到任何东西,我会回到你身边。 –

相关问题