Smart Folder condition

Ranorex Studio, Spy, Recorder, and Driver.
Bapu16
Posts: 44
Joined: Wed Sep 22, 2021 12:15 pm

Smart Folder condition

Post by Bapu16 » Wed Sep 22, 2021 12:34 pm

Hello,
I am new to ranorex.
I have a simple test case as mention below
  • User logs in
  • If user is admin
  • then 1st message box appears with Y/N button
  • If button no is clicked
  • then 2nd message box appears with Unlock and Cancel button
  • If user clicks Unlock then it allow user to continue with the login process

this is what I have done
1st smart folder to heck user is admin or not
2nd smart folder to check whether the 1st message appeared on the screen or not
3rd smart folder to check whether the 2nd message appeared on the screen or not

Above test works fine if all condition is correct however there will be scenario where is user is admin but 1st or 2nd message box may not appear, so if that's the case then my current test still trying to loop through 2nd and 3rd smart folder which it shouldn't

any help please.

Many thanks in advance

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

Re: Smart Folder condition

Post by odklizec » Mon Sep 27, 2021 7:48 am

Hi,

All you may need to do is to set a correct error behavior for each smart folder. Please check the user guide...
https://www.ranorex.com/help/latest/ran ... orbehavior
In my opinion, "Continue with sibling/parent or Stop" should do the trick?

However, if the "not appearance" of message is an expected behavior, you may need to implement a smart folder condition, which enables the smartfolder only if a condition is met. See more about SmartFolder conditions here:
https://www.ranorex.com/help/latest/ran ... acondition
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

Bapu16
Posts: 44
Joined: Wed Sep 22, 2021 12:15 pm

Re: Smart Folder condition

Post by Bapu16 » Mon Sep 27, 2021 3:57 pm

Hello Thanks for your response, I have tried your suggestion but for some reason it was still not getting into the loop even I have set correct condition, so I have used "UserCode" which I think working as expected.
PopupWatcherLibrary
StartPopupWatcher(RepoItemInfo findElement, RepoItemInfo clickElement)

so if message pops up then it clicks the button otherwise continue with the rest of the test,
But I really appreciate your suggestion and time thank you very much

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

Re: Smart Folder condition

Post by odklizec » Tue Sep 28, 2021 8:12 am

Hi,

Unfortunately, it's hard to tell what's wrong, without seeing the test suite, its structure and conditions. If the conditions is properly set, the condition should work. Popupwatcher is a very handy tool for random errors and popups, but I would definitely avoid using it for predictable popups and errors.
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

Bapu16
Posts: 44
Joined: Wed Sep 22, 2021 12:15 pm

Re: Smart Folder condition

Post by Bapu16 » Tue Sep 28, 2021 10:48 am

Thanks for your response,
I think what's happening is that,

I have condition to check whether sync message displayed if it does then click NO but if sync message is not displayed then test is still looking for sync message and then it fails. this is what I have

so I was thinking if message doesn't display then condition will be false and it will continue with the test.
You do not have the required permissions to view the files attached to this post.

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

Re: Smart Folder condition

Post by odklizec » Tue Sep 28, 2021 11:03 am

Hi,

The parameter must be filled with correct value "BEFORE" the test actually enters the smartfolder with condition! So you must add a recording/code module before the smartfolder with condition. This code module should evaluate the state of UI and eventually set the parameter used in SF condition.
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