Rayan
Rayan

Reputation: 11

Selenium IDE - chooseOkOnNextConfirmation without assertConfirmation?

I'm pretty much new to Selenium IDE and dealing with a JavaScript confirmation pop-up. I want the script to book a table for me but depending on what table I get (which I can't know before) the confirmation pop-up contains different text. Only the first sentence always stays the same. When I use assertConfirmation I should include the text as is in the pop-up, right? Is there a way for the script to still confirm the pop-up even if I only have the first sentence of the pop-up as the assertConfirmation value? Unfortunately, I can't test the script because the booking is time sensitive and will only be available later. My script looks like this:

chooseOkOnNextConfirmation 
click                        //*[@id="table_id"]/tbody/tr[1]/td[6]/button
assertConfirmation           Are you sure you want to submit your request for the 
                             following unit: Location Description: **{THIS IS NOW 
                             ALL VARIABLE TEXT}**

How can I make this work? Do I need the assertConfirmation for Selenium to execute my chooseOkOnNextConfirmation? If so, how can I make it confirm even without the full text shown in the pop-up as the assertConfirmation Value?

Thank you so much in advance! Your help is really appreciated!

Upvotes: 0

Views: 622

Answers (1)

Adelin
Adelin

Reputation: 8209

Regular expression patters should be accepted, so you can change as follows:

chooseOkOnNextConfirmation 
click                        //*[@id="table_id"]/tbody/tr[1]/td[6]/button
assertConfirmation           glob:Are you sure you want to submit your request for the 
                             following unit: Location Description: *
                                                                   ^ note - it means all

You might find this guide useful

Upvotes: 1

Related Questions