getting problem in finding page : Automation API

getting problem in finding page

Class library usage, coding and language questions.

getting problem in finding page

Postby akommalapati » Tue Jan 10, 2012 10:43 am

Hi,

Here is my code, some times it fails at this level that it couldn't find the page.

WebDocument webDocDOB = "//dom[@caption='" + pageName + "']";

can u please let me know a code to wait until this page is found.

Thanks
Ajay
akommalapati
 
Posts: 21
Joined: Wed Dec 07, 2011 3:54 pm
Location: India

Re: getting problem in finding page

Postby Support Team » Tue Jan 10, 2012 12:26 pm

Hi,

therefore please have a look at following chapter of our user guide:
Advanced Code Examples

Regards,
Tobias
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4843
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: getting problem in finding page

Postby sham526 » Tue Jan 10, 2012 12:50 pm

U Can Try

WebDocument webDocDOB = "//dom[@caption='" + pageName + "']
webDocDOB .WaitForDocumentLoaded()
sham526
 
Posts: 17
Joined: Wed Jul 07, 2010 8:12 am
Location: Hyderabad(INDIA)

Re: getting problem in finding page

Postby akommalapati » Tue Jan 10, 2012 2:16 pm

i have already tried this, fails in first line only doesn't come to the second line.
Advanced code example given by ranorex doesn't provide any clue for this.

Thanks
Ajay
akommalapati
 
Posts: 21
Joined: Wed Dec 07, 2011 3:54 pm
Location: India

Re: getting problem in finding page

Postby Support Team » Tue Jan 10, 2012 2:52 pm

Using

WebDocument dom = Host.Local.FindSingle("/dom[@caption='" + pageName + "']", 10000);


will use a search timeout of 10 seconds to allow your page to be loaded.

Regards,
Tobias
Support Team
User avatar
Support Team
Site Admin
 
Posts: 4843
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: getting problem in finding page

Postby akommalapati » Tue Jan 10, 2012 4:00 pm

Tried this also, some times it takes more time.
Not sure for how much time, want a loop kind with timer for 30 secs.

Thanks
Ajay
akommalapati
 
Posts: 21
Joined: Wed Dec 07, 2011 3:54 pm
Location: India

Re: getting problem in finding page

Postby Support Team » Tue Jan 10, 2012 4:24 pm

Hi,

you can simply set the search time out to 30 seconds or higher.
The search time out is the amount of time which will elapse before a not found exception will be thrown.
Which means, if your page has been loaded after 1 second, the automation code will go on after 1 second.

Regards,
Tobias
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4843
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: getting problem in finding page

Postby akommalapati » Wed Jan 11, 2012 2:02 pm

This solved my problem game wait time as 60000.

Thanks
Ajay
akommalapati
 
Posts: 21
Joined: Wed Dec 07, 2011 3:54 pm
Location: India


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests