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.

checkbox is checked or not

vikkyjainvikkyjain Members
edited November -1 in Sahi - Open Source
Hi,

I want to check whether checkbox is checked or not in my application. If its is checked then i have to save an error message in my error file .

I check with _assertNotTrue, but this function fails the test case silently.

vikky

Comments

  • SumitraSumitra Members
    Hi vikkyjain,

    Kindly look at this URL:

    http://sahi.co.in/forums/viewtopic.php?id=138

    Regards
    Sumitra
  • Hi sumitra ,

    I already checked with this post.
    using _assert sahi will fail the test case, but i want to print some error message in a file.
    Is _assert returns any value ??

    Vikky
  • SumitraSumitra Members
    Hi vikkyjain,

    You can try with the following code:

    if (_checkbox("list").checked == false) {
    //Log report to a file
    }

    Let me know if this solves your issue.

    Regards
    Sumitra
  • narayannarayan Administrators
    It should be

    if (_condition(_checkbox("list").checked == false)) {
    //Log report to a file
    }
    or

    if (_condition(!_checkbox("list").checked)) {
    //Log report to a file
    }
  • Hi Narayan,

    I checked your solution. This is working absolutely fine...
    Thanks for your quick response.

    Thanks
    Vikky
This discussion has been closed.