Issue:
I want to extract the tableRow value of the second line in the original selector (i.e., 5), but I’m getting the value from the third line (i.e., 2).
Has anyone faced this before? Is there a way to fetch the parent tableRow instead of the child using GetAttribute? Or do I need to restructure my selector or approach?
Any ideas or workarounds would be much appreciated!
If the element is part of a structured HTML table, it’s more efficient to use the ‘Extract Data Table’ activity. This allows you to extract the entire table and then directly access the row you need using standard DataTable methods.
Thanks for your response.
But table is unstructured and rows are dyanamic. I want to fecth the surcharge name present in that table and using that row number I want to insert the value in respective column.
The row number present in 3rd line changes column to column but the row number present in 2nd line of selector is constant throughout that row. so need to pull it out and using that row number I will fill the value.
I tried doing find children as well as using anchor base find element & Get attribute but unable to solve the issue.
How ever I am able to fix it I will share below what logic I implemented.
The solution I implemented here is using find element activity and providing direct surcharge name as input I am able to pull out its full selector as UiElement.
Then using its outputElement.Selector.ToString and string split option(“><” as delimiter) divided that full selector in multiple lines array.
Since I know I want to extract TableRow present in 2 line of full selector, I passed Array[1] as input selector in GetAttribute activity & obtained my required value.
Closing this query from my side Since I am able to fix it now.