0

I get this warning in eclipse : Unable to evaluate script: disconnected: not connected to DevTools when running cucumber selenium script. image of the warning

I am using the latest Chrome driver version. Since this issue, the following code does not give the out put.

enter code here public boolean isMixedContentWarningsAppearing() {
    String warning = null;
    boolean result = true;

    try {
        LogEntries entry = driver.manage().logs().get(LogType.BROWSER);

        List<org.openqa.selenium.logging.LogEntry> logs = entry.getAll();

        for (org.openqa.selenium.logging.LogEntry e : logs) {
            if (e.toString().contains("Accessing")) {

                System.out.println("..... warnings...." + e);
                warning = e.toString();
                // Reporter.addStepLog(warning);
            }

        }

    } catch (Exception e) {

    }

    if (warning == null) {
        result = false;
        Reporter.addStepLog("No MixedContent warnings");
    } else {
        result = true;
        Reporter.addStepLog("The application contains Mixed Contents");
    }

    return result;
}

can anybody help me to run this code?

lakmali
  • 1
  • 2
  • Does this answer your question? [org.openqa.selenium.WebDriverException: disconnected: not connected to DevTools error using ChromeDriver Chrome using Selenium and Java](https://stackoverflow.com/questions/59847431/org-openqa-selenium-webdriverexception-disconnected-not-connected-to-devtools) – K. B. Dec 13 '20 at 09:05
  • No I am using the latest chromedriver: ChromeDriver 87.0.4280.88. is this a version mismatch? – lakmali Dec 13 '20 at 09:13
  • What version of Chrome Browser are you using? Is it compatible with your ChromeDriver version? – K. B. Dec 13 '20 at 09:16
  • Yes I am using the same version for both webdriver and browser . it is 87.0.4280.88. this, List logs = entry.getAll(); returns a empty list now. But it gave all the warnings before. is this happening due to this devtool disconnection? – lakmali Dec 13 '20 at 09:49

0 Answers0