问题
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?
回答1:
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.
This behaviour did not happen when we used Chrome 61, and suddenly appeared when it got updated to Chrome 62.
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.
回答2:
To add to Germain's comment, since I had a hard time remembering how to update the chromedriver -- I'm on a mac and originally installed it using brew, so now I had to do a 'brew upgrade chromedriver'. Also probably a good idea to restart spring if you're using that for your tests.
回答3:
if anyone using this chromedriver-helper. Then update the chromedriver
as mentioned here. I updated to 2.33 and error is solved.
来源:https://stackoverflow.com/questions/46805148/capybara-selenium-chrome-opens-about-google-chrome