I am doing automation for windows application. I am using tool. I am selecting players and their position from sheet. I want to 3 players and click on their positions.

excel sheet:
enter image description here

List<String> players = new ArrayList<String>(); // here fetch the  names from app and stored the  names in the list array
    for(int h=0;h<players .size();h++) {
            String game= players .get(h);

    int k=2;
    while(k<7)
    {
        for(int j=1;j<6;j+=2)
        {
            String names=event.getRow(i).getCell(j).getStringCellValue();
            String position = event.getRow(i).getCell(k).getStringCellValue();

                if(game.equals(names))
                {
                    WebElement away=driver.findElementById("DgViewAwayTeam");
                    List<String> away_plyers_positions = new ArrayList<String>(); // store all the position
                     List<WebElement> date = away.findElements(By.tagName("./*[contains(@LocalizedControlType, 'item')]"));
                        System.out.println(date.size()); //30
                         for(int z=0;z<date.size();z++) {

                        String value=date.get(z).getAttribute("Name").substring(0, 1);
                        System.out.println(value);
                        away_plyers_positions.add(value);
                        String aw__pos =  away_plyers_positions.get(z);
                        if(aw__pos.equals(position)) {
                            date.get(z).click();
                            k=k+2;
                        }


                         }

                }
                break;


                }

            }




    }

In my gui application total contain 5 players, in that 5 players i need to select 3 as mentioned in excel. and positions are f,c,g… but here code executuin takes place is click on f position on each 5 players….



Source link https://sqa.stackexchange.com/questions/34858/how-to-select-respective-player-through-excel-using-winapp-driver

LEAVE A REPLY

Please enter your comment!
Please enter your name here