Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.7k points)

I have a button that displays Javascript confirmation popup. This is a part of my test case:

<tr>

    <td>clickAndWait</td>

    <td>buttonId</td>

    <td></td>

</tr>

<tr>

    <td>verifyTextPresent</td>

    <td>Object has been deleted</td>

    <td></td>

</tr>

It works as expected: OK is clicked automatically on a popup and verifyTextPresent return true. Still, I get [error] There was an unexpected Confirmation! in the log and test case fails.

Any suggestions?

1 Answer

0 votes
by (62.9k points)

I encountered the same problem, and I solved it like this:

 

chooseOkOnNextConfirmation click buttonId assertConfirmation

 

This makes my test run green in my Selenium IDE.

 

The code to do this is:

 

<tr>

    <td>chooseOkOnNextConfirmation</td>

    <td></td>

    <td></td>

</tr>

<tr>

    <td>click</td>

    <td>ctl00_CPHMain_ucFormDMS_grdDocumentList_ctl00_ctl04_btnDelete</td>

    <td></td>

</tr>

<tr>

    <td>assertConfirmation</td>

    <td>Areyousureyouwanttodeletethisdocument?</td>

    <td></td>

</tr>

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...