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

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 17, 2025

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

      May 17, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 17, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 17, 2025

      Microsoft’s allegiance isn’t to OpenAI’s pricey models — Satya Nadella’s focus is selling any AI customers want for maximum profits

      May 17, 2025

      If you think you can do better than Xbox or PlayStation in the Console Wars, you may just want to try out this card game

      May 17, 2025

      Surviving a 10 year stint in dev hell, this retro-styled hack n’ slash has finally arrived on Xbox

      May 17, 2025

      Save $400 on the best Samsung TVs, laptops, tablets, and more when you sign up for Verizon 5G Home or Home Internet

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

      NodeSource N|Solid Runtime Release – May 2025: Performance, Stability & the Final Update for v18

      May 17, 2025
      Recent

      NodeSource N|Solid Runtime Release – May 2025: Performance, Stability & the Final Update for v18

      May 17, 2025

      Big Changes at Meteor Software: Our Next Chapter

      May 17, 2025

      Apps in Generative AI – Transforming the Digital Experience

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

      Microsoft’s allegiance isn’t to OpenAI’s pricey models — Satya Nadella’s focus is selling any AI customers want for maximum profits

      May 17, 2025
      Recent

      Microsoft’s allegiance isn’t to OpenAI’s pricey models — Satya Nadella’s focus is selling any AI customers want for maximum profits

      May 17, 2025

      If you think you can do better than Xbox or PlayStation in the Console Wars, you may just want to try out this card game

      May 17, 2025

      Surviving a 10 year stint in dev hell, this retro-styled hack n’ slash has finally arrived on Xbox

      May 17, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Element is not identifed in the second test method

    Element is not identifed in the second test method

    June 19, 2024

    I have a strange behavior : I created Test Class with 2 Test Methods as below.

    When I call AddLimitedBuyOrderwithRandom in the first method it works fine without any exception, but if I call AddLimitedBuyOrderwithRandom from the second method I get a NoSuchElement exception.

    This is the code for the test class:

    public class TestLoginPage extends TestBase {
    public HomePage homeobject;
    public NewOrdersLoginPage OrderLoginObject;
    public OrderMgmtPage OrdersMgmentObject;

    @Test
    public void SuccessLogin() throws InterruptedException
    {
    homeobject = new HomePage(driver);
    homeobject.OpenOrdersPage();
    OrderLoginObject = new NewOrdersLoginPage(driver);
    OrderLoginObject.userLogin(“140”, “12345”);
    OrdersMgmentObject = new OrderMgmtPage(driver);
    OrdersMgmentObject.AddLimitedBuyOrderwithRandom(“10”);
    }

    @Test(enabled= true)
    public void AddLimitOrderTest() throws InterruptedException
    {
    OrdersMgmentObject = new OrderMgmtPage(driver);
    OrdersMgmentObject.AddLimitedBuyOrderwithRandom(“10”);
    }
    }

    and this is the code for AddLimitedBuyOrderwithRandom:

    public void AddLimitedBuyOrderwithRandom(String SharesCount) throws InterruptedException
    {
    clickButton(NewOrderLink);
    clickButton(BuyTypeRadio);
    selectDropdownByValue( companyList, “Company”);
    typeText(ShareNoTxt, SharesCount);
    selectDropdownByValue( OrderTypeList, “2”);
    selectDropdownByValue( OrderValidityList, “0”);
    double Pricerandom = getRandomNumberInRange(ReturnShareLimitDown(),ReturnShareLimitUp());
    typeText(SharePriceTxt,Double.toString(Pricerandom));
    clickButton(SubmitOrderBtn);
    }

    (Added from comments on answers)
    My base class is:

    public class TestBase
    {
    public static WebDriver driver ;
    public static String downloadPath = System.getProperty(“user.dir”) + “\Downloads”;
    public String BaseURL = “URL”;

    @BeforeSuite
    @Parameters({“browser”})
    public void startDriver(@Optional (“chrome”) String browserType)
    {
    if (browserType.equalsIgnoreCase(“chrome”) )
    {
    System.setProperty(“webdriver.chrome.driver”, System.getProperty(“user.dir”)+”/drivers/chromedriver.exe”);
    driver = new ChromeDriver();
    }
    }

    driver.manage().window().maximize();
    driver.navigate().to(BaseURL);
    }

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleONLYOFFICE Docs 8.1 released: Meet a full-featured PDF editor, Slide Master in presentations, better RTL support and other improvements
    Next Article DataComp for Language Models (DCLM): An AI Benchmark for Language Model Training Data Curation

    Related Posts

    Development

    February 2025 Baseline monthly digest

    May 17, 2025
    Development

    Learn A1 Level Spanish

    May 17, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    Developer Spotlight: Yannis Yannakopoulos

    News & Updates

    Google AI Released Gemini 2.5 Pro Experimental: An Advanced AI Model that Excels in Reasoning, Coding, and Multimodal Capabilities

    Machine Learning

    Passing Data in SwiftUI [SUBSCRIBER]

    Development

    NERDTree – tree explorer plugin for Vim

    Linux
    GetResponse

    Highlights

    News & Updates

    CodeSOD: A Double Date

    May 5, 2025

    Alice picked up a ticket about a broken date calculation in a React application, and…

    LlamaIndex Workflows: An Event-Driven Approach to Orchestrating Complex AI Applications

    August 5, 2024

    Spinning Up Innovation: How MongoDB is Driving New Solutions at QSSTUDIO

    June 4, 2024

    Enhance build security and reach SLSA Level 3 with GitHub Artifact Attestations

    December 19, 2024
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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