简体   繁体   English

使用 Webdriver & Ruby 的 UI 测试自动化; 无法初始化 chrome 浏览器 session

[英]UI test automation using Webdriver & Ruby; was not able to initialise the chrome browser session

Our team create functional tests using Rspec and UI tests using Selenium Webdriver with Ruby.我们的团队使用 Rspec 创建功能测试,并使用 Selenium Webdriver 和 Ruby 创建 UI 测试。

UI tests get executed as Rake tasks. UI 测试作为 Rake 任务执行。 While running one of the test, browser session was not opening, throwing "Error 500" with message as:在运行其中一项测试时,浏览器 session 未打开,抛出“错误 500”,消息如下:

"Selenium::WebDriver::Error::SessionNotCreatedError (session not created: This version of ChromeDriver only supports Chrome version 79):" “Selenium::WebDriver::Error::SessionNotCreatedError(会话未创建:此版本的 ChromeDriver 仅支持 Chrome 版本 79):”

I already updated both chrome and chrome driver version;我已经更新了 chrome 和 chrome 驱动程序版本; still I was encountering the same error.我仍然遇到同样的错误。

在此处输入图像描述

By going back and forth, I came across the solutions to similar issue but with different techstack and infra, which were not applicable to the issue I came up with.通过来回走动,我遇到了类似问题的解决方案,但技术栈和基础不同,这不适用于我提出的问题。

So finally I found that there was a gem called "chromedriver-helper", which ([link] https://rubygems.org/gems/chromedriver-helper/versions/1.0.0 ) got deprecated and it was advised to get rid of this gem, while using another one called "webdrivers".所以最后我发现有一个叫做“chromedriver-helper”的gem,它([链接] https://rubygems.org/gems/chromedriver-helper/versions/1.0.0 )被弃用了,建议去掉这个gem,同时使用另一个称为“webdrivers”的gem。

[link] https://everydayrails.com/2019/04/09/chromedriver-helper-webdrivers.html [链接] https://everydayrails.com/2019/04/09/chromedriver-helper-webdrivers.html

[link] https://github.com/flavorjones/chromedriver-helper [链接] https://github.com/flavorjones/chromedriver-helper

So I removed the deprecated gem while added the new one which was suggested and removed following the folder under home directory:因此,我删除了已弃用的 gem,同时添加了建议并在主目录下的文件夹后删除的新 gem:

$HOME/.chromedriver-helper. $HOME/.chromedriver-helper。 After these two changes, my team is now able to run the UI tests smoothly经过这两次更改后,我的团队现在能够顺利运行 UI 测试

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM