Automation - selenium using C#
We are reading a table which returns value in List<string[]>
. We need to compare the values before and after an action performed, which should not affect the table content.
Is there a way to compare both
List<string[]> ExpRequestItemsWithSection
with
List<string[]> ActRequestItemsWithSection
Till now i was using below code and it works fine. But is there any other way to compare both the collections? Any idea of making this quicker and less resource intensive as i need to process a lot of lists?
bool isRequestsMatch = true;
for (int i = 0; i < ActRequestItemsWithSection.Count; i++)
{
if (!((ActRequestItemsWithSection[i][0] == ExpRequestItemsWithSection[i][0]) &&
(ActRequestItemsWithSection[i][1] == ExpRequestItemsWithSection[i][1])))
isRequestsMatch = false;
}
PFB screenshot from Immediate window