SeleniumHQ / seleniumhq.github.io

Official Selenium website and documentation
https://selenium.dev
Apache License 2.0
1.07k stars 1.27k forks source link

[🐛 Bug]: Ruby example code is not working - Remote WebDriver - Downloads - undefined method `downloadable_files` #1751

Closed limuyuan closed 3 months ago

limuyuan commented 3 months ago

What happened?

I'm trying to use Ruby to connect to a remote WebDriver and have a zip file downloaded from a website.

Here's the official document: https://www.selenium.dev/documentation/webdriver/drivers/remote_webdriver/ https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/ruby/spec/drivers/remote_webdriver_spec.rb

I'm using Rubymine, and I got the error when trying to run the following line:

files = driver.downloadable_files

The compiler is showing as the below:

Cannot find 'downloadable_files' for type '(Selenium::WebDriver::Remote::Driver | Selenium::WebDriver::Firefox::Driver | Selenium::WebDriver::Safari::Driver | Selenium::WebDriver::IE::Driver | Selenium::WebDriver::Chrome::Driver)' 

What browsers and operating systems are you seeing the problem on?

Windows 11, RubyMine 2024.1.2, selenium-webdriver v4.4.0

github-actions[bot] commented 3 months ago

@limuyuan, 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.

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

Thank you!

titusfortner commented 3 months ago

That feature doesn't exist in that version of Selenium. Update to Selenium 4.21 and it should work.

limuyuan commented 3 months ago

That feature doesn't exist in that version of Selenium. Update to Selenium 4.21 and it should work.

Thank you, Titus, it works with 4.21.