takes long time to identify the object

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

takes long time to identify the object

Post by omayer » Tue Aug 21, 2012 8:17 pm

it does take 50sec to find the imgtag, what else could i try to reduce the timing, if i changed to 40sec it can't identify the object
{
bool found = true;
WebDocument webDocument ="/dom[@page='index.cfm']";
ImgTag findCycleId;
found = webDocument.TryFindSingle(".//img[@title='Invoice Cycle ID']",50000, out findCycleId);
findCycleId.Click();
}
Thank you In advance
Tipu

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: takes long time to identify the object

Post by Ciege » Tue Aug 21, 2012 11:03 pm

Well, you are rooted at your DOM object and searching down. If your imgtag is buried deep in the web page or there are a lot of other elements in the webpage it can take quite some time to search for that imgtag.

You can change your root from where you begin searching at. Such as if the imgtag is in a specific container you can root to that container.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: takes long time to identify the object

Post by omayer » Wed Aug 22, 2012 2:30 pm

Thank you Ciege, will do search on container level.
Tipu

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: takes long time to identify the object

Post by omayer » Wed Aug 22, 2012 5:35 pm

Hi Ciege,
Would you please give some code sample for not to search from the root level since can't find the object when webdoc was not used as root , thank you in advance
Tipu

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: takes long time to identify the object

Post by Ciege » Wed Aug 22, 2012 5:48 pm

From you existing code snippet...
Change your

Code: Select all

WebDocument webDocument ="/dom[@page='index.cfm']";
to a lower level element, such as a container in your DOM object...

Then change the

Code: Select all

found = webDocument.TryFindSingle(".//img[@title='Invoice Cycle ID']",50000, out findCycleId);
to use the element you want to root from (from above)... Replace the webDocument.TryFindSingle to yourElement.TryFindSingle.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: takes long time to identify the object

Post by Ciege » Wed Aug 22, 2012 5:51 pm

Keep in mind... the element you are searching for must be a child or descendant of the element you are rooting your search from...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

omayer
Posts: 458
Joined: Thu Oct 28, 2010 6:14 pm

Re: takes long time to identify the object

Post by omayer » Wed Aug 22, 2012 6:24 pm

thank you Ciege, going to try it now
Tipu