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?

0

There are 0 answers