18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Element not found exception isn't registered !!

sharathsharath Members
edited November 2013 in Sahi - Open Source
I ran the below command and the element wasn't found on the web application, but there wasn't any exception thrown/registered.

code :
browser.click(browser.button("add"));

The button text was "Add" but I gave it as "add" , here there wasn't a click nor an "element not found exception" registered.
Btw this works if for browser.click(browser.button("Add"));

Regards,
shArath

Answers

  • Hi Sharath,
    I tried what you said with Sahi OS4.4.
    After the test fails, the first line of the trace gives the following message:
    Error: The parameter passed to _click was not found on the browser
    

    What are you seeing after the test fails?

    Regards.
  • I'm running it on Sahi OS4.4 with Junit using java driver, with @Test annotation, after running the test case I get "All test case passed message" there isn't any message displayed when the element isn't found on the browser.

    Regards,
    shArath
  • Are you sure there is no other element with the text "add" or id "add"?
    I have had sometimes problems that my code has used the button/field that's not even visible. In that case there will be no error.
  • Hi Sadana,

    Firstly, I confirmed this using the below code :

    browser.exists(browser.button("add"))
    it returned false.

    so obviously the element isn't present on the page. And then with this browser.click(browser.button("add"));
    it should throw an exception?


    Regards,
    shArath
Sign In or Register to comment.