Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: Ruby - Selenium Manager throwing error #14622

Open
kevin-roe opened this issue Oct 18, 2024 · 3 comments
Open

[🐛 Bug]: Ruby - Selenium Manager throwing error #14622

kevin-roe opened this issue Oct 18, 2024 · 3 comments

Comments

@kevin-roe
Copy link

What happened?

When running tests today Selenium started failing with this message:

/Users/kevin.roe/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.25.0/lib/selenium/webdriver/common/selenium_manager.rb:79:in `run': undefined method `positive?' for nil:NilClass (NoMethodError)

          return result unless status.exitstatus.positive? || result.nil?

I was able to reproduce the issue with this simple code:

require 'selenium-webdriver'

driver = Selenium::WebDriver.for :chrome
driver.get("https://www.google.com")
driver.quit

I tracked it down to here, where the command is returning pid 4961 SIGKILL (signal 9) on the status on line 67, causing line 79 to eventually cause the process to die.

This randomly started happening to me earlier today, and eventually 4 other members of my team started experiencing this as well. I don't have a ton of knowledge on how Selenium Manager works, but due to the random nature of this I imagine some process on my machine is pulling in some updated version of the bin/macos/seneium-manager executable and that is causing problems, but that's just my best guess.

How can we reproduce the issue?

gem install selenium-webdriver -v 4.25.0


```ruby
require 'selenium-webdriver'

driver = Selenium::WebDriver.for :chrome
driver.get("https://www.google.com")
driver.quit


### Relevant log output

```shell
2024-10-18 13:49:48 INFO Selenium [:logger_info] Details on how to use and modify Selenium logger:
  https://selenium.dev/documentation/webdriver/troubleshooting/logging

2024-10-18 13:49:48 DEBUG Selenium [:selenium_manager] Selenium Manager binary found at /Users/kevin.roe/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.25.0/bin/macos/selenium-manager 
2024-10-18 13:49:48 DEBUG Selenium [:selenium_manager] Executing Process ["/Users/kevin.roe/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.25.0/bin/macos/selenium-manager", "--browser", "chrome", "--language-binding", "ruby", "--output", "json", "--debug"] 
2024-10-18 13:49:48 ERROR Selenium Exception occurred: undefined method `positive?' for nil:NilClass

          return result unless status.exitstatus.positive? || result.nil?
                                                ^^^^^^^^^^
2024-10-18 13:49:48 ERROR Selenium Backtrace:
	/Users/kevin.roe/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.25.0/lib/selenium/webdriver/common/selenium_manager.rb:79:in `run'
	/Users/kevin.roe/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.25.0/lib/selenium/webdriver/common/selenium_manager.rb:44:in `binary_paths'
	/Users/kevin.roe/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.25.0/lib/selenium/webdriver/common/driver_finder.rb:58:in `paths'
	/Users/kevin.roe/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.25.0/lib/selenium/webdriver/common/driver_finder.rb:35:in `browser_path'
	/Users/kevin.roe/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.25.0/lib/selenium/webdriver/common/driver_finder.rb:43:in `browser_path?'
	/Users/kevin.roe/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.25.0/lib/selenium/webdriver/common/local_driver.rb:43:in `process_options'
	/Users/kevin.roe/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.25.0/lib/selenium/webdriver/common/local_driver.rb:27:in `initialize_local_driver'
	/Users/kevin.roe/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.25.0/lib/selenium/webdriver/chrome/driver.rb:34:in `initialize'
	/Users/kevin.roe/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.25.0/lib/selenium/webdriver/common/driver.rb:47:in `new'
	/Users/kevin.roe/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.25.0/lib/selenium/webdriver/common/driver.rb:47:in `for'
	/Users/kevin.roe/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.25.0/lib/selenium/webdriver.rb:89:in `for'
	/Users/kevin.roe/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/gems/qa_automation_sdk-3.4.7/lib/qa_automation_sdk/drivers/selenium_adapter.rb:19:in `create_webdriver'

Operating System

MacOS Sequoia

Selenium version

Ruby 4.25.0

What are the browser(s) and version(s) where you see this issue?

Chrome 130.0.6723.59, Firefox 131.0.3

What are the browser driver(s) and version(s) where you see this issue?

Can't get the driver - that is the problem

Are you using Selenium Grid?

No

Copy link

@kevin-roe, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@kevin-roe
Copy link
Author

kevin-roe commented Oct 18, 2024

We were able to fix the problem by reverting back to 4.24.0. We also had to uninstall 4.25.0 for the fix to work

@kevin-roe
Copy link
Author

Is there an update on this? We would prefer not have to remain on 4.24.0 for the foreseeable future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant