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

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 14, 2025

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

      May 14, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 14, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 14, 2025

      I test a lot of AI coding tools, and this stunning new OpenAI release just saved me days of work

      May 14, 2025

      How to use your Android phone as a webcam when your laptop’s default won’t cut it

      May 14, 2025

      The 5 most customizable Linux desktop environments – when you want it your way

      May 14, 2025

      Gen AI use at work saps our motivation even as it boosts productivity, new research shows

      May 14, 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

      Strategic Cloud Partner: Key to Business Success, Not Just Tech

      May 14, 2025
      Recent

      Strategic Cloud Partner: Key to Business Success, Not Just Tech

      May 14, 2025

      Perficient’s “What If? So What?” Podcast Wins Gold at the 2025 Hermes Creative Awards

      May 14, 2025

      PIM for Azure Resources

      May 14, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Windows 11 24H2’s Settings now bundles FAQs section to tell you more about your system

      May 14, 2025
      Recent

      Windows 11 24H2’s Settings now bundles FAQs section to tell you more about your system

      May 14, 2025

      You can now share an app/browser window with Copilot Vision to help you with different tasks

      May 14, 2025

      Microsoft will gradually retire SharePoint Alerts over the next two years

      May 14, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»How to add row elements in selenium?

    How to add row elements in selenium?

    November 19, 2024

    enter image description here

    I want to add today’s count. I am new to selenium, and am not getting how to add using selenium. Can anyone suggest a solution?

    This is my code:

    package testpk;
    
    import org.openqa.selenium.By;        
    import org.openqa.selenium.WebDriver;        
    import org.openqa.selenium.firefox.FirefoxDriver;
    
    import java.awt.List;
    
    import org.openqa.selenium.*;
    
    public class Form {                
    
    
        public static void main(String[] args) throws InterruptedException {                                    
    
            // declaration and instantiation of objects/variables        
    
            WebDriver driver = new FirefoxDriver();
    
            driver.manage().window().maximize();
            driver.get("http://beta-app.1bridge.in/#/auth/login"); 
            Thread.sleep(6000);
    
            driver.findElement(By.xpath("//input[@type='text']")).sendKeys("RB0764",Keys.ENTER);
            Thread.sleep(3000);
            driver.findElement(By.xpath("//input[@type='password']")).sendKeys("kanna123",Keys.ENTER);
    
            Thread.sleep(7000);
            driver.findElement(By.xpath("//*[@data-id='dashboard']")).click();
            Thread.sleep(5000);
            WebElement table = driver.findElement(By.xpath("//*[@id="pcoded"]/div[2]/div/div/div/div/div/div/app-default/div/app-modal-basic/div/div/div/div/div/div/table/tbody/tr[1]/td[1]/p"));
    
            List listOfRows = (List) table.findElements(By.tagName("tr"));
    
            System.out.println("Rows: "+listOfRows.size());
    
            //List<WebElement> listOfCols = listOfRows.get(0).findElements(By.tagName("td")); //If first row is normal row
    
            List<WebElement> listOfCols = ((WebDriver) listOfRows).get(0).findElements(By.tagName("th")); //If first row is header row
    
            System.out.println("Columns: "+listOfCols.size());
        }
    }
    

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleIs there a way in PyTest to pass command line arguments to conftest.py directly?
    Next Article Unable to get the correct value from the table using css selector in selenium

    Related Posts

    Security

    Nmap 7.96 Launches with Lightning-Fast DNS and 612 Scripts

    May 15, 2025
    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-4695 – PHPGurukul Cyber Cafe Management System SQL Injection

    May 15, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    MIT researchers introduce generative AI for databases

    Artificial Intelligence

    Alleged Hosocongty Data Breach Exposes Vietnamese Job Seekers

    Development
    Rilasciato Calibre 8.3: Migliorata la Velocità di Apertura degli EPUB e Nuove Opzioni di Personalizzazione

    Rilasciato Calibre 8.3: Migliorata la Velocità di Apertura degli EPUB e Nuove Opzioni di Personalizzazione

    Linux

    Manage Events, Feature Flags, and More with PostHog for Laravel

    Development

    Highlights

    CVE-2025-43962 – LibRaw Out-of-Bounds Read Vulnerability

    April 20, 2025

    CVE ID : CVE-2025-43962

    Published : April 21, 2025, 12:15 a.m. | 2 hours ago

    Description : In LibRaw before 0.21.4, phase_one_correct in decoders/load_mfbacks.cpp has out-of-bounds reads for tag 0x412 processing, related to large w0 or w1 values or the frac and mult calculations.

    Severity: 2.9 | LOW

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    One of the brightest QLED TVs I’ve tested isn’t made by Samsung or LG (and it’s $500 off)

    November 11, 2024

    The best USB-C chargers of 2024: Expert recommended

    August 8, 2024
    Universal Design in Pharmacies – WCAG – Understandable

    Universal Design in Pharmacies – WCAG – Understandable

    April 10, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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