我在 Eclipse 中收到此警告:无法评估脚本:已断开连接:运行黄瓜硒脚本时未连接到 DevTools。 警告图片
我正在使用最新的 Chrome 驱动程序版本。由于这个问题,下面的代码没有给出输出。
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;
}
谁能帮我运行这段代码?