Not able to handle pop up in record and playback

Ask general questions here.
upendra
Posts: 22
Joined: Tue Oct 06, 2015 11:27 am

Not able to handle pop up in record and playback

Post by upendra » Tue Jan 07, 2020 11:48 am

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
Attachments
Warning POPup.rxsnp
(605.29 KiB) Downloaded 10 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6027
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

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

Post by odklizec » Tue Jan 07, 2020 12:10 pm

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?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

upendra
Posts: 22
Joined: Tue Oct 06, 2015 11:27 am

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

Post by upendra » Wed Jan 08, 2020 9:57 am

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
Attachments
Warning.rxsnp
(78.55 KiB) Downloaded 8 times
Recording2.rxrec
(8 KiB) Downloaded 7 times
Click On Yes Button.rxsnp
(78.99 KiB) Downloaded 8 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6027
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

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

Post by odklizec » Wed Jan 08, 2020 10:06 am

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.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

upendra
Posts: 22
Joined: Tue Oct 06, 2015 11:27 am

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

Post by upendra » Wed Jan 08, 2020 3:14 pm

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
Attachments
RMS-Create Purchase Order.zip
(1.15 MiB) Downloaded 10 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6027
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

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

Post by odklizec » Wed Jan 08, 2020 3:44 pm

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).
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

upendra
Posts: 22
Joined: Tue Oct 06, 2015 11:27 am

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

Post by upendra » Thu Jan 09, 2020 12:00 pm

Hi ,
I manually zipped the entire ranorex solution(excluding REPORTS, BIN and OBJ folders) and attached herewith.

Regards
Upendra
Attachments
RMS-Create Purchase Order-2.zip
(295.62 KiB) Downloaded 7 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6027
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

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

Post by odklizec » Thu Jan 09, 2020 12:39 pm

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
(1.16 MiB) Downloaded 11 times
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

upendra
Posts: 22
Joined: Tue Oct 06, 2015 11:27 am

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

Post by upendra » Fri Jan 10, 2020 9:57 am

Thanks odklizec!
Now the script is running fine.

Regards
Upendra