Please Find my code, its not Returning the Array object value, its return only one array object
public String[] verify_userRole(String[] Expected_role) {
String[] actual_role = new String[4];
String first;
WebElement role_table = driver.findElement(By
.xpath("//*[@id='tblListView']/tbody[1]"));
List<WebElement> allRows = role_table.findElements(By.tagName("tr"));
for (WebElement row : allRows) {
List<WebElement> cells = row.findElements(By.tagName("td"));
for (WebElement cell : cells) {
first = cell.getText().toString();
actual_role = new String[] {first};
}
}
return actual_role;
}
variable first its contain Four values ("name","name1","name2","name3") after convert this string value into an array (actual_role) then its return only one value ("name")
Please clarify what is the Problem for the above code