4

I am working on our automation tests, and I can't figure out how to start our Browserstack firefox browser with flash enabled/allowed.

Is there a flag for firefox that enables/allows flash ?

We are using Karma as a test runner.

I have tried :

var FirefoxProfile = require('firefox-profile');
var myProfile = new FirefoxProfile();
myProfile.setPreference("plugin.state.flash", 2);
myProfile.updatePreferences();

Along with :

module.exports = function (config) {
    config.set({
        basePath: "",
        browserNoActivityTimeout: 60000,
        browserStack: {
            username: "myUsername",
            accessKey: "myAccessKey",
            forcelocal: true,
            timeout: 1000, 
            firefox_profile: myProfile
        },
        client: {
            mocha: {
                timeout: 60000,
                ui: interfaceType
            },
            useIframe: true
        },
        customLaunchers: {
            "bs_chrome_mac": {
                base: "BrowserStack",
                browser: "chrome",
                browser_version: "56",
                os: "OS X",
                os_version: "Sierra"
            },
            "firefox-osx" : {
                base: "BrowserStack",
                browser: "Firefox", 
                browser_version: "63.0",
                os: "OS X",
                os_version: "Sierra", 
                profile: myProfile
            },
BentOnCoding
  • 23,888
  • 10
  • 59
  • 92

2 Answers2

0

You could start firefox with the ProfileManager, create a profile with enabled flash, and one without.

firefox -ProfileManager

See: https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options?redirectlocale=en-US&redirectslug=Command_Line_Options

manonthemat
  • 5,209
  • 1
  • 19
  • 43
0
For Firefox browser - 

 FirefoxProfile profile = new FirefoxProfile();
 profile.setPreference("plugin.state.flash", 2);
 caps.setCapability("browserstack.use_w3c", "true");

The above mentioned code snippet to enable flash is in Java. You can port them to your language of choice.

ANM1996
  • 131
  • 3