有人可以帮助我确定这是什么错误。我的所有测试用例都在Chrome和IE中传递我在getText()上得到这样的随机错误,我不明白它是什么。
应该比较检查总回复消息:WebDriverError:无法确定类型来自:E。最后1个字符读取:E构建信息:版本:'3.14.0',修订版:'aacccce0',时间:'2018-08-02T20:13 :22.693Z'系统信息:os.name:'Windows 10',os.arch:'amd64',os.version:'10 .0',java.version:'10 .0.1'驱动程序信息:driver.version:unknown Stack :WebDriverError:无法确定类型:E。最后1个字符读取:E构建信息:版本:'3.14.0',修订版:'aacccce0',时间:'2018-08-02T20:13:22.693Z'系统信息:os.name:'Windows 10',os.arch:'amd64',os.version:'10 .0',java.version:'10 .0.1'驱动程序信息:driver.version:unknown
at Object.checkLegacyResponse (C:\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:546:15)
at parseHttpResponse (C:\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:509:13)
at doSend.then.response (C:\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\http.js:441:30)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
From: Task: WebDriver.findElements(By(xpath, //qms-percentage-widget//div[@id='F2']//div[@class='default-widget']))
at thenableWebDriverProxy.schedule (C:\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:807:17)
at thenableWebDriverProxy.findElements (C:\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:1048:19)
at ptor.waitForAngular.then (C:\AppData\Roaming\npm\node_modules\protractor\built\element.js:159:44)
at ManagedPromise.invokeCallback_ (C:\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:1376:14)
at TaskQueue.execute_ (C:\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3084:14)
at TaskQueue.executeNext_ (C:\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3067:27)
at asyncRun (C:\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2927:27)
at C:\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:668:7
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)Error
at ElementArrayFinder.applyAction_ (C:\AppData\Roaming\npm\node_modules\protractor\built\element.js:459:27)
at ElementArrayFinder.(anonymous function).args [as getText] (C:AppData\Roaming\npm\node_modules\protractor\built\element.js:91:29)
at ElementFinder.(anonymous function).args [as getText] (C:\AppData\Roaming\npm\node_modules\protractor\built\element.js:831:22)
at _onSuccess .js:79:23)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
根据此异常,您尝试通过xpath查找元素时测试失败:
WebDriver.findElements(By(xpath, //qms-percentage-widget//div[@id='F2']//div[@class='default-widget']))