List<String> unsortList = new ArrayList<String>();
List<WebElement>data=cell.findElements(By.xpath("//td[5]"));
for(WebElement d:data)
{
if(org.apache.commons.lang.StringUtils.isNotBlank(d.getText()))// to avoid Blank Entries getting saved in List
{
unsortList.add(d.getText()); // Code Added
}
System.out.println(d.getText());
}
//to Sort the List------> Collections.sort(unsortList);
//to Sort the List------> Collections.sort(unsortList);
No comments:
Post a Comment