No form found??

Ask general questions here.
marcushe
Posts: 112
Joined: Tue Apr 14, 2009 6:38 am

No form found??

Post by marcushe » Tue Jun 16, 2009 9:32 am

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?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: No form found??

Post by Support Team » Tue Jun 16, 2009 12:24 pm

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

marcushe
Posts: 112
Joined: Tue Apr 14, 2009 6:38 am

Re: No form found??

Post by marcushe » Wed Jun 17, 2009 1:56 am

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.