private int resultsCount() {
WebElement label = findVisibleElement(TOTAL_COUNT_ID);
String text = label.getText();
int count = Integer.parseInt(text);
return count;
}
When hover mouse over parseInt you can see that:
int java.lang.Integer.parseInt(String arg0) throws NumberFormatException
It might happen if the string does not contain a parsable integer.
But the string in this case is 37,183 , means parsable.
What is wrong then?

Thank you
remove the comma and it will work:
private int resultsCount() { WebElement label = findVisibleElement(TOTAL_COUNT_ID); String text = label.getText(); text = text.replace(",", ""); int count = Integer.parseInt(text); return count; }