Selenium InternetExplorerDriver, disable flash

2019-07-07 02:23发布

问题:

Is there a way to disable flash in the selenium InternetExplorerDriver?

Disabling this in the windows internet options doesnt seem to work. I am looking for a Capability to pass to the InternetExplorerDriver constructor, but there doesn't seem to be one.

回答1:

Currently there are limited resources for disabling flash in InternetExplorerDriver. One method is to use BrowserStack along with your Selenium tests, and pass the noFlash capability into your tests.

caps.setCapability("browserstack.ie.noFlash", "true");

https://www.browserstack.com/automate/java#enable-disable-flash https://www.browserstack.com/automate

BrowserStack is pretty easy to setup and integrate into your tests. I'd suggest using it for Internet Explorer if you must disable flash to test your web automation. Our company uses it for that reason specifically and it works out well.