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.

to "get" the "type" of the field

ddivakarsddivakars Members
edited November -1 in Sahi - Open Source
I have a field "B", the type of which changes according to another field say A

I need to find out, if the type of B is a Dropdown menu or textbox or text area or checkbox or datepicker.

is it possible to "get" the "type" of the field?

thanks
-Diwakar

Comments

  • narayannarayan Administrators
    Hi Diwakar,

    If the element has an id, use browser.byId("id").fetch("type")

    Or you could assert for the type of object by checking that element exists.

    if (browser.textbox("id").exists()) {
    // then good.
    }

    If the type was "text", it would be identified as textbox or else as browser.select or browser.textarea etc.

    Regards,
    Narayan
Sign In or Register to comment.