How to shorten 'Not Exists' duration

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

How to shorten 'Not Exists' duration

Post by ElSticky » Thu Dec 05, 2013 11: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

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

Re: How to shorten 'Not Exists' duration

Post by krstcs » Thu Dec 05, 2013 2: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)
----BodyTag(Folder)
--------TDTag(RepoItem)

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...