getting problem in finding page

Class library usage, coding and language questions.
akommalapati
Posts: 21
Joined: Wed Dec 07, 2011 2:54 pm
Location: India

getting problem in finding page

Post by akommalapati » Tue Jan 10, 2012 9: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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: getting problem in finding page

Post by Support Team » Tue Jan 10, 2012 11:26 am

Hi,

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

Regards,
Tobias
Ranorex Support Team
.
Image

sham526
Posts: 34
Joined: Wed Jul 07, 2010 7:12 am
Location: Hyderabad(INDIA)

Re: getting problem in finding page

Post by sham526 » Tue Jan 10, 2012 11:50 am

U Can Try

WebDocument webDocDOB = "//dom[@caption='" + pageName + "']
webDocDOB .WaitForDocumentLoaded()

akommalapati
Posts: 21
Joined: Wed Dec 07, 2011 2:54 pm
Location: India

Re: getting problem in finding page

Post by akommalapati » Tue Jan 10, 2012 1: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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: getting problem in finding page

Post by Support Team » Tue Jan 10, 2012 1: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
.
Image

akommalapati
Posts: 21
Joined: Wed Dec 07, 2011 2:54 pm
Location: India

Re: getting problem in finding page

Post by akommalapati » Tue Jan 10, 2012 3: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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: getting problem in finding page

Post by Support Team » Tue Jan 10, 2012 3: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
.
Image

akommalapati
Posts: 21
Joined: Wed Dec 07, 2011 2:54 pm
Location: India

Re: getting problem in finding page

Post by akommalapati » Wed Jan 11, 2012 1:02 pm

This solved my problem game wait time as 60000.

Thanks
Ajay