Capybara Selenium Chrome打开关于Google Chrome [英] Capybara Selenium Chrome opens About Google Chrome

查看:110
本文介绍了Capybara Selenium Chrome打开关于Google Chrome的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Chrome中进行测试时遇到问题.当我运行测试时,它会在新标签页中打开chrome://settings/help页面.这导致我的测试失败,因为它找不到应该单击的按钮.看到发生了什么事,我正在以正常模式在Chrome中进行调试.

I have an issue with testing in Chrome. When I run the test it opens the chrome://settings/help page in a new tab. This causes my tests to fail as it can't find the buttons it should click on. I was debugging in Chrome in normal mode when I saw what happend.

我可以防止这种情况发生吗?还是可以以某种方式使测试标签保持重点?

Can I prevent this from happening? Or can I keep the tab where I'm testing in focussed in some way?

推荐答案

今天早上,我遇到了同样的问题.我们所有的测试都失败了,因为运行硒测试时chrome://settings/help是自动打开的.

I ran into the same issue this morning. All our tests were failing because chrome://settings/help was automatically opened when we ran our selenium tests.

当我们使用Chrome 61时并没有发生这种情况,并且在将其更新为Chrome 62时突然出现了.

This behaviour did not happen when we used Chrome 61, and suddenly appeared when it got updated to Chrome 62.

为了解决此问题,我们必须将chromedriver二进制文件更新为最新版本.您可以在此处 https://chromedriver.storage.googleapis.com/index.html

In order to fix that we had to update the chromedriver binary to the latest version. You can find the drivers on here https://chromedriver.storage.googleapis.com/index.html

我们的测试现在再次正常运行.

Our tests are now running normally again.

这篇关于Capybara Selenium Chrome打开关于Google Chrome的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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