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.
Data Driven Testing
I am trying to perform data driven testing using sahi for our Login page. I made a CSV file and made the following script. The test failed. Some one please help me to identify the mistake. plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
My scrpt is
function login($User name, $Password)
{
_setValue(_textbox("txtUserName"), "$User Name");
_setValue(_password("txtPassword"), "$Password");
}
var $content=_readCSVFile("C:\Documents and Settings\Users2\Desktop\user_details.csv");
_dataDriven(login, $content);
_click(_submit("Sign In"));
_click(_link("Branch"));
_setValue(_textbox("ctl00\$ContentPlaceHolder1\$cphContent\$txtBranchName"), "Voltive");
_setValue(_textarea("ctl00\$ContentPlaceHolder1\$cphContent\$txtAddress"), "Ernakulam");
_setValue(_textbox("ctl00\$ContentPlaceHolder1\$cphContent\$txtEmail"), "voltive@gmail.com");
_setValue(_textbox("ctl00\$ContentPlaceHolder1\$cphContent\$txtMobile"), "56456456");
_setValue(_textbox("ctl00\$ContentPlaceHolder1\$cphContent\$txtPhone"), "4563456345345");
_click(_submit("Save"));
Error log shows
_click(_imageSubmitButton("ctl00\$cphSideBarTop\$lvBranch\$ctrl3\$imbAddToCard"));
Error: The parameter passed to _click was not found on the browser at Jan 28, 2013 3:42:32 PM
I don't know whether it is the mistake that i made in script or CSV file... Somebody plzzzzzzzzzzzzzzzzzzzzzzzzzzzzz help me...I am a fresher in testing feild and I am not getting any help from my company
My scrpt is
function login($User name, $Password)
{
_setValue(_textbox("txtUserName"), "$User Name");
_setValue(_password("txtPassword"), "$Password");
}
var $content=_readCSVFile("C:\Documents and Settings\Users2\Desktop\user_details.csv");
_dataDriven(login, $content);
_click(_submit("Sign In"));
_click(_link("Branch"));
_setValue(_textbox("ctl00\$ContentPlaceHolder1\$cphContent\$txtBranchName"), "Voltive");
_setValue(_textarea("ctl00\$ContentPlaceHolder1\$cphContent\$txtAddress"), "Ernakulam");
_setValue(_textbox("ctl00\$ContentPlaceHolder1\$cphContent\$txtEmail"), "voltive@gmail.com");
_setValue(_textbox("ctl00\$ContentPlaceHolder1\$cphContent\$txtMobile"), "56456456");
_setValue(_textbox("ctl00\$ContentPlaceHolder1\$cphContent\$txtPhone"), "4563456345345");
_click(_submit("Save"));
Error log shows
_click(_imageSubmitButton("ctl00\$cphSideBarTop\$lvBranch\$ctrl3\$imbAddToCard"));
Error: The parameter passed to _click was not found on the browser at Jan 28, 2013 3:42:32 PM
I don't know whether it is the mistake that i made in script or CSV file... Somebody plzzzzzzzzzzzzzzzzzzzzzzzzzzzzz help me...I am a fresher in testing feild and I am not getting any help from my company
Answers
Please take a look at the below sample Script:
function login($UserName, $Password)
{
try
{
_navigateTo("***********************************");
_setValue(_textbox("txtUserName"), $UserName);
_setValue(_password("txtPassword"), $Password);
_click(_submit("Login"));
_click(_link("Logout"));
}
catch(e)
{
_logException(e);
}
}
var $data=_readCSVFile("login.csv");
for(var $i=0; $i<$data.length; $i++)
{
$row = $data[$i];
login($row[0], $row[1]);
}
Also, have a look at : http://sahi.co.in/demo/td/guitar.htm
Hope this may help you!!! Good Luck!!
Thanks,
Umashankar