无法在firefox上使用java处理selenium webdriver中的警报
当我登录到我的网站时,会出现一个弹出警报“您是否允许MyWeb向您发送通知”,但由于它没有HTML,我找不到它的定位器
try {
WebDriverWait wait=new WebDriverWait(driver,10);
Alert alert=wait.until(ExpectedConditions.alertIsPresent());
presentFlag=true;
alert.accept();
}
catch (Exception e) {
e.printStackTrace();
}
# 1 楼答案
当您实例化webdriver tyr时,请执行以下操作: