I'm trying to read the rows and columns of a custom built table in an Application. This is a dynamic table and the number of rows keep increasing or decreasing based on certain actions. I'm trying to read the first column of the last row in the table and for that I tried using the object spy. here the object recognizes each of the rows in the first column as Cell(0,0). I'm not able to come up with any unique way to identify the newly added rows.
Also, I checked for the unique properties, but I don't see any which would identify the cell as unique.
I also tried looking at other such questions posted on the community, but nothing helped so far.
any help would be greatly appreciated
If you are finding the "Cell" within the table, then it should respond to standard table properties. This means your table object should have a RowCount property.
So, if you want to read the first column of the last row, you should do something like this:
EDIT: Since your table is dynamic in rows, the above method is the recommended method for getting to any particular cell. Mapping the cell will not get you what you want since that first number will be changing every time. When it comes to dynamically generated content like this, it's best to map the parent object (in this case, the table) and use code expressions like what I've noted to get to individual cells.
As I explained in my post that no matter which row I'm looking at every cell in the first column is mapped as Cell(0,0) so RowCount doesn't help here. for more Info please have a look at this one: ColumnIndex and RowIndex is always set to 0
Instead of mapping unique cells, If you know what entry[one unique column value is enough] is going to add it your table, then you find them with the expected values and see whether those entry got reflected in table or not.
If you are not sure what values going to add, You can't validate it right way but you can validate with assumption that it is inserting it lastrow.
nope..I wouldn't know what data might appear in the table. it's all being auto-populated by restful services and the size is never the same...sometimes there are 8 rows and sometimes there are 3 rows. I would want to read the value of Cell in first column after reading the corresponding status in the same row in second Column.
What you are looking at there is not the mapping, it is the object browser. Can you give us a screenshot showing the table object in the object browser with the child objects expanded? It should look something like:
Basically, what I'm suggesting you do is to not use Object Spy or any other way of grabbing the cell directly from the screen but to enter in the code as I showed in my first response. In my example above, my Table has these properties:
Do you have similar properties?
Sure Robert..here's the screenshot. you'll see that here only columnindex would change, and rowIndex would always remain 0
Wow... that's a strange looking table where the child objects of the table aren't cells but are panels... that's those extra div tags in the HTML.. really bizzare way of building a table.
In any case, we'll have to look elsewhere for the properties... with the desired cell highlighted, what happens if you go to advanced view (there's a link at the top of the properties panel)? What other properties are available that we could perhaps look for?
Thank you Robert! I felt the same way about this object. Even after using 'Advanced' it doesn't help. I've to talk with the architects to make it better.
appreciate your help.
Sometimes you can execute the 'getItemCount()' method to get the # of rows/items from the table. I've have some success using this with SWT controls. This might not be available for the custom Angular controls.