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»Selenium with C# “Element is no longer valid” exception being thrown when repeating steps

    Selenium with C# “Element is no longer valid” exception being thrown when repeating steps

    July 26, 2024

    I am repeatedly getting a very annoying problem when automating my test cases using Selenium/C# in Visual Studio.

    This test is designed around validating search criteria text. In order for me to test each criteria, I have to:

    Navigate to the the app’s homepage
    Click on the search app
    On the search page, enter valid criteria
    On the search results page, assert that the search criteria appears in text as what was searched for.
    Repeat steps 1-3 with different search criteria.
    Verify all search criterias on the results page appear as they should.

    When I get to step 5 (navigating back to the homepage), I get the following exception:
    “threw exception:
    OpenQA.Selenium.StaleElementReferenceException: Element is no longer valid”

    I had gotten this before and got around it by adding a “wait.Until(ExpectedConditions.ElementIsVisible” command- not entirely sure why this worked.

    However, the above solution is becoming very tedious as it requires me to enter an instance for EACH element that I call to, which will end up being x30 more.

    Any help will be greatly appreciated.

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleJmeter env custom function doesn’t read environment variable
    Next Article Required Login Session to Run HTTP Request in JMETER

    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

    $10 UI Design Vs $100,000 UI

    Web Development

    Using guides is “a perfectly valid playstyle” according to Elden Ring’s top boss, Hidetaka Miyazaki

    Development

    Modena Mobilia

    Web Development

    Enterprises are preparing to build their own LLMs – why that’s a smart move

    Development

    Highlights

    Development

    Anthropic Claude 3.5 Sonnet ranks number 1 for business and finance in S&P AI Benchmarks by Kensho

    July 10, 2024

    Anthropic Claude 3.5 Sonnet currently ranks at the top of S&P AI Benchmarks by Kensho,…

    Things That Keep the Grumpy Designer Awake at Night

    April 28, 2024

    SnapCenter Security Flaw Rated Critical—NetApp Urges Immediate Patch

    March 27, 2025

    Overcoming the Obsession with Pure Design

    June 30, 2024
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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