我在我的角度应用程序中进行了e2e量角器茉莉花测试。我已经连续多次运行完全相同的测试,并且仅一步就停止了。给出相同的错误: “失败:脚本超时:20秒内未收到结果”
我尝试过的方法: 1.我试图使它成为一个异步函数:... header',async()=> {... 2.我已经尝试过等待元素:await element(by.css(“ [ng-click ='siteDocLibCtrl.managePermissionsDialog($ event)']”))。click(); 3.我尝试过browser.sleep(3000)
茉莉花版本:2.8.0 npm版本: npm:“ 6.4.1”, 战神:“ 1.15.0”, cldr:“ 33.1”, http_parser:“ 2.8.0”, icu:“ 62.1”, 模块:“ 64”, napi:“ 3”, nghttp2:'1.34.0', 节点:“ 10.15.0”, openssl:'1.1.0j', tz:'2018e', unicode:“ 11.0”, uv:“ 1.23.2”, v8:“ 6.8.275.32-node.45”, zlib:“ 1.2.11”
element.all(by.repeater("file in siteDocLibCtrl.files | filter:global.search | orderBy:orderByField:reverseSort")).get(0).click(); //selects 1st element
element(by.css("[ng-click='siteDocLibCtrl.managePermissionsDialog($event)']")).click();
我得到的输出错误如下:
Failed: script timeout: result was not received in 20 seconds
(Session info: chrome=73.0.3683.103)
(Driver info: chromedriver=2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1),platform=Windows NT 10.0.17134 x86_64)[0m
Stack:
ScriptTimeoutError: script timeout: result was not received in 20 seconds
(Session info: chrome=73.0.3683.103)
(Driver info: chromedriver=2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1),platform=Windows NT 10.0.17134 x86_64)
at Object.checkLegacyResponse (C:\Users\Jagdeep\eclipse-workspace\ProtractorTutorial\node_modules\selenium-webdriver\lib\error.js:546:15)
at parseHttpResponse (C:\Users\Jagdeep\eclipse-workspace\ProtractorTutorial\node_modules\selenium-webdriver\lib\http.js:509:13)
at doSend.then.response (C:\Users\Jagdeep\eclipse-workspace\ProtractorTutorial\node_modules\selenium-webdriver\lib\http.js:441:30)
at process._tickCallback (internal/process/next_tick.js:68:7)
答案 0 :(得分:0)
尝试在测试之前添加以下行:
browser.ignoreSynchronization = true;