Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      June 5, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 5, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 5, 2025

      In MCP era API discoverability is now more important than ever

      June 5, 2025

      Google’s DeepMind CEO lists 2 AGI existential risks to society keeping him up at night — but claims “today’s AI systems” don’t warrant a pause on development

      June 5, 2025

      Anthropic researchers say next-generation AI models will reduce humans to “meat robots” in a spectrum of crazy futures

      June 5, 2025

      Xbox just quietly added two of the best RPGs of all time to Game Pass

      June 5, 2025

      7 reasons The Division 2 is a game you should be playing in 2025

      June 5, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Mastering TypeScript: How Complex Should Your Types Be?

      June 5, 2025
      Recent

      Mastering TypeScript: How Complex Should Your Types Be?

      June 5, 2025

      IDMC – CDI Best Practices

      June 5, 2025

      PWC-IDMC Migration Gaps

      June 5, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Google’s DeepMind CEO lists 2 AGI existential risks to society keeping him up at night — but claims “today’s AI systems” don’t warrant a pause on development

      June 5, 2025
      Recent

      Google’s DeepMind CEO lists 2 AGI existential risks to society keeping him up at night — but claims “today’s AI systems” don’t warrant a pause on development

      June 5, 2025

      Anthropic researchers say next-generation AI models will reduce humans to “meat robots” in a spectrum of crazy futures

      June 5, 2025

      Xbox just quietly added two of the best RPGs of all time to Game Pass

      June 5, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Unable to double click the list of players from the table in the exact order?

    Unable to double click the list of players from the table in the exact order?

    November 17, 2024

    ]I’m automating baseball sports reporter application. My application is a desktop application. I’m using winium tool with java language. In my application table contain player names in alphabetical order. I want to select 8 players from the list in same order as you can see above order. And also I want to select the matching positions.

    These are the players that i need to select::

      #players names  ::  positions
     Happ            = CF
     Bryant          = 3B
     Rizzo           = 1B
     Contreras       = C
     Schwarber       = LF
     Russell         = SS
     Heyward         = RF
     Baez            = 2B
    

    now i need to select the particular players that I mentioned above list order.
    My application manual working process is first double click a player and mean time a window came to select the position by single click. example firstly , I need to select the player Happ and his position CF(center field) then select the player Bryant and his position 3B(third base) etc…

         public void awayTeamHitters() {
    
    
                try
                {
                String[] players = new String[]
                        {
                        "Happ, Ian#",
                        "Bryant, Kris",
                        "Rizzo, Anthony*",
                        "Contreras, Willson",
                        "Schwarber, Kyle*",
                        "Russell, Addison",
                        "Heyward, Jason*",
                        "Baez, Javier"
                        };
                String[] positions=new String[]
                        {
                                "CF",
                                "3B",
                                "1B",
                                "C",
                                "LF",
                                "SS",
                                "RF",
                                "2B"
                        };
    
    
                    List<String> playersInList = Arrays.asList(players);
                    List<String> positionsInlist=Arrays.asList(positions);
    //selecting players   of 2 table
                    driver.findElement(By.id("lblAwayTeamHittersAll")).click();  // click on 2 tables all players
                    WebElement table1 = driver.findElement(By.id("lsvAwayTeamHitters1"));
                    WebElement table2 = driver.findElement(By.id("lsvAwayTeamHitters2"));
                    //taking row size
                    List<WebElement> rows1 = table1.findElements(By.xpath("./*[contains(@LocalizedControlType, 'item')]"));
                    List<WebElement> rows2 = table2.findElements(By.xpath("./*[contains(@LocalizedControlType, 'item')]"));
                    //create string array add players to player_table1
                    List<String> player_table1=new ArrayList<String>();
                    for(int i=0;i<rows1.size();i++) {
                        List<WebElement> cols1 = rows1.get(i).findElements(By.xpath("./*[contains(@LocalizedControlType, 'text')]"));
                        for(int j=3;j<cols1.size();j++) {
                            String celtext1 = cols1.get(j).getAttribute("Name");
                            player_table1.add(celtext1);
                        }      
                    }
                    //create string array and add players to player_table2
                    List<String> player_table2=new ArrayList<String>();
                    for(int i=0;i<rows2.size();i++) {
                        List<WebElement> cols2 = rows2.get(i).findElements(By.xpath("./*[contains(@LocalizedControlType, 'text')]"));
                        for(int j=3;j<cols2.size();j++) {
                            String celtext2 = cols2.get(j).getAttribute("Name");
                            player_table2.add(celtext2);
                        }                     
                    }
    
    
            //combine player table 1 and 2 
                    player_table2.addAll(player_table1);  
                    List<String> player_table3=new ArrayList<String>();
                    player_table3.addAll(player_table2);
                    System.out.println(player_table3);  //it will print the 25 player names
                    int p=player_table3.size();  
                    System.out.println(p);     //it will print the size 25
                    for(int i=0;i<p;i++) {
                     if(playersInList.contains(player_table3)) {
    
                        Actions act = new Actions(driver);
    
                            act.doubleClick(playersInList).build().perform();
                     }
    
                       WebElement pos= driver.findElementById("PlayerPositions");
                               List<WebElement> col=pos.findElements(By.xpath("./*[contains(@LocalizedControlType, 'button')]"));
    
                               if(positionsInlist.contains(col)) {
    
    
                               pos.click();
    
                       }
                    }      
    
    
            }
            catch (Exception e) {
                    System.out.println(e);
                                    }
        }
    }
    

    I have 2 tables in my application and I add it into one list..
    Here double click action is not performing and after printing 25 player names and size .it will got stop.

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleHow to select second value in drop using Katalon Chrome Extention?
    Next Article Meet Memoripy: A Python Library that Brings Real Memory Capabilities to AI Applications

    Related Posts

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-48906 – DSoftBus Authentication Bypass Vulnerability

    June 6, 2025
    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-48907 – Apache IPC Deserialization Vulnerability

    June 6, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    CVE-2025-4032 – InclusionAI AWorld Os Command Injection Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    This isn’t your grandpa’s Pac-Man — Bandai Namco’s iconic character gets a gritty new action game this Summer

    News & Updates

    CVE-2024-53020 – Apache Tomcat RTP Information Disclosure Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    New SonicBoom Attack Allows Bypass of Authentication for Admin Access

    Security

    Highlights

    How to use AI to create a logo for free

    August 12, 2024

    Need a logo fast? Generative AI can do that – here’s how to get started.…

    No more alt-tabbing: Edge Game Assist floats guides, Discord, and more over your games

    May 30, 2025

    CodeSOD: IsEmptyOrNullOrNullOrEmpty

    August 28, 2024

    11 Best Node Js Books in 2025

    March 16, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.