Forum Discussion
Thanks for both of your replies!
I was able to take your suggestions and utilize them in the following code:
var RC, i;
RC = WindowObject.RowCount;
for (i = 0; i<RC; i++)
WindowObject.Expand(i)
Using that code enabled TC to expand each occurrence of "+" in the WindowObject grid!
However, I ran into an issue where one of the test cases contained a parent row with expandable child rows (please see attached photo). I tried using the code above and it didn't work but when I included additional code to expand the child rows, the parent row expanded and the child rows remained collapsed. The amended code in bold is below:
var RC, i;
RC = WindowObject.wChildView(0, "Employees").RowCount;
for (i = 0; i<RC; i++)
WindowObject.wChildView(0, "Employees").Expand(i)
Does that mean that in order to open those child rows, I would have to declare a child row within a child row? And since the first parameter of wChildView is asking for the row number, is there a way to iterate on this value within my loop to expand any additional rows?
rraghvani, when reviewing a grid that contained 1 parent row and 2 child rows, ObjectSpy revealed a total of 1 rows. However, the ChildCount is 14 so I'm wondering if that figure includes the expandable rows I'm trying to open.
- scottroutesmart3 years agoContributor
I would guess you probably need to find an identifier for the child row + boxes, separate from those of the parent row. Use the Object Spy to see if there is a unique identifier you can use to expand those children rows. You can also ask your dev team to add a specific identifier to the code so that you know exactly what to look for, such as "childexpander" Based on your screenshot, I see about 12-14 rows total depending on how the structure of table is laid out. So, I think your figure probably includes the expandable rows you are trying to open.
I was going to suggest that you may need to refresh TC's cache when you open the menu, but if it is already aware of those rows then that is likely not needed. I have found when I go to a page and perform an action which makes an API call to the server, that after the UI content is refreshed that I need to refresh TCs cache by doing something like this...
Aliases.browser.PAGENAME.TABLENAME.Refresh();
I would suggest using the "Object Browser" to figure out the structure of the page you are using and how rows are structured within. It takes some time to expand the objects and find the specific rows you need, but it often helps me know what children are being identified at each level.