【问题标题】:How to execute tests in incognito mode using webdriverIO如何使用 webdriverIO 在隐身模式下执行测试
【发布时间】:2021-09-05 01:24:33
【问题描述】:

如何使用 webdriverIO 在隐身模式下执行我的测试用例。我在帮助文档中没有找到任何关于此的帮助。 例如:以下来自 Protractor 的代码以隐身模式运行。我厌倦了 wbioconf.js 文件但无法启动。

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

【问题讨论】:

    标签: javascript automation webdriver-io


    【解决方案1】:

    我认为在 WDIO 中也是如此:

    在 testrunner 配置中,将选项传递给 Chrome:

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

    【讨论】:

    • 帕维尔萨曼,谢谢。我已经实现了相同的,我可以看到测试在隐身模式下执行。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-04-20
    • 2018-01-13
    • 1970-01-01
    • 1970-01-01
    • 2015-08-21
    • 2021-03-20
    • 1970-01-01
    相关资源
    最近更新 更多