I believe you will need to use nested withConfirm() calls in this case:
def firstPopupText
def secondPopupText
secondPopupText = withConfirm(true) {
firstPopupText = withConfirm(true) { clickSubmitBtn() }
}
I've not tested it but I checked the implementation and there's also a test
for nested confirms (geb.AlertAndConfirmHandlingSpec.nested confirms) so
I'm fairly sure it will work.
Marcin
On Thu, Dec 10, 2020 at 8:12 PM GebUser <[email protected]> wrote:
> hi,
> How can I handle this situation with Geb WithAlert?
> 1)click a submit button opens opo-up # 1
> 2) Verify text in pop-up #1 and click OK button to close it
> 3) Closing pop-up # 1 opens pop-up #2
> 4)Verify text in pop-up # 2 and click OK button to close it
>
> I tried the following command but it is closing both the pop-ups
>
> withConfirm(true) {clickSubmitBtn()} == "Are you sure you want tosubmit?"}
>
> Thanks,
> Ramesh
>
> --
> You received this message because you are subscribed to the Google Groups
> "Geb User Mailing List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/geb-user/547af3b6-3450-4ab3-b153-66ce598e0117n%40googlegroups.com
> <https://groups.google.com/d/msgid/geb-user/547af3b6-3450-4ab3-b153-66ce598e0117n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups "Geb
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/geb-user/CA%2B52dQS3K07h_R2hZ44h7pcmxnAn4bhR9J7yLbvY%3DtRibqMO9A%40mail.gmail.com.