Skip to content

How to handle application confirmations

This example demonstrates handling the confirmation dialog box/pop up.

In the solution shown below, you will click on the button "Click for JS Confirm" which will display a java script confirmation with the value "I am a JS Confirm." in the Worksoft SaaS Training application. For any confirmation pop ups/dialog boxes, you can either accept the confirmation or cancel/decline the confirmation depending on your requirement.

Solution:

# Command Target Value
To accept a confirmation, click on OK
1chooseOkOnNextConfirmation
 
Click on the button "Click for JS Confirm"
2click //button[.='Click for JS Confirm']  
Handle the confirmation to accept the message
3assertConfirmation
I am a JS Confirm.  
To decline/cancel a confirmation
4chooseCancelOnNextConfirmation
 
Click on the button "Click for JS Confirm"
5click //button[.='Click for JS Confirm']  
Handle the confirmation to decline/cancel the message
6assertConfirmation
I am a JS Confirm.  

Tips, Tricks, Gotcha's & Best Practices: 


Feedback and Knowledge Base