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?
No form found??
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: No form found??
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:
which uses the Adapter.DefaultSearchTimeout.
Michael
Ranorex Team
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']";
Michael
Ranorex Team
Re: No form found??
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.
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.