Continue to next module if Popup/Window not detected

Ranorex Studio, Spy, Recorder, and Driver.
BenAtRedbrick
Posts: 3
Joined: Thu Aug 18, 2022 11:37 am

Continue to next module if Popup/Window not detected

Post by BenAtRedbrick » Thu Aug 18, 2022 11:56 am

Hi All. Apologies if this has been asked before, I've tried searching and came up short.

I have a windows application that will throw up various pop-up windows on startup / login based on environmental elements at the time. For Instance (list is not exhaustive):

  • User Logs in
  • IF no connection to the internet - Messagebox appears with "Warning: Not connected to the internet"
  • IF local database hasn't synchronised to the cloud in 2 days - Form appears prompting user to synchronise or enter an 'Unlock Code'
  • IF local database hasn't been backed up in over a week - Messagebox appears with warning: "Database not backed up in [X] days."
Or... if there's a connection to the internet, the database is recently synchronised to the cloud AND there's a recent backup - none of these windows/popups will appear and the user will simply be logged in and taken to the application's main window.

My question is, is there a way to only run a module if a particular window is detected and simply move on to the next module if it's not? I know about ContinueOnFail and validation, but these will still run the rest of a module that would interact with the relevant window even if it's not detected - if that makes sense.

Thanks in advance for your help.

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

Re: Continue to next module if Popup/Window not detected

Post by odklizec » Tue Aug 30, 2022 10:27 am

Hi,

What you are describing, should be doable with SmartFolder conditions. Please check this post:
https://www.ranorex.info/run-recording- ... tml#p51628

Basically, you must create a Global parameter, which you can fill with true/false or whatever string you like via popup/window detection module, started before smartfolders in question. If the popup/window is found/not found, you should assign predefined global parameter with certain value. And then evaluate this parameter within Smart folder condition. But I'm afraid, all this is not doable in case of popupwatcher, which runs in a separate thread. So if you are planning to use popupwatcher, which is intended to be used with randomly appearing popups/elements at random places, this will not work. Bu from your description it sounds as if popup/window detection should be done always after login. Se the popups are predictable and therefore, popupwatcher should not be required?

Hope this helps?
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

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

Re: Continue to next module if Popup/Window not detected

Post by doke » Tue Aug 30, 2022 3:34 pm

Hi,
adding an example to Pavel's comment.
Create a recording like this when you like to use popupwatchers:

1 startpopupwatcher "no internet"
2 startpopupwatcher "unlock code"
3 startpopupwatcher "database back up"
4 enter username
5 enter password + enter
6 wait for Exists X
7 stoppopupwatcher "no internet"
8 stoppopupwatcher "unlock code"
9 stoppopupwatcher "database back up"

X should be an item that is being shown After these popups are closed by the watcher, in your case probably the main page or an item on it.\

BenAtRedbrick
Posts: 3
Joined: Thu Aug 18, 2022 11:37 am

Re: Continue to next module if Popup/Window not detected

Post by BenAtRedbrick » Fri Sep 30, 2022 4:27 pm

Thank you - just to say I didn't know about pop-up watchers and this has worked for me.