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]: Can't Fetch the Driver Path #13876

Closed
pgundlupetvenkatesh opened this issue Apr 25, 2024 · 5 comments
Closed

[🐛 Bug]: Can't Fetch the Driver Path #13876

pgundlupetvenkatesh opened this issue Apr 25, 2024 · 5 comments

Comments

@pgundlupetvenkatesh
Copy link

pgundlupetvenkatesh commented Apr 25, 2024

What happened?

I am trying to get to Driver path so I can fetch driver version and by running below code throws undefined method 'driver_path' for Class:Class error

options = Selenium::WebDriver::Options.chrome(browser_version: 'stable')
finder = Selenium::WebDriver::DriverFinder.new(options, Selenium::WebDriver::Chrome::Service)
puts "Driver path: #{finder.driver_path}"

I am referring the above code from https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/ruby/spec/drivers/service_spec.rb#L34

Specs:
Ruby v3.2.1
Watir v7.3
Selenium-webdriver v4.20.0

How can we reproduce the issue?

options = Selenium::WebDriver::Options.chrome(browser_version: 'stable')
path = Selenium::WebDriver::DriverFinder.new(options, Selenium::WebDriver::Chrome::Service)
puts "Driver path: #{path.driver_path}"

Relevant log output

2024-04-25 12:43:34 DEBUG Selenium [:selenium_manager] Selenium Manager binary found at <ruby_path>/selenium-webdriver-4.20.0/bin/windows/selenium-manager.exe
2024-04-25 12:43:34 DEBUG Selenium [:selenium_manager] Executing Process ["<ruby_path>/selenium-webdriver-4.20.0/bin/windows/selenium-manager.exe", "--browser", "chrome", "--browser-version", "stable", "--language-binding", "ruby", "--output", "json", "--debug"]
2024-04-25 12:43:35 DEBUG Selenium [:selenium_manager] chromedriver not found in PATH
2024-04-25 12:43:35 DEBUG Selenium [:selenium_manager] chrome detected at <chrome_path>\chrome.exe
2024-04-25 12:43:35 DEBUG Selenium [:selenium_manager] Running command: wmic datafile where name='<chrome_path>\\chrome.exe' get Version /value
2024-04-25 12:43:35 DEBUG Selenium [:selenium_manager] Output: "\r\r\n\r\r\nVersion=124.0.6367.78\r\r\n\r\r\n\r\r\n\r"
2024-04-25 12:43:35 DEBUG Selenium [:selenium_manager] Detected browser: chrome 124.0.6367.78
2024-04-25 12:43:35 DEBUG Selenium [:selenium_manager] Discovered online chrome version (124) is the same as the detected local chrome version
2024-04-25 12:43:35 DEBUG Selenium [:selenium_manager] Required driver: chromedriver 124.0.6367.78
2024-04-25 12:43:35 DEBUG Selenium [:selenium_manager] chromedriver 124.0.6367.78 already in the cache
2024-04-25 12:43:35 DEBUG Selenium [:selenium_manager] Driver path: <user_home>\.cache\selenium\chromedriver\win64\124.0.6367.78\chromedriver.exe
2024-04-25 12:43:35 DEBUG Selenium [:selenium_manager] Browser path: <chrome_path>\Google\Chrome\Application\chrome.exe
2024-04-25 12:43:35 DEBUG Selenium [:driver_service] Executing Process ["<user_home>\\.cache\\selenium\\chromedriver\\win64\\124.0.6367.78\\chromedriver.exe", "--port=9515"]
2024-04-25 12:43:35 DEBUG Selenium [:process] Starting process: ["<user_home>\\.cache\\selenium\\chromedriver\\win64\\124.0.6367.78\\chromedriver.exe", "--port=9515"] with {[:out, :err]=>#<IO:<STDERR>>}
2024-04-25 12:43:35 DEBUG Selenium [:process]   -> pid: 10100
Starting ChromeDriver 124.0.6367.78 (a087f2dd364ddd58b9c016ef1bf563d2bc138711-refs/branch-heads/6367@{#954}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
2024-04-25 12:43:36 DEBUG Selenium [:command] -> POST session
2024-04-25 12:43:36 DEBUG Selenium [:command]    >>> http://127.0.0.1:9515/session | {"capabilities":{"alwaysMatch":{"browserName":"chrome","platformName":"windows","pageLoadStrategy":"eager","unhandledPromptBehavior":"ignore","goog:chromeOptions":{"args":["--ignore-certificate-errors","--start-maximized","--disable-extensions"],"binary":"<path>\\Google\\Chrome\\Application\\chrome.exe","prefs":{"download":{"prompt_for_download":false,"default_directory":"<path>\\cucumber-watir\\downloads"},"credentials_enable_service":false,"password_manager_enabled":false},"excludeSwitches":["enable-logging","enable-automation"]}}}}
2024-04-25 12:43:36 DEBUG Selenium [:header]      > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=UTF-8", "User-Agent"=>"selenium/4.20.0 (ruby windows)", "Content-Length"=>"558"}
2024-04-25 12:43:38 DEBUG Selenium [:header]    <<<  {"content-length"=>["874"], "content-type"=>["application/json; charset=utf-8"], "cache-control"=>["no-cache"]}
2024-04-25 12:43:38 DEBUG Selenium [:command] <- {"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"124.0.6367.78","chrome":{"chromedriverVersion":"124.0.6367.78 (a087f2dd364ddd58b9c016ef1bf563d2bc138711-refs/branch-heads/6367@{#954})","userDataDir":"<user_home>\\AppData\\Local\\Temp\\2\\scoped_dir10100_1412998568"},"fedcm:accounts":true,"goog:chromeOptions":{"debuggerAddress":"localhost:59403"},"networkConnectionEnabled":false,"pageLoadStrategy":"eager","platformName":"windows","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"ignore","webauthn:extension:credBlob":true,"webauthn:extension:largeBlob":true,"webauthn:extension:minPinLength":true,"webauthn:extension:prf":true,"webauthn:virtualAuthenticators":true},"sessionId":"f73bc4b945d9692eed3e9a8cf5be729a"}}
2024-04-25 12:43:38 ERROR Selenium Exception occurred: undefined method `driver_path' for Class:Class
2024-04-25 12:43:38 ERROR Selenium Backtrace:
        <ruby_path>/selenium-webdriver-4.20.0/lib/selenium/webdriver/common/driver_finder.rb:44:in `paths'
        <ruby_path>/selenium-webdriver-4.20.0/lib/selenium/webdriver/common/driver_finder.rb:33:in `driver_path'
      Unable to obtain ; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location (Selenium::WebDriver::Error::NoSuchDriverError)

Operating System

Windows 10

Selenium version

4.20.0

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

Chrome v124, Edge v124

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

ChromeDriver 124.0.6367.78

Are you using Selenium Grid?

No

Copy link

@pgundlupetvenkatesh, 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!

@simi
Copy link

simi commented Apr 25, 2024

seems related to #13386

p0deje added a commit that referenced this issue Apr 25, 2024
This was accidentally removed in #13386.
Fixes #13876.
Related to rails/rails#51658.
p0deje added a commit that referenced this issue Apr 25, 2024
This was accidentally removed in #13386.
Fixes #13876.
Related to rails/rails#51658.
p0deje added a commit that referenced this issue Apr 25, 2024
This was accidentally removed in #13386.
Fixes #13876.
Related to rails/rails#51658.
@p0deje p0deje closed this as completed in cf5393b Apr 26, 2024
@p0deje
Copy link
Member

p0deje commented Apr 26, 2024

This was accidentally removed API that should have been deprecated instead. Sorry, should be fixed in 4.20.1.

@pgundlupetvenkatesh
Copy link
Author

pgundlupetvenkatesh commented Apr 26, 2024

@p0deje Thank you for the fix. It's working fine now.

Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators May 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants