谁能告诉我量角器什么时候抛出 “未知错误:无法从未知错误确定加载状态:未处理的检查器错误:{“代码”:-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) 我正在使用以下代码
element(by.xpath("//tf-navpane-item[contains(@class,'tf-state-selected')]//tf-navpane-item-text//*[contains(@class,'ng-binding')]")).then(function(ele){
ele.getText().then(function(txt){
console.log("txt: "+txt);
});
});
Run Code Online (Sandbox Code Playgroud)
当我使用Protractor 1.0时,此代码用于正常工作.将Protractor升级到3.2.1后,我开始出现以下错误.
TypeError:element(...).那么它不是一个函数
我可能会遗漏一些东西但不确定是什么.