如何强制 selenium 具有与 Capybara 相同的默认等待时间
我正在运行一些依赖于数据重新加载到页面中的测试。这些在 Capybara 中运行良好,它会在 has_content
处暂停,如果找不到它,则会重试。然而,他们在 Selenium 中失败了,Selenium 会立即解决问题并且不会进行任何重试。
Scenario: submit a question to the panel from its homepage
When I submit the question "what's the best grease to use on my trucks?"
Then I should be on the "Ruderiders" panel homepage
And I should see the question entitled "what's the best grease to use on my trucks?" at the top of the feed
- 在 Capybara 中工作
- 在 Selenium 中失败(@javascript
我怎样才能强制 Selenium 进行与 Capybara 相同的等待和重试?
I'm running some tests that depend on data reloading into the page. These run fine in Capybara which pauses on has_content
and retries if it can't find it. However they're failing in Selenium which attacks the problem immediately and doesn't do any retries.
Scenario: submit a question to the panel from its homepage
When I submit the question "what's the best grease to use on my trucks?"
Then I should be on the "Ruderiders" panel homepage
And I should see the question entitled "what's the best grease to use on my trucks?" at the top of the feed
- works in Capybara
- fails in Selenium (@javascript
How can I force Selenium to do the same wait and retry that Capybara does?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该检查您的
Capybara.default_wait_time
设置,并根据需要增加默认等待时间。我很高兴它对你有用:)
You should check your
Capybara.default_wait_time
setting and increase the default wait time if needed.I am glad it worked for you :)