Validation of NotExist does not work

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Validation of NotExist does not work

Post by JohnWashburn » Thu Jul 30, 2015 4:24 pm

I have a winforms application that will delay the closing of the main form until the spawned worker threads have been shut down in an orderly way. This can take any where from 5 seconds to 3.5 minutes depending of data in the queue to be saved. I cannot procede to the next tesu until the app has comleted

I have set the search timeout for the object within the repository to 4 minutes. But when I run the test, the validation for NotExists is executed in less than a second, the button is found, the step (and case) fails to meet expectation; the button exists, but should not.

Nor is the behavior for validate.NotExist as documented in this post.
http://www.ranorex.com/forum/post27764. ... ork#p27764
If the behavior were as documented within the post then I would expect a 4 minute delay all the time even if that is anywhere from 235 to 30 seconds too long.

What I expected is that Ranorex would poll the application under test (in some manner) and return either when either the control is no longer on present within the app under test or 4 minutes have elapsed which ever is shorter.

I am using Ranorex studio 5.4.0

I have a Ranorex solution and a simplified AUT that demonstrates this defect. I have uploaded the demo solution to the FTP site.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Validation of NotExist does not work

Post by krstcs » Thu Jul 30, 2015 5:34 pm

I think you are confusing ValidateNotExist with WaitForNotExist.

ValidateNotExist ONLY validates that the element does NOT exist for the duration given. If the element DOES exist at ANY POINT during that duration, the method immediately throws a test exception, failing the test at the point that the search-for element exists. The method does not WAIT for the element to not exist and then validate it.

You need to use the WaitForNotExist method and give the WAIT a 4 min timeout. Then you can validate not exist. WaitForNotExist will wait for the element to not exist, or until the timeout, throwing a test exception if it reaches the timeout and the element still exists.
Shortcuts usually aren't...

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Validation of NotExist does not work

Post by krstcs » Thu Jul 30, 2015 5:38 pm

To add, the mentioned post is discussing why the timeout is so long on the Validate Not Exist call, not how it works.
Shortcuts usually aren't...

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Validation of NotExist does not work

Post by JohnWashburn » Thu Jul 30, 2015 7:52 pm

Sorry for the confusion. I will use WaitFor().

I would like to renew my feature request, then.

I see when I add the item Action WaitFor in the rxrec editro the only entries in the drop down are Exists and NotExists. Is there any chance you will include my two year old feature request for WaitForValidate(Attribute, match name, match value, object, timout) in some future release of Ranorex?

The feature request is discussed here:
http://www.ranorex.com/forum/how-to-set ... t7489.html

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Validation of NotExist does not work

Post by krstcs » Fri Jul 31, 2015 2:45 pm

Why would they spend time/money to add a feature that duplicates the two existing methods when we can just add a 'wait for not exist' and then 'validate not exists' in our test modules to do the same thing?

I think adding a third function that does both would just add even more confusion. Each function does only one thing (which is in keeping with good object-oriented design) and can be used together when needed.
Shortcuts usually aren't...