Page 1 of 1

Doesn't change SearchTimeout property of element

Posted: Fri Sep 07, 2012 9:45 am
by valentin
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.

Re: Doesn't change SearchTimeout property of element

Posted: Fri Sep 07, 2012 2:26 pm
by Support Team
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

Re: Doesn't change SearchTimeout property of element

Posted: Thu Sep 20, 2012 5:56 am
by valentin
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.

Re: Doesn't change SearchTimeout property of element

Posted: Thu Sep 20, 2012 4:53 pm
by Support Team
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

Re: Doesn't change SearchTimeout property of element

Posted: Fri Sep 21, 2012 7:21 am
by valentin
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);