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.
Problem with using for loop
Hi,
I tried to use this code:
for (var $i = 0; $i < $kost.length; $i++)
{
for (var $j = 0; $j <= 2; $j + 2)
{
_alert($j);
var $x = $j + 1;
if (_isVisible(_div("/" + $kost[$i][$j] + " " + $kost[$i][$x] + "/")) === true)
{
_click(_link("/Löschen/", _near(_div("/" + $kost[$i][$j] + " " + $kost[$i][$x] + "/"))));
_assertNotTrue(_isVisible(_div("/" + $kost[$i][$j] + " " + $kost[$i][$x] + "/")));
}
}
}
But Sahi won't start the code after the first _alert, it just keeps endlessly executing the _alert.
Thanks
I tried to use this code:
for (var $i = 0; $i < $kost.length; $i++)
{
for (var $j = 0; $j <= 2; $j + 2)
{
_alert($j);
var $x = $j + 1;
if (_isVisible(_div("/" + $kost[$i][$j] + " " + $kost[$i][$x] + "/")) === true)
{
_click(_link("/Löschen/", _near(_div("/" + $kost[$i][$j] + " " + $kost[$i][$x] + "/"))));
_assertNotTrue(_isVisible(_div("/" + $kost[$i][$j] + " " + $kost[$i][$x] + "/")));
}
}
}
But Sahi won't start the code after the first _alert, it just keeps endlessly executing the _alert.
Thanks
Answers