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.
Get all elements along with their respective Id's
Hi All,
Can i get the elements present on a specific "Div"
Say for instance, On a div there are three trextboxes and one listbox.
Is there any way in JAVA to do this?
Regards
Akshada
Can i get the elements present on a specific "Div"
Say for instance, On a div there are three trextboxes and one listbox.
Is there any way in JAVA to do this?
Regards
Akshada
Comments
Kindly have a look at this:
http://sahi.co.in/forums/viewtopic.php?id=2714
Regards
Sumitra
In the post u mentioned i will get the count, whereas here, i want to get the elements or the Id's of the elements present.
Thanks for your reply.
Regards
Akshada
i hope this will help you to get all the elements present under specific area/ div
_collect("_link", "/./", _in(_div("divID")));
in this line i have used "_link" to get the link information, in the same way you have to mention the required object instead of link
******************************************************************************
var $all_Links = _collect("_link", "/./", _in(_div("divID")));
var $each_Link = [];
for (var $i=0; $i<$all_Links.length; $i++) {
_set($each_Link[$i], $all_Links[$i].id);
}
for (var $i=0; $i<$each_Link.length; $i++) {
_alert($each_Link[$i]);
}
******************************************************************************