I am doing some selenium automation test case and i am getting list of web element using the below code.
List<WebElement> list = GlobalVariables.BrowserDriver.findElements(By.xpath(".//*[@id='Tbls_T']/tbody/tr/td[4]"));
and then i am iterating that web element and getting the values using
for (WebElement webElement : list) {
System.out.println(webElement.getText());
}
so i am getting the values in string format. and sample values are giving below
-100,000 -80,000 0.100 2 87.270 3,000.000
I want to check these values in sorting order or not? for that i think i should convert to integer and then check using some kind of sorting method i guess. for that i have tried to convert the values to a list of integer and then use some sorting algorithm like Guava to check the sorting. because of negative values i am facing difficulty to do that.
Is there any way i can check the sorting order for the above problem and check the order of the values. ?
thanks in advance.