Page 1 of 1

No form found??

Posted: Tue Jun 16, 2009 9:32 am
by marcushe
Environment: Ranorex2.1,Win7 US
Source code:
Duration d=new Duration(5);
RxPath rxp=new RxPath("/form"); // or use ("*") , ("form")
IList<Ranorex.Form> t=new List<Ranorex.Form>();
Ranorex.Form hdform=Host.Local.FindSingle<Ranorex.Form>("form");
t=Host.Loacal.Find<Rnorex.Form>(rxp,d);

I find , FindSingle can find the application , Find<T>(RxPath,Duration) find nothing , i use check point at the line and checked local variaty t ,of which count==0.
Do you know why?

Re: No form found??

Posted: Tue Jun 16, 2009 12:24 pm
by Support Team
Your problem in this case is that your Duration d is set to 5ms which is probably not enough.
Instead, you can directly use: Find<Ranorex.Form>("/form[@title='yourtitle']", "5s")
or without timeout at all: Find<Ranorex.Form>("/form[@title='yourtitle']")

For simple cases you can just use:

Code: Select all

Form yourForm = "/form[@title='YourFormTitle']";
which uses the Adapter.DefaultSearchTimeout.

Michael
Ranorex Team

Re: No form found??

Posted: Wed Jun 17, 2009 1:56 am
by marcushe
Michael,Thanks
The problem is sovled by properly setting suffient timeout.
Thanks for your these advices , it urged me to use many ways to implement my task.