SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
29.76k stars 8.02k forks source link

[🐛 Bug]: Timeout error when trying to capture screenshot using DevTools #14209

Open Eth3rnit3 opened 4 days ago

Eth3rnit3 commented 4 days ago

What happened?

I'm experiencing a timeout error when trying to capture a screenshot using the DevTools API in Selenium with Ruby. Below are the steps to reproduce the issue and the relevant code snippets.

How can we reproduce the issue?

  1. Initialize the Chrome driver:
    driver = Selenium::WebDriver.for :chrome
  2. Navigate to a web page:
    driver.navigate.to "http://www.google.com"
  3. Initialize DevTools:
    devtools = driver.devtools
  4. Attempt to capture a screenshot again (times out):
    devtools.page.capture_screenshot

Relevant log output

timed out after 30 seconds (Selenium::WebDriver::Error::TimeoutError)

Additional Information: I have tried initializing DevTools both before and after navigating to a web page, but the timeout error persists in both cases. Any guidance on how to resolve this issue would be greatly appreciated.

Thank you for your assistance.

Operating System

macOS Monterey 12.7.5

Selenium version

4.21.1

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

Chrome 126.0.6478.127

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

ChromeDriver 126.0.6478.63

Are you using Selenium Grid?

No

github-actions[bot] commented 4 days ago

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