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

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 16, 2025

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

      May 16, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 16, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 16, 2025

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025

      Minecraft licensing robbed us of this controversial NFL schedule release video

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

      The power of generators

      May 16, 2025
      Recent

      The power of generators

      May 16, 2025

      Simplify Factory Associations with Laravel’s UseFactory Attribute

      May 16, 2025

      This Week in Laravel: React Native, PhpStorm Junie, and more

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

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025
      Recent

      Microsoft has closed its “Experience Center” store in Sydney, Australia — as it ramps up a continued digital growth campaign

      May 16, 2025

      Bing Search APIs to be “decommissioned completely” as Microsoft urges developers to use its Azure agentic AI alternative

      May 16, 2025

      Microsoft might kill the Surface Laptop Studio as production is quietly halted

      May 16, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Get Time taken to change between two elements

    Get Time taken to change between two elements

    June 27, 2024

    I’m trying to get the scroll time of a carousel. I tried to take time when 1st element is selected and time when 2nd element is selected, then deduct 2nd time from 1st time and get the duration.

    Below is my code.

    //list of carousel button
    List<WebElement> button = driver.findElements(By.xpath(“//ul/li/button”));

    //calendar instance
    Calendar calendar = Calendar.getInstance();

    //start time
    int scrollStartTime = 0 ;

    //end time
    int scrollEndTime = 0 ;

    for(int btn=0;btn<button.size();btn++) {

    if(button.get(0).isSelected()) {

    //get start time in mill seconds
    long startTime = calendar.getTimeInMillis();

    //convert to int
    scrollStartTime = (int)startTime;

    System.out.println(startTime);

    }if(button.get(1).isSelected()) {

    //get end time
    long endTime = calendar.getTimeInMillis();

    //convert to int
    scrollEndTime = (int)endTime;

    System.out.println(endTime);
    }
    }

    //get the time gap take to change images
    int scrollerTime = scrollEndTime – scrollStartTime ;

    System.out.println(scrollerTime);

    I am not getting any out put. There are no errors. Can some one guide me to get the out put?

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleCloud Based Test Automation – Supporting Agile and DevOps Practices
    Next Article The future of productivity agents with NinjaTech AI and AWS Trainium

    Related Posts

    Security

    Nmap 7.96 Launches with Lightning-Fast DNS and 612 Scripts

    May 17, 2025
    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-40906 – MongoDB BSON Serialization BSON::XS Multiple Vulnerabilities

    May 17, 2025
    Leave A Reply Cancel Reply

    Continue Reading

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

    Common Vulnerabilities and Exposures (CVEs)

    August 2024: People on the Move

    Development

    From pixels to personalization: The future of design

    Web Development

    Centralize HTTP Client Configuration with Laravel’s globalOptions Method

    Development
    GetResponse

    Highlights

    OpenAI leaving China is actually blessing in disguise for local AI firms

    July 3, 2024

    OpenAI leaving China is shocking that its customers are scraping for alternatives. Local firms have…

    Prime Video now offers AI-generated show recaps – but no spoilers!

    November 6, 2024

    How To Write Test Cases For Radio Button

    August 3, 2024

    13 Best Free and Open Source Terminal-Based Podcast Tools

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

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