【发布时间】:2019-10-21 23:34:06
【问题描述】:
起始页角度。通过单击一个按钮将导致登录页面是无角度的。登录后,其余页面都是有角度的。
我正在使用 async/await。
- 在 onPrepare 中包含
waitForAngularEnable(true) 但不起作用。 - 尝试在登录后添加
waitForAngularEnable(true) 但这没有 工作。 - 尝试增加
timeOut,但也没有用。 - 仅在
waitForAngularEnable(false) 时有效。我不能使用量角器 waiForAngular 中的内置功能,它等到 angular 加载。目前使用 waitForAngularEnable(false) 我正在使用 browser.driver.wait(until.elementsLocated(by.id(value)), 30000); 手动处理它或等待 browser.wait(ExpectedConditions.presenceOf(ele), 30000);。这样就可以了。
版本-
“量角器”:“^5.4.2”
“节点”:10.15.3
“目标”:“es6”
“黄瓜”:“^5.1.0”,
"cucumber-html-reporter": "^5.0.0"
ScriptTimeoutError: script 超时:30 秒内未收到结果
(会话信息:chrome=74.0.3729.169)
(驱动程序信息:chromedriver=74.0.3729.6
(255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Windows NT 10.0.17763 x86_64) 在 Object.checkLegacyResponse
(C:\Automation\General\node_modules\selenium-webdriver\lib\error.js:546:15) 在 parseHttpResponse (C:\Automation\General\node_modules\selenium-webdriver\lib\http.js:509:13)
在 doSend.then.response (C:\Automation\General\node_modules\selenium-webdriver\lib\http.js:441:30)
在 process._tickCallback (internal/process/next_tick.js:68:7) 来自:任务:Protractor.waitForAngular() - 定位器:By(xpath, //span[@class='title__subtext'])
【问题讨论】:
-
如果它有效,那么你的问题是什么。您必须为非 Angular 页面设置 waitForAngularEnable(false)。
-
我不能使用量角器 waiForAngular 中的内置功能,它等到 angular 加载。目前使用 waitForAngularEnable(false) 我正在使用 browser.driver.wait(until.elementsLocated(by.id(value)), 30000); 手动处理它或等待 browser.wait(ExpectedConditions.presenceOf(ele), 30000);。这样就可以了。
标签: angular typescript protractor cucumber