More Efficient Searches
Again, I'm new to TestComplete, so apologies in advance if this question is redundant.
We are developing in Angular 2.0 with a lot of dynamic content. We are trying to search across a set of results returned from a search that may encompass many pages of results (think ~50 pages of results with 7 results per page). Currently every time we have to search a new page of results we have load another page object and this takes about 3-4s per page load. We'd like to make this a little more efficient. I'm inclined to think this is because we're using a page object to get the result set displayed as follows and every time we are getting an object, the complete DOM is being polled:
evalObject = page.Page.FindChildByXPath(xpathToEval);
With evalObject being the one item in the result set displayed and xpathToEval being the xpath to that object
What I'd like to do is maybe take the container holding all of the result set item and iterate through them as follows (pseudo code follows)
containerObject = page.Page.FindChildByXPath(xpathToContainer)
evalObjects = Collection Of results (xpathToCommonAttribute) from container Object
{
for(i = 0; i < evalObject.length; i++)
{
//do comparison on expected text and text of evalObject[i]
}
if (item not found)
{
//click the next page and reload the container
}
}
(end pseudo code)
I don't see where this is possible because it isn't possible to evaluate the children of anything other than a page object. Is there a better way to do this and, in this case, evaluatre the results from the container object?
Thanks!!