量角器何时抛出“未知错误:无法确定加载状态”......异常

Mur*_*hna 5 selenium protractor chrome-web-driver

谁能告诉我量角器什么时候抛出 “未知错误:无法从未知错误确定加载状态:未处理的检查器错误:{“代码”:-32000,“消息”:“内部错误:未找到主世界执行上下文。”}'例外。

我知道从 WireProtocol 抛出“未知错误”,这通常意味着应用程序返回 4xx 或 5xx 状态代码。但不确定“内部错误:未找到主世界执行上下文。 ”是什么意思

提前致谢!

配置文件

exports.config = {
        framework: 'jasmine',
        allScriptsTimeout: 600000,
        onPrepare: function () {
            browser.ignoreSynchronization = true;
            browser.manage().timeouts().pageLoadTimeout(600000);
            require('jasmine-reporters');
            var jReporter=new jasmine.JUnitXmlReporter(__dirname + '\\Logs', true, true, undefined, true);
            jasmine.getEnv().addReporter(jReporter);
        },
        rootElement: 'body',
        chromeDriver: 'C:/node_modules/protractor/selenium/chromedriver.exe',
        capabilities: {
            'browserName': 'chrome',
            'chromeOptions': {'debuggerAddress': 'localhost:8088'}
        },
        jasmineNodeOpts: {
            isVerbose: true,
            showColors: true,
            includeStackTrace: true,
            defaultTimeoutInterval: 900000
        },
        onComplete: function () {},
        onCleanUp: function() { },
        specs: ['./sampleTest.spec.js']             
        };
Run Code Online (Sandbox Code Playgroud)

Gaj*_*ije 0

这可能是驱动程序版本引起的问题。

请参阅https://github.com/angular/protractor/issues/5347

你可以添加

chrome_options.add_argument('--disable-site-isolation-trials')
Run Code Online (Sandbox Code Playgroud)