I have a TestNG scenario method as
@Then("User Enters Data")
public void feedData(IDataReader dataTable) {
List<Map<String,String>> data= dataTable.getAllRows();
}
Data is being returned as a list of map as follows:
[{TextBox=TextValue-1,DropDown=DD-1, Description=Desc-1},
{TextBox=TextValue-2,DropDown=DD-2, Description=Desc-2},
{TextBox=TextValue-3,DropDown=DD-3, Description=Desc-3}]
Selenium script required to feed the above data in the UI. How to read this hence values can be feed to UI in a sequential order. Like
TextBox=TextValue-1,DropDown=DD-1, Description=Desc-1
Then click on save button.
Incase the data is being returned is a
ListofMap<String,String>as follows:To read the
keysandvaluesyou can use the following solution:Output: