I have been asked this question three time in interview how to handle random popup in selenium when we dont know when popup will appear I tried to read above link but tried to understand but i am not getting. In my job i was doing automation of RestAPI using restassured and now I am getting jobs require selenium. Can you help me with my query.
InstructorDemo Reply on 17/10/2018
Simple take the path of the alert buttons.If you want to accept then take the xpth for accept .for dismiss take the path of dissmis button and click.Use the below command