Automation with sahi





An automated test is a program for testing other programs- Rex Black.

  • use of software to control the execution of Application
  • comparison of actual outcomes to predicted outcomes
  • setting up of preconditions
  • other control and reporting functions


Potential benefits of testing automation

Repetitive work is reduced (e.g., running regression tests, re-entering the same test data, and checking against coding standards)
Greater consistency and repeatability (e.g., tests executed by a tool in the same order with the same frequency, and tests derived from requirements)
Objective assessment (e.g., static measures, coverage)
Ease of access to information about tests or testing (e.g., statistics and graphs about test progress, incident rates and performance)


example of login test execution

_navigateTo("http://.................../");


var $p =0;


function login($sn,$uname,$pwd)

{
//Set userID
_setValue(_textbox("ctl00\$MainContent\$txtUserName"), $uname);

//Set password
_setValue(_password("MainContent_txtPassword"), $pwd);

//Click login
_click(_submit("ctl00\$MainContent\$btnSubmit"));

_click(_image("A1"));

_writeCSVFile($sn, "../scripts/TestData/Login1.csv");

_click(_link("Logout"));
}




function call($j,$k)
{
try
{
for (var $i=$k; $i<$j.length; $i++)

{

var $row = $data[$i];
login($row[0], $row[1], $row[2] );
}
} catch(e)
{
_logExceptionAsFailure(e+$k)
$k++;

call($j,$k);


}
}



var $data = _readCSVFile("../scripts/TestData/Login.csv");

call($data,$p);


Login.csv template
sn,UID,PWd




script will execute corresponding to Login.csv data entries. Pass Result will store in Login1.csv while log will contain errors.

Comments

Popular Posts