Search code examples
c#flash

disable flash in selenium cross browser


I want to use selenium to disable flash in IE, firefox, and chrome.

is there a way to do it cross browser, and if there isn't, is there a command you know for one of them or all?

(I am using C#)


Solution

  • For Firefox, you can try this (in Java):

    FirefoxProfile profile = new FirefoxProfile();
    profile.setPreference("plugin.state.flash", 0);
    FirefoxDriver driver = new FirefoxDriver(profile);
    

    Refer to this post.