Page 1 of 1

Delete table rows programatically

Posted: Tue Jan 06, 2015 9:03 am
by samrak_88
Hello.

I am trying to do the following:
1. Get all rows from table on page.
2. Delete row by row.

If table has 3 rows, and I delete one, then only 2 rows are left on the page and so on.
The issue is that the first time I enter the loop, the row count is for example 3 and everything is ok for that row.
When I delete that row, then in the next iteration, the row count is ok, but all rows have just null values for each of the property.
When I track the row with the Spy, everything is OK, but in code no.
We dont use Ranorex studio, just Visual Studio with integrated Ranorex support for tracking elements and using API.
I have experienced this issue on one more page in the application I have been working on. It is web-app.

Thanks in advance for any help!

Re: Delete table rows programatically

Posted: Wed Jan 07, 2015 2:52 pm
by Support Team
Hi samrak_88,

I suppose that the table will be reloaded after you delete the first row and this is why the previous saved row elements will become invalid. To workaround this issue you need to reload your row elements and use the new adapters to delete the other row.

Regards,
Markus