- 확인은 당신의 IE UNEXPECTED_ALERT_BEHAVIOR는
시도 {대화 상자가 자바 스크립트 경고 아니라고
//Click the link that brings up the download dilaog
// Perform your next step : This is where the script will throw the excpetion due to the modal dialog.
}
catch(Exception e){
if(e.getMessage().contains("Modal dialog present")) {
System.out.println("A modal dialog is present. (which can be a download dialog)");
System.out.println(e.getMessage());
// the exception message includes text contained in the dialaog. You can use it for validaton.
//Use a java robot class to cancel the dialog
Robot robot= new Robot();
robot.keyPress(KeyEvent.VK_ENTER);
//Since the current focus is on cancel.. else use robot.keyPress(KeyEvent.VK_TAB) as needed.
}
을 무시하도록 설정되어있는 경우. – Arran
내 나쁜 ... 대답을 업데이 트했습니다. –