How to not wait for something with Watir-Webdriver(如何不等待 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 的某些东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何不等待 Watir-Webdriver 的某些东西


基础教程推荐
- html表格如何通过更改悬停边框来突出显示列? 2022-01-01
- 用于 Twitter 小部件宽度的 HTML/CSS 2022-01-01
- Chart.js 在线性图表上拖动点 2022-01-01
- 直接将值设置为滑块 2022-01-01
- 我可以在浏览器中与Babel一起使用ES模块,而不捆绑我的代码吗? 2022-01-01
- 如何使用JIT在顺风css中使用布局变体? 2022-01-01
- Electron 将 Node.js 和 Chromium 上下文结合起来意味着 2022-01-01
- Vue 3 – <过渡>渲染不能动画的非元素根节点 2022-01-01
- 如何使用TypeScrip将固定承诺数组中的项设置为可选 2022-01-01
- 自定义 XMLHttpRequest.prototype.open 2022-01-01