Our application contains table of web elements. My aim is to check whether the contents table is alphabetically ordered.
WebDriver d=new FirefoxDriver();
d.get("http://www.javatpoint.com/wrapper-class-in-java");
WebElement table=d.findElement(By.xpath(".//*[@id='city']/table/tbody"));
List<WebElement> lst=table.findElements(By.tagName("tr"));
System.out.println(lst);
List ls=new ArrayList<String>();
for(int i=0;i<=6;i++)
{
ls=lst.addAll(get(i).getText())
}
My aim is to store string type webelement in one list and create another list which is of sorted kind in the end compare two list. Please help.