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
takes long time to identify the object
Re: takes long time to identify the object
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.
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...
Ciege...
Re: takes long time to identify the object
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
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
Re: takes long time to identify the object
From you existing code snippet...
Change your to a lower level element, such as a container in your DOM object...
Then change the to use the element you want to root from (from above)... Replace the webDocument.TryFindSingle to yourElement.TryFindSingle.
Change your
Code: Select all
WebDocument webDocument ="/dom[@page='index.cfm']";
Then change the
Code: Select all
found = webDocument.TryFindSingle(".//img[@title='Invoice Cycle ID']",50000, out findCycleId);
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...
Ciege...
Re: takes long time to identify the object
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...
Ciege...