I am automating my app. my app is a commentary app. I am 3 players and click on their respective positions. here I am able to select the first and its position. but the second is unable to select.

for(int h=0;h<total.size();h++) {  // total means it will take one by one player 
                                String game = total.get(h);

                                int k = 2;

                        while(k<7)
                        {
                            outLoop:
                            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=AppSession.findElementByAccessibilityId("DgViewAwayTeam");
                            List<String> away_plyers_positions = new ArrayList<String>();
                            List<WebElement> date = away.findElements(By.tagName("./*[contains(@LocalizedControlType, 'item')]")); // ftech the each row position
                            System.out.println(date.size()); //30
                             for(int z=0;z<date.size();z++) //30
                             {

                                String value=date.get(z).getAttribute("Name").substring(0, 1);
                                System.out.println(value);
                                away_plyers_positions.add(value);
                                String aw_player_pos =  away_plyers_positions.get(z);
                                if (aw_player_pos.equals(position)) 
                                {

                                    date.get(z).click();
                                   //click on F , C , G
                                    k = k + 2;
                                    break outLoop;
                                }

                                        }

                                    }
                                }



                            }

                        }

after click on the position, i need to go to h loop for select the second player… but here my code is click on the first player 3 positions..its not go to second player.. any help much appreciated

enter image description here

here selecting firt player and click on F,C,G..

This is my console showing.

30
U
N
F
30
U
N
F
C
30
U
N
F
C
G
30
U
N
F
30
U
N
F
C



Source link https://sqa.stackexchange.com/questions/34893/selecting-a-second-player-is-not--while-

LEAVE A REPLY

Please enter your comment!
Please enter your name here