Can ranores use events to detect window popups

Ask general questions here.
zuize411
Posts: 1
Joined: Tue Jun 08, 2021 11:24 am

Can ranores use events to detect window popups

Post by zuize411 » Tue Jun 08, 2021 11:26 am

Hi,
We have several errors messages that pop up unexpectidly and want to know if we can register and event to detect and handle these?

Thanks
Shawn

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

Re: Can ranores use events to detect window popups

Post by odklizec » Wed Jun 09, 2021 8:40 pm

Hi,

You can use PopupWatcher methods from Ranorex automation helpers library. For more details about automation helpers, check this webinar:
https://www.ranorex.com/blog/mastering- ... n-helpers/
And this user guide chapter:
https://www.ranorex.com/help/latest/han ... odemethods
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

rk325
Posts: 23
Joined: Mon Mar 27, 2023 6:02 pm

Re: Can ranores use events to detect window popups

Post by rk325 » Thu Jun 08, 2023 8:30 pm

Hi,

I am also trying to figure out how to use PopupWatcher, but the link to that webinar brings a page for that webinar but there is no link to the actual video.
The main method, has this signature

Code: Select all

StartPopupWatcher(RepoItemInfo findElement, RepoItemInfo clickElement)
But I'm not sure what is 'findElement' ? Is it the popup window? How do I know it from before to define it?
Yes, my program crashes because it found the famous "Restore pages?" popup while running, and the button it needs to click is precisely "behind" this popup.

Any help here? Thanks,

User avatar
doke
Posts: 112
Joined: Fri Mar 29, 2019 2:33 pm

Re: Can ranores use events to detect window popups

Post by doke » Fri Jun 09, 2023 12:58 pm

Hi,

correct : findElement is the popupform.
It can also be the button to click on. So you referce same item twice into the startpopupwatcher methode.


on the otherhand, just disable the edge option:
https://www.thewindowsclub.com/disable- ... ge-browser

Instead of programming it in ranorex, add this to your testnode(s) configuration

Good luck,
Don

rk325
Posts: 23
Joined: Mon Mar 27, 2023 6:02 pm

Re: Can ranores use events to detect window popups

Post by rk325 » Tue Jun 13, 2023 3:32 pm

Thank you for the reply Don, but I cannot disable the popup option. The program runs on different servers, unless I figure out a way to disable it "programatically". We use Chrome.
All I need now is , how to generate that popup so that I can get its definitions and use it with PopupWatcher? The only way I can think of is, by shutting down my desktop leaving all browsers open, then when I turn it on, and open a browser I will get that "Restore Pages" popup. But I've been so lucky that now I do not get that popup by doing this !!!!

Does anyone know how I can trigger the popup "Restore Pages" in Chrome?

User avatar
doke
Posts: 112
Joined: Fri Mar 29, 2019 2:33 pm

Re: Can ranores use events to detect window popups

Post by doke » Wed Jun 14, 2023 6:58 am

Hi,

to disable this in chrome:
https://support.google.com/chrome/threa ... menu?hl=en

or the way you prefer it:
kill chrome using taskmanager & reopen it manually pops up the recover tabs dialog.

Good luck!