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.
Verification of data in a drop down list
I hace to record a web page where several drop down list are provided.
User needs to choose the required data from those drop downs.
How do I verify the data in these drop downs ?
User needs to choose the required data from those drop downs.
How do I verify the data in these drop downs ?
Comments
hope the below script will be useful to you, please try this script
do let me know if u still facing any issue
******************************************************************************
var $arry_Dropdown = [];
var $val = _getText(_select("drpyear")); //drpyear is dropdown name/ id
var $match_Val = "2003-04";
for(var $i=0; $i<$val.length; $i++) {
_set($arry_Dropdown[$i], _getText(_select("drpyear").options[$i]));
if($arry_Dropdown[$i] == $match_Val) {
_setSelected(_select("drpyear"), $match_Val);
$i = $val.length;
}
}
******************************************************************************
for(var $i = 0; $i<_select("ctl00_cpRoot_ddlTargetAudience").length; $i++)
{
_alert(_getText(_select("ctl00_cpRoot_ddlTargetAudience").options[$i]));
}
but I guess the loop is not getting executed.
Please help
Thanks in advance
Jasmine
You can compare the options in the dropdown list using array.
Here is an example:
You can also use for loop:
Let me know if you face any problem.
Regards
Sumitra