Failed to recognize the new childcount
I tried to retrieve an element's ChildCount, it originally is 9. Then I called Touch(), it will expands and show up a sub menu. By using ObjectSpy, its ChildCount becomes 17. However I can't get the number 17 using neither script nor keyword test. Is there a way to force TC to read the new object?
Original:
a
b
c
After touch:
a
b
>b1
>b2
>b3
c
Script:
var x = new definitions.Category_List_Page();
Log.Message(x.numOfCategories);
var cat = definitions.get_CLP_subCatItem(2);
cat.Touch();
Delay(6000);
var y = new definitions.Category_List_Page();
Log.Message(y.numOfCategories);
The only workaround I can use, is probably recognize each status of the list (by expanding each sub item) to be different objects:
1) default page with no sub items expanded/touched
2) page1 with item 1 touched
3) page2 with item 2 touched
......
But this sounds silly.