enter image description hereenter image description here

I am automating windows application using tool using java language. I am selecting a respective player. I am able to selecting player. But in my second table contain down option is there, so my first selection player name is that in the down option, so I can’t able to down and select that player.
Firstly, I took the first table and fetch all the list of players in that tableand put into one list array and same way fetch the list of player from second table put into second list array and I add both player names into one list array. and read the names from excel. I am able to read the player in the GUI and select, but the real issue is with scroll down..

Here my code first check the player in the list, my first player is not in the gui , that i need to scroll down , then only it can able to select that name..

    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");




               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");



               List<String> away_players3 = new ArrayList<String>(); 

               File f= new File("Player_names.xlsx");
            FileInputStream fs= new FileInputStream(f);
            XSSFWorkbook wb= new XSSFWorkbook(fs); 
            XSSFSheet bb_players=  wb.getSheet("Sheet1");
            int rowcount= bb_players.getLastRowNum();

                     Actions action= new Actions(driver);
                   for(int i=1; i<=rowcount; i++)                                
                        String player = bb_players.getRow(i).getCell(0).getStringCellValue();

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

                                  String away_total_players= away_players3.get(j);

                                boolean exist=driver.findElementByName(player).isDisplayed();

                                 WebElement line_up1 = driver.findElementByName(player);                                    


                                 if(!exist) {
                                 Map<String, Object> scrollInfo = new HashMap<String, Object>();
                                 scrollInfo.put("v", "smallIncrement");
                                 scrollInfo.put("count", 10);

                                 driver.executeScript("automation: ValuePattern.SetValue", line_up1, scrollInfo);


           catch (Exception e) {

console showing

org.openqa.selenium.WebDriverException: Element does not support ValuePattern (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 16 milliseconds

Source link https://sqa.stackexchange.com/questions/34090/winium-scroll-down-is-not-


Please enter your comment!
Please enter your name here