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.
How to retrieve element ID?
Hi All,
In my application I have a list of menu with some text on each. Using Sahi controller I can find out their id like, list1, list2, list3 and so.
but I want these IDs using script. I wish to insert the text name of that menu element in the script and want to retrieve its id, which list(x).
Is there any API to get id of any element. Please help me in this issue.
I am using WinXp, FF3.6 & Sahi Build (2011-07-19).
Thanks in Advance!
In my application I have a list of menu with some text on each. Using Sahi controller I can find out their id like, list1, list2, list3 and so.
but I want these IDs using script. I wish to insert the text name of that menu element in the script and want to retrieve its id, which list(x).
Is there any API to get id of any element. Please help me in this issue.
I am using WinXp, FF3.6 & Sahi Build (2011-07-19).
Thanks in Advance!
Comments
If anyone has any idea, please help!
i hope the below code will be useful for u
in below code instead of "_link" u can give what ever the element u want to be find
Example: _link/ _checkbox/ etc...
******************************************************************************
var $subjArea = _collect("_link", "/./", _in(_div("divID")));
var $arry_SubjArea = [];
for (var $i=0; $i<$subjArea.length; $i++) {
_set($arry_SubjArea[$i], $subjArea[$i].id); // here instead of "id" u can give" id/ text/ etc..."
}
for (var $i=0; $i<$arry_SubjArea.length; $i++) {
_debug($arry_SubjArea[$i]); // this line will print all the link id's
}
******************************************************************************