How to check webelements in webtable is sorted alphabetically using selenium webdriver?
<p>Our application contains table of web elements. My aim is to check whether the contents table is alphabetically ordered.</p>

<pre><code>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&lt;WebElement&gt; lst=table.findElements(By.tagName("tr"));
System.out.println(lst);

List ls=new ArrayList&lt;String&gt;();
for(int i=0;i&lt;=6;i++)
{
    ls=lst.addAll(get(i).getText())
}
</code></pre>

<p>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.</p>