18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
Can we find element type by using element id?
Hi All,
My requirement may be unrealistic or illogical, but I need to find element type by using it's identifier.
Suppose, there is an element identified by Sahi controller: _textbox("username")
Now, I don't want to use this element identified by controller. I just want to pass the identifier as "username" into script and want to find the element type of id: "username", i.e. "textbox".
Is this possible?
If yes then please provide the solution.
regards,
nagar
My requirement may be unrealistic or illogical, but I need to find element type by using it's identifier.
Suppose, there is an element identified by Sahi controller: _textbox("username")
Now, I don't want to use this element identified by controller. I just want to pass the identifier as "username" into script and want to find the element type of id: "username", i.e. "textbox".
Is this possible?
If yes then please provide the solution.
regards,
nagar
Comments
I'm not sure if i have understand correctly what you need, but here is my solution:
var $type = null;
_set($type, document.getElementById("id").type);
_alert($type); // alerts "text"