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.
JSERROR TypeError:Cannot read property
Hi,
I m trying to read data from an excel sheet in sahi.My columns names are "uid", and "pwd".
My code is like this:
for(var $i=0;$i<$len;$i++)
{
var $a=parseInt($rs[$i]["uid"]);
_setValue(_textbox("txtId"),$a );
_setValue(_password("txtPwd"), $rs[$i]["pwd"]);
_click(_submit("Login"));
_click(_link("Log Off"));
}
Here i hv used parseInt method,bcoz my uid column contains only int values.
But sahi was taking these int values with a 0(zero),followed by decimal(eg: 34218.0 instead of 34218)
Now it is taking the number without decimal,but showing the error:
JSERROR TypeError:Cannot read property "uid" from undefined.
Can u help me solving this prob.
I m trying to read data from an excel sheet in sahi.My columns names are "uid", and "pwd".
My code is like this:
for(var $i=0;$i<$len;$i++)
{
var $a=parseInt($rs[$i]["uid"]);
_setValue(_textbox("txtId"),$a );
_setValue(_password("txtPwd"), $rs[$i]["pwd"]);
_click(_submit("Login"));
_click(_link("Log Off"));
}
Here i hv used parseInt method,bcoz my uid column contains only int values.
But sahi was taking these int values with a 0(zero),followed by decimal(eg: 34218.0 instead of 34218)
Now it is taking the number without decimal,but showing the error:
JSERROR TypeError:Cannot read property "uid" from undefined.
Can u help me solving this prob.
Comments
I am assuming that earlier without using parseInt arount the array element u were not getting this error.
see if this helps:
my prob got solved.actually in my excel sheet there are two user for uid and pwd
but in for loop i ws taking three values.so it was not recognising the third entry as there is nothing in the third row.