You can use below code to check if Alert pop up (Modal Dialog) is open on the web page or not.
You will need this code in scenario where you can not predict the presence of the Pop up Alert.
What do you think on above selenium topic. Please provide your inputs and comments. You can write to me at reply2sagar@gmail.com
try { driver.switchTo().alert(); // Alert exists and we switched to it } catch (NoAlertPresentException exception) { //this block will be executed in case alert is not present }
You will need this code in scenario where you can not predict the presence of the Pop up Alert.
What do you think on above selenium topic. Please provide your inputs and comments. You can write to me at reply2sagar@gmail.com
No comments:
Post a Comment