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]: Chrome - org.openqa.selenium.WebDriverException: disconnected: not connected to DevTools issue #14416

Closed
haridanapana opened this issue Aug 21, 2024 · 9 comments
Labels
I-defect I-issue-template Applied to issues not following the template, or missing information.

Comments

@haridanapana
Copy link

What happened?

Hello ,
i have installed Selenium Grid using K8s which uses image Tag 4.18.1-20240224 and while executing the script i am getting
Details which we are using as part of testing
Browser Version : 126.0.6478.114
Selenium Chrome Node image Tag: 4.18.1-20240224(tried with latest release 4.23 also) and chart Version : 0.28.4
Operating system : Linux
Java version: 17.0.11
Error Message
2024-08-20 10:54:05 [ERROR] [TestNG-PoolService-6]: com.highradius.utilities.DriverUtils - error while performing wait operation - org.openqa.selenium.WebDriverException: disconnected: not connected to DevTools
(failed to check if window was closed: disconnected: not connected to DevTools)
(Session info: chrome=126.0.6478.114)
Build info: version: '4.18.1', revision: 'b1d3319b48'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.14.0-362.18.1.el9_3.0.1.x86_64', java.version: '17.0.11'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Command: [021e4565b36b00bbe6664ff97ec58459, findElement {value=//a[contains(@Class,'submitButton')]//span[text()='SUBMIT'], using=xpath}]
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 126.0.6478.114, chrome: {chromedriverVersion: 126.0.6478.63 (df799988fdc9..., userDataDir: /tmp/.org.chromium.Chromium...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:34541}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:bidiEnabled: false, se:cdp: ws://selenium-grid-selenium..., se:cdpVersion: 126.0.6478.114, se:vnc: ws://selenium-grid-selenium..., se:vncEnabled: true, se:vncLocalAddress: ws://10.55.254.13:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}

can anyone help me on this issue.

Thanks,

How can we reproduce the issue?

Install Selenium grid of Version 4.18.1-20240224 using Kubernetes and and run a selenium Script

Relevant log output

Session ID: 021e4565b36b00bbe6664ff97ec58459
2024-08-20 10:54:05 [DEBUG] [TestNG-PoolService-6]: com.highradius.utilities.ChromeDriverUtils - Entering login():  user=test_core_23474,pwd=********
2024-08-20 10:54:05 [DEBUG] [TestNG-PoolService-6]: com.highradius.utilities.HrcPage - Entering getWebElementDetails():  elementName=SUBMIT
2024-08-20 10:54:05 [DEBUG] [TestNG-PoolService-6]: com.highradius.utilities.MailUtilEx - Entering sendScenarioStatus(): 
2024-08-20 10:54:05 [DEBUG] [TestNG-PoolService-6]: com.highradius.utilities.MailUtilEx - Exiting sendScenarioStatus():  iArgs=null,oArgs=FAILED
2024-08-20 10:54:05 [ERROR] [TestNG-PoolService-6]: com.stepdefinitions.Hooks - Unable to capture the screenshot
2024-08-20 10:54:05 [ERROR] [TestNG-PoolService-6]: com.stepdefinitions.Hooks - Unable to capture the screenshot
2024-08-20 10:54:05 [ERROR] [TestNG-PoolService-6]: com.stepdefinitions.Hooks - error while taking screenshotorg.openqa.selenium.WebDriverException: disconnected: not connected to DevTools
  (failed to check if window was closed: disconnected: not connected to DevTools)
  (Session info: chrome=126.0.6478.114)
Build info: version: '4.18.1', revision: 'b1d3319b48'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.14.0-362.18.1.el9_3.0.1.x86_64', java.version: '17.0.11'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Command: [021e4565b36b00bbe6664ff97ec58459, screenshot {}]
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 126.0.6478.114, chrome: {chromedriverVersion: 126.0.6478.63 (df799988fdc9..., userDataDir: /tmp/.org.chromium.Chromium...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:34541}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:bidiEnabled: false, se:cdp: ws://selenium-grid-selenium..., se:cdpVersion: 126.0.6478.114, se:vnc: ws://selenium-grid-selenium..., se:vncEnabled: true, se:vncLocalAddress: ws://10.55.254.13:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}

Operating System

Linux

Selenium version

all Selenium 4 version tested with 4.18.1-20240224 and 4.23

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

chrome - 126.0.6478.114

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

chromedriverVersion: 126.0.6478.63

Are you using Selenium Grid?

4.18.1-20240224

Copy link

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

@diemol diemol added I-issue-template Applied to issues not following the template, or missing information. and removed needs-triaging labels Aug 21, 2024
Copy link

Hi, @haridanapana.
Please follow the issue template, we need more information to reproduce the issue.

Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue.

Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough.

Reply to this issue when all information is provided, thank you.

@diemol
Copy link
Member

diemol commented Aug 21, 2024

Please note we only support the official Helm chart. You'd need to provide the script that shows that error as well.

@haridanapana
Copy link
Author

haridanapana commented Aug 21, 2024

Hi diemol,
Thanks for your reply.

we are using the official helm chart provided in the below
https://github.com/SeleniumHQ/docker-selenium/blob/trunk/charts/selenium-grid/README.md

We have installed the selenium Grid of version 4.23 using K8s and ran the selenium scripts and observed the devtools issue.

Below is the script
private ChromeOptions createChromeRemoteDriverOptionsHeadless(String downloadFilepath, ChromeOptions options) {
HashMap<String, Object> prefs = new HashMap<>();

    prefs.put("download.default_directory", downloadFilepath);
    prefs.put("download.prompt_for_download", "False");
    options.setExperimentalOption("prefs", prefs);
    options.addArguments("--headless=new");
    options.addArguments("--window-size=" + 2560 + "," + 1440);
    options.addArguments("--disable-gpu");
    options.addArguments("--disable-dev-shm-usage");
    options.addArguments("--no-sandbox");
    options.addArguments("--disable-dev-tools");

    return options;
}

Note:
Is there any approach to install the chrome browser of version less than 123. we have tested in normal standalone VM with this 122 chrome browser version we didnt observe the devtools issue.

Thanks,

@diemol
Copy link
Member

diemol commented Aug 21, 2024

You are only sharing the options. This issue might help you #13185

@haridanapana
Copy link
Author

the above solution didnt work .
below us the code snippet
public class DevToolsHandling {
public static void main(String[] args) {
WebDriverManager.chromedriver().setup();
ChromeOptions options = new ChromeOptions();
options.addArguments("--disable-dev-shm-usage");
options.addArguments("--disable-gpu");
options.addArguments("--no-sandbox");
options.addArguments("--disable-dev-tools");

    WebDriver driver = new ChromeDriver(options);
        driver.get("https://example.com");
 }

}
Error
2024-08-20 10:54:05 [ERROR] [TestNG-PoolService-6]: com.stepdefinitions.Hooks - error while taking screenshotorg.openqa.selenium.WebDriverException: disconnected: not connected to DevTools
(failed to check if window was closed: disconnected: not connected to DevTools)
(Session info: chrome=126.0.6478.114)
Build info: version: '4.18.1', revision: 'b1d3319b48'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.14.0-362.18.1.el9_3.0.1.x86_64', java.version: '17.0.11'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Command: [021e4565b36b00bbe6664ff97ec58459, screenshot {}]
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 126.0.6478.114, chrome: {chromedriverVersion: 126.0.6478.63 (df799988fdc9..., userDataDir: /tmp/.org.chromium.Chromium...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:34541}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:bidiEnabled: false, se:cdp: ws://selenium-grid-selenium..., se:cdpVersion: 126.0.6478.114, se:vnc: ws://selenium-grid-selenium..., se:vncEnabled: true, se:vncLocalAddress: ws://10.55.254.13:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}

@VietND96
Copy link
Member

VietND96 commented Aug 22, 2024

What if you remove this arg options.addArguments("--disable-dev-tools");?

@diemol
Copy link
Member

diemol commented Aug 22, 2024

@haridanapana I am not sure if you read the issue I linked, because it is suggesting to remove --disable-dev-tools as suggested above.

@diemol
Copy link
Member

diemol commented Sep 17, 2024

We are closing this issue as we didn't get a reply from the original poster.

If someone is facing this issue, feel free to comment and provide a concise reproducible test case that includes the page required to execute the scenario (a sample page or a public site).

If you have any questions or need help, join us in the IRC/Slack channel, where the community can also assist you.

@diemol diemol closed this as not planned Won't fix, can't repro, duplicate, stale Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-defect I-issue-template Applied to issues not following the template, or missing information.
Projects
None yet
Development

No branches or pull requests

3 participants