How to shorten 'Not Exists' duration

Ranorex Spy, Recorder, and Studio.
Posts: 34
Joined: Tue Sep 17, 2013 12:45 pm

How to shorten 'Not Exists' duration

Post by ElSticky » Thu Dec 05, 2013 10:39 am

Is there a way to shorten the time it takes to search for an item that 'Not Exists'? Now it takes 30 seconds. Changing the Duration doesn't change it

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

Re: How to shorten 'Not Exists' duration

Post by krstcs » Thu Dec 05, 2013 1:33 pm

Actually, that is the correct way to do it, but you need to change the duration on all parent folders as well.

So, if you have a structure like this:

WebDocument (ROOT)

And you are trying to check that the BodyTag and TDTag don't exist, you need to set both of their durations.

Code: Select all

Duration newDuration = new Duration(5);
Duration oldBodyInfoDuration = BodyTag.SelfInfo.SearchTimeout;
Duration oldBodyDuration = BodyTag.SearchTimeout;
BodyTag.SelfInfo.SearchTimeout = newDuration;

Duration oldTDDuration = TDTagInfo.SearchTimeout;
TDTagInfo.SearchTimeout = newDuration;

if (BodyTag.SelfInfo.Exists() and TDTagInfo.Exists()) {
    //do something here...

BodyTag.SelfInfo.SearchTimeout = oldBodyInfoDuration ;
Note that there are 2 SearchTimeout attributes for folders. One is under the folder object itself, the other is under the SelfInfo object.

For regular items, there is only one, under the ItemInfo object.

I don't know why it is like this, but for folders I have found that I have to change both for it to actually work the way I expect.
Shortcuts usually aren't...