如何不用Watir-Webdriver等待 [英] How to not wait for something with Watir-Webdriver

查看:68
本文介绍了如何不用Watir-Webdriver等待的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我正在编写watir-webdriver脚本,并且我的应用程序正在使用javascript呈现要与之交互的模式窗口.当我单击显示模式窗口的元素时,watir-webdriver一直坐在那里直到最终超时,并且在控制台窗口上看到Timeout :: Error.这完全是在尝试与新窗口进行交互之前.我假设它正在轮询DOM进行某些更改而没有得到更改,我如何告诉它继续进行而无需等待?

So I'm writing a watir-webdriver script, and my app is using javascript to present a modal window that I want to interact with. When I click the element that presents the modal window, watir-webdriver just sits there until eventually it times out and i see a Timeout::Error on the console window. This is before attempting to interact with the new window at all. I'm assuming it's polling the DOM for some change and not getting it, how do I tell it to move on without waiting?

推荐答案

答案终于出现了,然后手动处理了必要的等待

The answer ended up being, and then handling the necessary waiting manually

element.focus
element.send_keys :return

这篇关于如何不用Watir-Webdriver等待的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆