18 January 2026:


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

sahirsahir Members
edited December 2014 in Sahi - Open Source
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

Answers

  • Ok, I solved it. It was just a stupid syntax error. It should be $j = $j 2
Sign In or Register to comment.