Page 1 of 1

Smart Folder condition

Posted: Wed Sep 22, 2021 12:34 pm
by Bapu16
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

Re: Smart Folder condition

Posted: Mon Sep 27, 2021 7:48 am
by odklizec
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

Re: Smart Folder condition

Posted: Mon Sep 27, 2021 3:57 pm
by Bapu16
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

Re: Smart Folder condition

Posted: Tue Sep 28, 2021 8:12 am
by odklizec
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.

Re: Smart Folder condition

Posted: Tue Sep 28, 2021 10:48 am
by Bapu16
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.

Re: Smart Folder condition

Posted: Tue Sep 28, 2021 11:03 am
by odklizec
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.