Reputation: 17
I am using Java Junit to verify the search result if greater than 1000
but Selenium can only storeText which is (String)
Than I try to convert (String) to (Int)
So that I can compare the search result(String) to 1000.
However, it doesn't work.
Also, I am not sure if I use assetThat in the right way.
Anyone knows the answer please help!
Thank you!
In Java code:
String result = selenium.getText("css=span.rcnt");
System.out.println("Search result is: " + result);
int foo = Integer.parseInt(result);
assertThat("Pass", foo, greaterThan(1000));
Upvotes: 0
Views: 4171
Reputation: 1021
I don't use asserThat, preferring assertTrue.
However I see from link below that assertTrue has only two arguments:
Try:
assertThat(foo, greaterThan(1000);
Upvotes: 2