I need a solution how to iterate value of i
. Actually my test case contain one webtable and table have five column also fifth column contain four buttons. So depending on the first column value(for ex "admin" which is in first row) validate the value and according to that same row fifth column first button i have to click on that. I am using page object model and my all locator place in java class(for ex AddRoleLocator
class name) and my actual logic present in another java class(for ex. AddRole
). So that how to iterate value of i.
my Locator key is like that
public static By noOfRows=By.Xpath("//table[@id='group-list']/tbody/tr["+i+"]/td[1]");
This is my actual logic
List<WebElement> noOfRows = wau.getData(KumoAccessManageLocator.KumoAccessManageTableRowCount);
int count = noOfRows.size();
System.out.println(count);
for(int i=1;i<=count;i++)
{
if(wau.getText(KumoAccessManageLocator.KumoAccessManageRoleName).equals(ConstantProperties.getProperty("kumo.accessMange.newRoleName")))
{
wau.clickButton(KumoAccessManageLocator.KumoAccessManageviewRights);
}
}
so please suggest me how to resolve this problem with using page object model.