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 4, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 4, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 4, 2025

      Smashing Animations Part 4: Optimising SVGs

      June 4, 2025

      I test AI tools for a living. Here are 3 image generators I actually use and how

      June 4, 2025

      The world’s smallest 65W USB-C charger is my latest travel essential

      June 4, 2025

      This Spotlight alternative for Mac is my secret weapon for AI-powered search

      June 4, 2025

      Tech prophet Mary Meeker just dropped a massive report on AI trends – here’s your TL;DR

      June 4, 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

      Beyond AEM: How Adobe Sensei Powers the Full Enterprise Experience

      June 4, 2025
      Recent

      Beyond AEM: How Adobe Sensei Powers the Full Enterprise Experience

      June 4, 2025

      Simplify Negative Relation Queries with Laravel’s whereDoesntHaveRelation Methods

      June 4, 2025

      Cast Model Properties to a Uri Instance in 12.17

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

      My Favorite Obsidian Plugins and Their Hidden Settings

      June 4, 2025
      Recent

      My Favorite Obsidian Plugins and Their Hidden Settings

      June 4, 2025

      Rilasciata /e/OS 3.0: Nuova Vita per Android Senza Google, Più Privacy e Controllo per l’Utente

      June 4, 2025

      Rilasciata Oracle Linux 9.6: Scopri le Novità e i Miglioramenti nella Sicurezza e nelle Prestazioni

      June 4, 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

    Hostinger
    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

    Security

    HPE StoreOnce Faces Critical CVE-2025-37093 Vulnerability — Urges Immediate Patch Upgrade

    June 4, 2025
    Security

    CISA Adds Qualcomm Vulnerabilities to KEV Catalog

    June 4, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    Microsoft’s Surface Pro 11 is stronger than Apple’s M4 iPad Pro — here’s the proof

    Development

    Best One UI 7 features coming to Samsung Galaxy S25 (and older models, too)

    News & Updates

    Must-Read Blogs for Web Designers in 2024

    Development

    Building Immersive Virtual Realities with Ubuntu

    Learning Resources

    Highlights

    News & Updates

    New game blending Valheim and Mount & Blade comes to Xbox later this year

    March 20, 2025

    Bellwright, a well-received survival and crafting game currently in early access on Steam, is officially…

    Top 9 Amazon Textract alternatives for data extraction

    November 19, 2024

    How designers and brands are morphing the next era of motion design

    January 24, 2025

    CVE-2025-4206 – Groundhogg WordPress File Deletion Vulnerability (Arbitrary File Deletion)

    May 9, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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