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.
Unable to deal with dynamic number of radio buttons.
To submit a form I need to select some radio buttons. The number of these radio buttons are dynamic in nature.
I am trying following codes:
for (var $i=0; $i<25; $i++)
{
if (_condition(_cell(_table("myTable1"), $i, 3) != 'Null'))
_click(_radio("tempP[$i]"));
else
$i=25;
}
Control is not transfering to else.
Any solution plz
I am trying following codes:
for (var $i=0; $i<25; $i++)
{
if (_condition(_cell(_table("myTable1"), $i, 3) != 'Null'))
_click(_radio("tempP[$i]"));
else
$i=25;
}
Control is not transfering to else.
Any solution plz
Comments
Try if this works: Regards,
Pankaj.
I have tried that but its not working. I noticed only some changes in statment
Previously:
_click(_radio("tempP[0]"));
saveCondition(_cell(_table("myTable1"), 1, 3) != 'Null');
_click(_radio("tempP[1]"));
_click(_radio("tempP[1]"));
_click(_radio("tempP[1]"));
_click(_radio("tempP[1]"));
_click(_radio("tempP[1]"));
--Stopped Playback: FAILURE--
After modifying code:
_click(_radio("tempP["+0+"]"));
saveCondition(_cell(_table("myTable1"), 1, 3) != 'Null');
_click(_radio("tempP["+1+"]"));
_click(_radio("tempP["+1+"]"));
_click(_radio("tempP["+1+"]"));
_click(_radio("tempP["+1+"]"));
_click(_radio("tempP["+1+"]"));
--Stopped Playback: FAILURE--
I think SAHI is unable to understand != 'Null'
Use btw, I think you could also have just used: