Script Test step having unexplainable delay
Hello all,
I am making a test that iterates through all the child objects of a certain object. I used TestComplete's example in the Child method documentation as my starting point, and I haven't changed much:
var w, i, wndChild;
w = Aliases.browser.pageD365.sectionLanguage.panelRecentlyUsed;
Log.Message(w.Name, w.FullName);
w.Click();
// Add a for loop that iterates through child objects
for (i=w.ChildCount - 1; i >= 0; i--)
{
wndChild = w.Child(i);
// Post the current child name to the test log
Log.Message(wndChild.Name, "", 0);
// Click on the Child Object
wndChild.Click();
}
If I remove Line 12, the test runs at a normal pace. However, if I use the current Line 12, or use this:
w.Child(i).Click();
every time the test goes to run that step, it delays about 22 seconds. I know that the object it is looking for is clickable, seeing as it completes the step after that delay, and the test can run successfully. Additionally, TestComplete's test run status box in the top right does not change, and shows no sign of any unexpected delay. My guess is that the object recognition is taking a very long time for some reason, but it doesn't when looking for the same object in Line 10.
Thank you for your help and advice,
Hi !
Some times ago, I noticed that using NameMapping with a lot of objects, is incredibly slow, even if the hierarchy is correct.
So now, I avoid it almost completely (less than 10 objects), and no more slow down since.