javascriptautomationwebdriver-io

How to execute tests in incognito mode using webdriverIO


How to execute my testcases in incognito mode using webdriverIO. I didn't find any help regarding this on help document. for Ex: below code from Protractor to run in incognito mode. I tired in wbioconf.js file but not able to launch.

capabilities: {
'browserName': 'chrome',
'platform': 'ANY',
'version': 'ANY',
'chromeOptions': {
args: ['--incognito'],
}

Solution

  • I think very much the same will work in WDIO:

    In the testrunner config, pass the option to Chrome:

    exports.config = {
        capabilities: [{
            browserName: 'chrome',
            'goog:chromeOptions': {
                args: ['--incognito'],
            }
        }]
    }