Doesn't change SearchTimeout property of element

Ask general questions here.
valentin
Posts: 27
Joined: Thu Nov 24, 2011 2:47 pm
Location: Moscow

Doesn't change SearchTimeout property of element

Post by valentin » Fri Sep 07, 2012 9:45 am

SearchTimeout property of Element1 (which in repository = 10000ms).
In user code action I try to redefine SearchTimeout to 1000ms

Code: Select all

repo.Element1.SelfInfo.SearchTimeout = Duration(1000);
Report.Log(ReportLevel.Info, "point1");
bool exist = Element1.SelfInfo.Exists();
Report.Log(ReportLevel.Info, "point2");
but in log I see that duration between point1 and point2 approximatly 10000ms.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Doesn't change SearchTimeout property of element

Post by Support Team » Fri Sep 07, 2012 2:26 pm

Hi,

If the "Element1" is a form you have to set the SearchTimeout of the form directly:
repo.Element1.SearchTimeout = Duration(1000);
Regards,
Markus
Ranorex Support Team
.
Image

valentin
Posts: 27
Joined: Thu Nov 24, 2011 2:47 pm
Location: Moscow

Re: Doesn't change SearchTimeout property of element

Post by valentin » Thu Sep 20, 2012 5:56 am

I use method exists for element Element1.SelfInfo
If I set

Code: Select all

repo.Element1.SearchTimeout = Duration(1000);
(Element1.SelfInfo not exists) would be this code

Code: Select all

bool exist = Element1.SelfInfo.Exists();
wait 1000ms?
I try to set

Code: Select all

repo.Element1.SelfInfo.SearchTimeout = Duration(1000);
,but always wait 10000ms.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Doesn't change SearchTimeout property of element

Post by Support Team » Thu Sep 20, 2012 4:53 pm

Hi,

Now I am a little bit confused, did you try my code?
For test purposes can you please create a recording, add the form of the windows calculator to your repository and just add the following code to the Init() method of the Recording.UserCode file:
var calculator = repo.Calculator;
			
			calculator.SearchTimeout = new Duration(1000);
			calculator.SelfInfo.SearchTimeout = new Duration(1000);
			bool exists = calculator.SelfInfo.Exists();
Does this code work on your computer, I mean is the SearchTimeout set to the correct value?

Regards,
Markus
Ranorex Support Team
.
Image

valentin
Posts: 27
Joined: Thu Nov 24, 2011 2:47 pm
Location: Moscow

Re: Doesn't change SearchTimeout property of element

Post by valentin » Fri Sep 21, 2012 7:21 am

Thanks, it work.

Queerly, that duration of function

Code: Select all

calculator.SelfInfo.Exists();
is set by operation

Code: Select all

calculator.SearchTimeout = new Duration(1000);

and doesn't set by operation

Code: Select all

calculator.SelfInfo.SearchTimeout = new Duration(1000);