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.

type and existence of an object

thornton102thornton102 Members
edited May 2013 in Sahi - Open Source
Here's a couple of newbie questions. I have pages that vary whether the user has permission to change something. If they do, it may be a dropdown, but if not, it may be a hidden input.

1. How can I test for the existence of something so I can use it in an IF condition?
2. Similarly, how do I get the type of an object so I can use it in an IF condition?

Answers

  • Hi thornton,

    1. Please have a look at the below code,

    _navigateTo("http://www.makemytrip.com/";);
    if(_isVisible(_select("selnoOfAdults")))
    {
    _log("Visible","success");
    }
    else
    {
    _log("Not Visible","failure");
    }

    2. Controller -> Record tab,

    Press "Ctrl" + Mouse Over the Elements to get the type of the Object.

    Good Luck !

    Cheers,
    Umashankar
Sign In or Register to comment.