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.

Sahi is identifying the hidden objects

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

We have certain configurations in our application, and when we do those set ups some of the objects are supposed to be disabled or not to appear on UI.
Ex: On doing a set up the user is not supposed to be given a link say he is not given the approval link.

But when we test this by using _assertNotExists(_link(approval)); script fails because according to sahi the link is present and it is even able to click the link though it does not appear on UI.
Actually at the backend the code is being hidden when the particular set up is done, and thus not visibile in UI but then sahi is able to recognise the same.

Can anyone suggest us how to deal with these kind of scenarios.

Regards,
Bhavitha

Comments

  • Hello Bhavitha,

    The visibility or display property only specifies if a particular element should be visible on the UI or not. So, you cannot use _assertNotExists(_link(approval));

    Use the _isVisible(element) API to check the visibility of an element.

    Regards,
    dkulkarni
  • BhavithaBhavitha Members
    Hi dkulkarni,

    Thanks for the reply...
    _isVisibile(_cell("some text") works when i have to check if the text/question/ is visible.
    But i want the other way round, something like _notVisibile or _notexists.......

    when i do the set up, the _link(approval) gets hidden and not visible on my UI and in my script i have to make sure that link is not available for the user to click. But then since sahi is able to view that hidden link though it is not visible in UI i am not able to validate that link is not available.
  • narayannarayan Administrators
    Hi Bhavitha,

    You need to do this

    _assertFalse(_isVisible(element));

    or

    _assert(!_isVisible(element));

    Regards,
    Narayan
  • BhavithaBhavitha Members
    Hi Narayan,

    Thanks a lot... It worked!!!
This discussion has been closed.