Module 15 , get the player name who scrored maximum
Module 15 , get the player name who scrored maximum
M
Posted on 22/08/2015
Hi Team, How to get the player name who scored maximum.
Here in below code i am able to get individual score and converted into integer from string. Now i need to compare the each score and get the maximum score . In order to do so i hope i need to pass the integer to Array. But i am not sure how to do so.Pls help me
driver.get("http://www.cricbuzz.com/live-cricket-scorecard/14875/sl-vs-ind-2nd-test-india-tour-of-sri-lanka-2015---cricbuzz-cup"); List<WebElement> ls=driver.findElements(By.xpath("//*[@id='innings_1']/div[1]/div/table/tbody/tr/td[3]")); int sum=0; System.out.println(ls.size()); for(int i=0;i<ls.size();i++) { int n=Integer.parseInt(ls.get(i).getText());