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.
not reading data from csv file for data driven testing
hey all,
i am facing issue working with csv file. I am not getting any error. during playback. but its not inputting any value for email and password from my csv file.
here's is my complete code :
function login($email, $pwd)
{
try
{
__setValue(_textbox("email"), $email);
_click(_submit("Join"));
_click(_label("Enter password"));
_setValue(_password("password"), "$pwd");
_setValue(_password("password_retype"), "$pwd");
_click(_submit("Submit"));
_click(_link("Logout"));
}
catch(e)
{
_logException(e);
}
}
function blankIfNull($s)
{
return ($s == "null" || $s == null) ? "" : $s;
}
var $name;
var $password;
_navigateTo("URL", true);
_click(_link("Member Log In"));
_click(_link("Sign Up"));
var $data=_readCSVFile("C:\\New Folder\\ddriven\\test1.csv");
for(var $i=0; $i<$data.length; $i++)
{
var $row = $data[$i];
$name = blankIfNull($row[0]);
$password = blankIfNull($row[1]);
login($name, $password);
}
does the CSV file should be in specific format ??
its just goes into a loop, without extracting any values from CSV.
Please help... ASAP.
Thanks.
i am facing issue working with csv file. I am not getting any error. during playback. but its not inputting any value for email and password from my csv file.
here's is my complete code :
function login($email, $pwd)
{
try
{
__setValue(_textbox("email"), $email);
_click(_submit("Join"));
_click(_label("Enter password"));
_setValue(_password("password"), "$pwd");
_setValue(_password("password_retype"), "$pwd");
_click(_submit("Submit"));
_click(_link("Logout"));
}
catch(e)
{
_logException(e);
}
}
function blankIfNull($s)
{
return ($s == "null" || $s == null) ? "" : $s;
}
var $name;
var $password;
_navigateTo("URL", true);
_click(_link("Member Log In"));
_click(_link("Sign Up"));
var $data=_readCSVFile("C:\\New Folder\\ddriven\\test1.csv");
for(var $i=0; $i<$data.length; $i++)
{
var $row = $data[$i];
$name = blankIfNull($row[0]);
$password = blankIfNull($row[1]);
login($name, $password);
}
does the CSV file should be in specific format ??
its just goes into a loop, without extracting any values from CSV.
Please help... ASAP.
Thanks.
Comments
hdhfgsd
this are the two columns on csv file
forum is not allowing me to enter email address, as I am new member.
The csv file should have a format like this:
emailAddress1,password1
emailAddress2,password2
Regards,
Narayan