How to Delete Duplicate Rows From a Web Table Based on Name Column

I need some assistance with automating a web application. After clicking the Email button, a popup window appears showing a table of recipients. The table includes columns like Type, Name, Email Address, and an Action column with a “delete” link for each row.

My requirement is:

:backhand_index_pointing_right: Check for duplicate entries under the Name column

:backhand_index_pointing_right: Remove only one of the duplicate rows from the web table (using the delete option displayed for each row)

I’m able to extract the data, but I’m unsure of the best way to identify duplicates and then click the correct “delete” link in the UI for just one of those duplicate rows.

If anyone has a recommended approach—using DataTable filtering, LINQ, UI selectors, or table extraction—it would be greatly appreciated.

@BotCurator

Thats a good first step

Now you need a linq with groupby to identify duplicate rows to delete

to do that dt.AsEnumerable.GroupBy(function(x) x("ColumnNameWhichIsUniqueEmailAddressMayBe").ToString).Where(function(x) x.Count>1).Select(function(x) x.First).CopyToDatatable - this would give all the duplicate rows..

loop on them and delete the items using dynamic selector

cheers

1 Like