Populating table cells with unique data - qa automation
11:00 16 Apr 2021

I have a table that looks like this -


 
  
  ...
  
 

The data in each cell is populated with a unique value from a json object, or a unique action takes place on it (ie check mark). The difficulty comes when a user can add additional rows with the same column count. How do I write an algorithm/function that will go through each cell and populate it with my unique json values or perform a specific action?

This is for Cypress QA Automation (Js/Ts). Each cell has a unique locator, but if I go that way, my page object model will have duplicate code.

javascript algorithm cypress ui-automation