Delete table rows programatically

Class library usage, coding and language questions.
samrak_88
Posts: 1
Joined: Tue Jan 06, 2015 8:53 am

Delete table rows programatically

Post by samrak_88 » Tue Jan 06, 2015 9:03 am

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!

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Delete table rows programatically

Post by Support Team » Wed Jan 07, 2015 2:52 pm

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