2

I have a test suite where certain it blocks require a different set of capabilities I want to be able to change the args as my tests execute

capabilities: {
    myChromeBrowser: {
        capabilities: {
            'browserName': 'chrome',
            'goog:chromeOptions': {
                args: ['--headless', '--disable-gpu', '--window-size=1920x1080','--no-sandbox', '--use-fake-ui-for-media-stream', '--use-fake-device-for-media-stream' ]
            }
        }
    },

2 Answers 2

1
  console.log(browser.capabilities)

Gives the browser capabilities currently set try changing it

    browser.capabilities = {new}

You can access the entire config file as:

   console.log(browser.config)
1
  • You can add that as answer and accept it
    – PDHide
    Commented Dec 17, 2020 at 11:41
0

It was solved through multiremote. You can define different objects in multiremote capabilities in wdio.conf files and then use them as you wish.

    capabilities: {
        myChromeBrowser: {
            capabilities: {
                'browserName': 'chrome',
                'goog:chromeOptions': {
                    args: [
                    '--headless', '--disable-gpu', 
                    '--window-size=1920x1080',
                    '--no-sandbox', 
                    '--use-fake-ui-for-media-stream', 
                    '--use-fake-device-for-media-stream' ]
                }
            }
        },
    
        chromeDisablePerm: {
            capabilities: {
                'browserName': 'chrome',
                'goog:chromeOptions': {
                    args: [
                        '--headless', 
                        '--disable-gpu',
                        '--window-size=1920x1080',
                            '--deny-permission-prompts',
                    
                ]
                }
            }
    
        },
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.