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 values from a list
I need to get the values(items) in a list.....like I need the correct spells in the list...
How is it possible?
How is it possible?
Comments
For ul and ol tags use _getText(_list("listId")) to get its contents.
A small example for this:
Copy this code to your controller window and test it on this page.
Regards,
Pankaj
I tried with both...first one didn't work out....its a drop down where u can select for diff options.
Pankaj this one worked and I could get the alerts...for each selection....is there any other way to
get it printed in a result file...since I need to get the contents(correct spells).....
_getText(_select("id"))
will return an array of all options
If you want to log the values into the result file you can simply use the _log() in place of _alert()
Regards,
Pankaj
Yes tried with log() and succees for _log(_getText(_select("lang"))); which logs "english" which is selected one presently.
For, for(var $i = 0; $i<_select("lang").length; $i++)
_log(_getText(_select("lang").options[$i]));
not logging in results.How to get in with all values in the drop down?
i hope this code will help you
********************************************************************************
var $arry_SubjArea = [];
var val = _getText(_select("drpyear"))
for(var $i = 0; $i<val.length; $i++) {
_set($arry_SubjArea[$i], _getText(_select("drpyear").options[$i]));
_log($arry_SubjArea[$i]);
}
******************************************************************************
OR
******************************************************************************
var $arry_SubjArea = [];
var val = _getText(_select("drpyear"))
for(var $i = 0; $i<val.length; $i++) {
_set($arry_SubjArea[$i], _getText(_select("drpyear").options[$i]));
}
for(var $i = 0; $i<$arry_SubjArea.length; $i++) {
_log($arry_SubjArea[$i]);
}
******************************************************************************
Regards,
Siva