问题描述
由于我的测试语句无法找到元素,我面临一些问题,即测试只是挂在那里(浏览器打开,无法进行下一个测试).
I face some issue whereby the test just hang there (Browser open and not able to proceed next test) due to my test statement not able to find the element.
我的 TestStatemet 是这样的:
My TestStatemet like this:
driver.findElement(By.xpath("//input[@name='AID' and contains(@value,'sampleDataThatwillNotFound')]"));
测试仅在通过 XPATH 查找时挂起,通过 NAME/ID 查找时没有问题.我已将超时设置为 60 秒,60 秒后,它仍然挂起.
The test hang only when find by XPATH, no issue when find by NAME/ID. I had set the timeout to 60 seconds, after the 60 seconds, it still hang.
有人遇到过这个问题吗?或者有人知道如何解决这个问题吗?
Anyone out there facing this issue before? or Anyone got any idea how to resolve this issue?
推荐答案
我已经尝试了上面的一些答案,但仍然遇到相同的问题.. 我切换回旧的 Firefox 版本 17.0.3 .... 一切都解决了..有点好笑.. 那些面临同样问题的你可以在 FF 17.0.3 版尝试
I had try some answer above, but still having same issues.. i switch back to old firefox version 17.0.3 .... everything just solve.. abit funny.. those that facing the same issue you can try at FF Version 17.0.3
这篇关于WebDriver findElement 通过 xPath,如果未找到元素,则没有 TIMEOUT,屏幕只是挂在那里.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!