`

webdriver操作页面元素报错Element is not currently visible and so may not be interacted w

阅读更多
前段时间用webdriver写自动化测试的脚本的时候,遇到了如下问题:页面上的元素可见,而且用exists?判断返回结果为:ture。
但是在对页面元素操作的时候,却报错了:Element is not currently visible and so may not be interacted withat。
后来发现了问题所在,以为弹出窗口等原因,页面上肯定不只一个当前要定位的元素。多见于:确认,取消等按钮。你判断返回存在的可能并不是你需要的那个元素。

这个时候最好的办法就是使用xpath去定位。
后来终于用xpath操作成功!
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics