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.

Sahi 2010-02-08 Released (Followed by 2010-02-21 & 2010-03-02)

narayannarayan Administrators
edited November -1 in Sahi - Open Source
We are happy to announce the release of Sahi 2010-02-08. As usual we have tried our best to address all bugs raised in the forums and add a few new features for better usability.

Some of the significant changes are:
1) Better performance. Thanks to Richard Li for pointing out various areas of improvement and suggesting ways to fix it.
2) Addition of two new APIs: _runUnitTests and _dataDrive

Have a look at the full release notes to see all changes: http://sahi.co.in/w/release-notes

The points worth explaining are _runUnitTests() and _dataDrive(fn, data2D)

_runUnitTests():

Take the case:

Screen flow:
Login (takes to home page) 
Go to customer tab 
Click Create Customer Link 
Enter good data in all fields except date of birth (DOB)
Enter future date in DOB
Submit 
Check validation error 
Cancel to go to customer tab

Repeat with date_under_18_years, date_over_60_years and check for validation errors

The test would be broken down like this:
login();
goToCustomerTab();

function setUp(){
  _click(_link("Create customer"));
  _setValue(_textbox("first_name"), "Ram");
  // other common fields with correct data
}
function tearDown(){
  _click(_link("Cancel"))
}
function testFutureDOB(){
  _setValue(_textbox("dob"), 10/10/2012);
  _click(_submit("Create"));
  _assertContainsText("Future dates not allowed", _div("error"));
}
function testUnder18DOB(){
  _setValue(_textbox("dob"), 10/10/2000);
  _click(_submit("Create"));
  _assertContainsText("Customer should be above 18 years of age", _div("error"));
}
function testOver60DOB(){
  _setValue(_textbox("dob"), 10/10/1912);
  _click(_submit("Create"));
  _assertContainsText("Customer should be below 60 years of age", _div("error"));
}

_runUnitTests();
logout();



Explanation:
1) Login and logout are called at the start and end, so that they are not repeated with each unit test
2) When _runUnitTests() is called, all functions which start with "test" will be executed. The sequence of these tests is not guaranteed.
3) For each textXXX function, first setUp will be called, then the function itself and then tearDown. tearDown will ALWAYS be called, even if there are errors in the function. Errors in a function will NOT stop the test. The script will report the error and proceed to the next test.


_dataDrive(fn, data2D)

Suppose we need to create a lot of customers and we have a createCustomer function, we can do it using _dataDrive
customerData.csv
---
Ram, Sharma, 22
Sita, Sita, 45
Lakshman, Prasad, 50
---
function createCustomer($firstName, $lastName, $age){
  // steps to create customer
}

var $data = _readCSVFile("D:\\customerData.csv");
_dataDrive(createCustomer, $data);


This will pick each row of $data and invoke createCustomer by passing the values in each row as arguments to it. Errors will be logged but will not stop execution.

So this is equivalent to
try{
  createCustomer("Ram", "Sharma", "22");
}catch(e){// log exception}
try{
  createCustomer("Sita", "Sita", "45");
}catch(e){// log exception}
try{
  createCustomer("Lakshman", "Prasad", "50");
}catch(e){// log exception}

Happy Testing!
Regards,
Narayan

Comments

  • narayannarayan Administrators
    A bug fix release has been made on 21 Feb 2010, which fixes issues with waits in AJAX applications and increases stability of Sahi playback.

    Changelog:

    21 Feb 2010
    This release has more bugfixes/enhancements with the ZK framework in focus.
    * Features added
    Some smaller Accessor APIs like _italic, _emphasis, _strong etc. added
    Added ability to wait on different readyStates of AJAX calls. Default waits for 1,2,3
    Updated java sample project
    Modified _keyPress, _keyDown and _keyUp to take an array [keyCode, charCode] too as parameter
    Added details to Java Sample Project

    * Bugfixes
    Some click events on Safari, Chrome and Opera fixed
    Fixed XMLHttpRequest proxying on Safari
  • narayannarayan Administrators
    Another bugfix release (02 Mar 2010) follows, especially for ZK users having trouble with blur events not being called correctly.

    Changelog:

    02 Mar 2010
    * Bugfixes
    Fixed blur/onchange event generation.
    Fixed event.button on IE.
    Host/port made configurable on Browser class for java driver
Sign In or Register to comment.