My overall goal is to validate a column in a table. The number of rows in the column changes so this is my attempt. rowNum is a defined repository variable that is in the repository item which I pass to the parameters repoItem and adapter.
The repository item looks like: .//table/tbody/tr[$rowNum]/td[3]/a
Code: Select all
public void Validate(RepoItemInfo repoItem, Adapter adapter)
{
int row = 2;
repo.rowNum = "" + row;
while (repoItem.Exists(2000)) {
string input = "";
adapter.MoveTo();
input = adapter.Element.GetAttributeValueText("InnerText");
Report.Log(ReportLevel.Info, "Status", "Row input: " + input);
row++;
repo.rowNum = "" + row;
}
}
When I am more explicit and do something like:
Code: Select all
public void ValStartsWithLastName(RepoItemInfo repoItem)
{
int row = 2;
repo.rowNum = "" + row;
while (repoItem.Exists(2000)) {
string input = "";
repo.MyApp.myRepositoyItem.MoveTo();
input = repo.MyApp.myRepositoyItem.Element.GetAttributeValueText("InnerText");
Report.Log(ReportLevel.Info, "Status", "Row input: " + input);
row++;
repo.rowNum = "" + row;
}
}
Thanks in advance