How to handle confirm() pop-up in ATF test?

iztgokul
Tera Contributor

Hello everyone,

 

I'm working on an ATF test. While submitting the Request from employee centre the UI triggers a JavaScript confirm() dialog, like this:

var correctInfo = confirm("Are you sure that " + answer.name + " with userid " + answer.userId + " is the correct person for this request?"); 

When running the test in ATF, it fails at this step because the confirm() pop-up is a browser-native dialog, and ATF can't interact with it.

Is there any recommended workaround or best practice to simulate this confirmation in ATF?

 

Thanks in advance.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@iztgokul 

not possible to test javascript confirm, prompt, alert etc using ATF.

it's a known limitation.

ATF not supporting Pop-Up browser windows 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@iztgokul 

not possible to test javascript confirm, prompt, alert etc using ATF.

it's a known limitation.

ATF not supporting Pop-Up browser windows 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thanks Ankur