No form found??

Ask general questions here.
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");

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

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.

Ranorex Team

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

Re: No form found??

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

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.