Page 1 of 1

Not able to handle pop up in record and playback

Posted: Tue Jan 07, 2020 11:48 am
by upendra
Hi,
While creating a script for my application , a pop up window displaying which i am not able handle via pop up watcher.
POP UP will not be displayed for each and every scenarios , it will display for some specific scenarios.
If pop up displayed , user has to click Yes.
SO my script requires if pop up displayed it will click on Yes and if no pop up displayed script will continue without any fail.
I tried with pop up watcher but not succeeded.
I am using record and playback as i am not strong in coding.
Snapshot attached for the pop up window.

Thanks in Advance!
Upendra

Re: Not able to handle pop up in record and playback

Posted: Tue Jan 07, 2020 12:10 pm
by odklizec
Hi,

Basically, you must track the popup using this xpath:

Code: Select all

//div[@id~'genericYesNoDialog']//table//tr/td/div[@innertext='Warning']
and here is the xpath for 'Yes' button:

Code: Select all

//div[@id~'genericYesNoDialog']//div[@id~'genericYesNoDialog_yes']//span[@innerText='Yes']
You must apply these xpaths in popup watcher, either in popup watcher form automation helpers or user-coded popup watcher. Are you using popup watcher from automation helpers?

Re: Not able to handle pop up in record and playback

Posted: Wed Jan 08, 2020 9:57 am
by upendra
Hi odklizec ,
Thanks for your reply.
Yes i am using pop up watcher from automation helpers.
I have updated the X-path for both warning and Yes and then i have added a user code for popup watcher from select library
and then assign the repo element (warning and Yes) to the pop up watcher.
When running , it is not clicking Yes .
I also tried to update the code for pop up watcher by assigning repo element but not succeeded. I am new to the coding.
I know i am missing something but no able to rectify it , can you please advise!
Record module and screenshot of x-path added as an attachment.
Thanks!

Regards
Upendra

Re: Not able to handle pop up in record and playback

Posted: Wed Jan 08, 2020 10:06 am
by odklizec
Hi,

Neither of the snapshots you posted shows the warning, hence the xpaths I suggested cannot be found.

As for the recording, unfortunately, it's not enough. Please post entire solution. You can use menu Tools >> Compress Solution... menu to compress the solution and then upload the zip file.

Re: Not able to handle pop up in record and playback

Posted: Wed Jan 08, 2020 3:14 pm
by upendra
Hi ,
Please find the compelete solutuion as an attachment.

Note: This warning POP up window is not a single window , it has three sections. one is warning on Top, 2nd is text message and third is Yes and No Option.


Regards
Upendra

Re: Not able to handle pop up in record and playback

Posted: Wed Jan 08, 2020 3:44 pm
by odklizec
Hi,

I'm afraid, the zip appears to be corrupted and cannot be opened. Could you please try to archive the solution again? Eventually, zip it manually (everything in solution folder, excluding REPORTS, BIN and OBJ folders).

Re: Not able to handle pop up in record and playback

Posted: Thu Jan 09, 2020 12:00 pm
by upendra
Hi ,
I manually zipped the entire ranorex solution(excluding REPORTS, BIN and OBJ folders) and attached herewith.

Regards
Upendra

Re: Not able to handle pop up in record and playback

Posted: Thu Jan 09, 2020 12:39 pm
by odklizec
Hi,

It seems you forgot to add also rxsln file to the archive. Anyway, I recreated it. In the attached file you can find how the popupwatcher implementation should look like.

BTW, please notice I added another domain to the DOM element. The snapshot you initially posted appears to use slightly different domain, than used in repo. In case the test is run on different domains, you must add all relevant domains to DOM. Eventually, you can use single domain with regex, like this: @domain~'tggort(dev|uat)as01:9002'
RMS-Create Purchase Order.zip

Re: Not able to handle pop up in record and playback

Posted: Fri Jan 10, 2020 9:57 am
by upendra
Thanks odklizec!
Now the script is running fine.

Regards
Upendra