I am working in windows application automation, here I am selecting in gui, in the contains date, home team name, away team name…. here I wrote the code to fetch all the from each and put into list array and compare the date with excel date.. if it matches it will click.. but here I need to the same home team name and same away team name….

 String game_date=event.getRow(i).getCell(3).getStringCellValue();
         String home_team_name=event.getRow(i).getCell(4).getStringCellValue();
         String away_team_name=event.getRow(i).getCell(5).getStringCellValue();
 WebElement away_players_list1 = driver.findElementById("ListView1");

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



         List<String> away_players1 = new ArrayList<String>();
         for(int a=0;a<away_team_players_lineups1.size();a++)
         {
         List<WebElement> date = away_team_players_lineups1.get(a).findElements(By.xpath("./*[contains(@LocalizedControlType, 'text')]"));

             for(int j=0;j<date.size();j++)
             {
                 String celtext = date.get(j).getAttribute("Name");
                System.out.println(celtext);
                 away_players1.add(celtext);


             }

         }

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

             String away_total_players= away_players1.get(j);


   if((away_total_players.equals(game_date)))
   {

       WebElement line_up1 = driver.findElementByName(game_date);
       line_up1.click();


   }

         }

excel sheet
Here the respective date will click and how to check with home team name and away team name…how to check that ?



Source link https://sqa.stackexchange.com/questions/34821/how-to-check-the--in-a-row-data

LEAVE A REPLY

Please enter your comment!
Please enter your name here