I am working in windows application automation testing. I want to perform a multiple task like to select a player name and its position. My application is a baseball reporter software. so, I'm automating to select 8 players from the table. I keep the player names and their positions in excel sheet. my application manual working process for selecting a line ups is to double click a player and then another box comes to select a position of those player. my issue is that I am double clicking on wrong element....how I perform double click on that exact player ?

this is the code..

 public class LineUps  {

        private WiniumDriver driver;
        public LineUps(WiniumDriver driver) throws MalformedURLException, InterruptedException {

        public  void away_team_lineups_excel()
               try {
                   WebElement away_players_list1 = driver.findElementById("lsvAwayTeamHitters1");
                   WebElement away_players_list2 = driver.findElement(By.id("lsvAwayTeamHitters2"));

                   List<WebElement> away_team_players_lineups1 = away_players_list1.findElements(By.xpath("./*[contains(@LocalizedControlType, 'item')]"));
                   List<WebElement> away_team_players_lineups2 = away_players_list2.findElements(By.xpath("./*[contains(@LocalizedControlType, 'item')]"));

                   List<String> away_players1 = new ArrayList<String>();
                   for(int i=0;i<away_team_players_lineups1.size();i++)
                   List<WebElement> away_team_players_names = away_team_players_lineups1.get(i).findElements(By.xpath("./*[contains(@LocalizedControlType, 'text')]"));                 
                       for(int j=3;j<away_team_players_names.size();j++)
                           String celtext = away_team_players_names.get(j).getAttribute("Name");
                          // System.out.println(celtext);

                   List<String> away_players2 = new ArrayList<String>();
                   for(int j=0;j<away_team_players_lineups2.size();j++)
                   List<WebElement> away_team_players_names2 = away_team_players_lineups2.get(j).findElements(By.xpath("./*[contains(@LocalizedControlType, 'text')]"));
                   for(int k=3;k<away_team_players_names2.size();k++)
                           String celtext = away_team_players_names2.get(k).getAttribute("Name");
                         //  System.out.println(celtext);

                   List<String> away_players3 = new ArrayList<String>();
                   File f= new File("player.xlsx");
                  FileInputStream fs= new FileInputStream(f);
                 XSSFWorkbook wb= new XSSFWorkbook(fs);
                   XSSFSheet bb_players= wb.getSheetAt(0);

                int rowcount= bb_players.getLastRowNum();
                         System.out.println("Total rows is: " +rowcount);
                         Actions act= new Actions(driver);

                       for(int i=1; i<=rowcount; i++)                                
                      String player = bb_players.getRow(i).getCell(0).getStringCellValue();
                      String position = bb_players.getRow(i).getCell(1).getStringCellValue();

                      for(int j=0; j<away_players3.size(); j++)

                       String away_total_players= away_players3.get(j);




                        WebElement line_up1=driver.findElementByLinkText(player);



                            WebElement away_players_pos = driver.findElementById("PlayerPositions");
                             List<WebElement> player_pos = away_players_pos.findElements(By.xpath("./*[contains(@ControlType,'Button')]"));



           catch (Exception e)



Excel sheet


how to double click on the particular name webelement ?

Firstly I want try whether I can able to select one player and its position, then I can add loops to select multiple players... Inside action class my element must be wrong, that's why double click is not working a single player. how I write the matching webelement on inside action class.... How to perform double click on the first player "Happ Ian" and select its position "CF"

anybody please help me

  • @Alexey R. please check my question – user32519 May 29 '18 at 17:58

To double-click on a particular element, you first have to move to that element.

Actions act= new Actions(driver);
WebElement player = driver.findElement(By.linkText(i));

Check if this solves your problem.

  • Its showing error like away_team_players_names2 cannot be resolved – user32519 May 30 '18 at 4:04
  • do you want to select the player which is in the first position?? If yes, then you can try to point at the first position using xpath, id, linkText, etc. WebElement player = driver.findElement(by.linkText("1")); act.moveToElement(player).doubleClick().build(); – Rishikesh May 30 '18 at 4:56
  • @Anthony Manually, does double-clicking on the player's numbers also selects the respective player??? – Rishikesh May 30 '18 at 6:40
  • @Anthony I have updated the answer, check if this helps. I am assuming that double-clicking on the number, selects the player corresponding to that number. – Rishikesh May 30 '18 at 10:45
  • winium does not support linkText .please tell me any other solution – user32519 Jun 4 '18 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy