What is new in Sahi Pro v6.0.0

abstract Sahi Pro v6.0.0 is a major release and contains many new features and fixes. The focus of this release is tester productivity enhancement.
warning This release has significant changes in userdata folder. Please do not upgrade on an existing installation.

Please do a fresh installation of Sahi Pro 6.0.0. in another folder and copy over your older userdata/scripts folder to the new installation. Also selectively copy changes from userdata/config files to the new installation.

Key features

Editor

Script and Suites Editor The Sahi Script Editor has been completely revamped. The editor allows you to view all the scripts in the scripts directories and edit them from the browser based editor. The editor supports normal Sahi scripts, Scenario files (.s.csv) and Data-driven Suite files (.dd.csv).

Editor Context Pane The Context pane of the editor lists all known functions in the script directories, making discovery of functions very easy. One can view the details of functions used in scripts, discover and call functions from any other script and also create new functions through the "Create Function" dialog. This prevents testers from writing duplicate functions or making mistakes in function names or parameters passed.

Object repository entries are also visible and editable via the Context pane.

Playback from editor Scripts and suites can be executed directly from the Editor. Functionality of the older Web based testrunner (available upto v5.1.2) has been integrated into the Editor. One can choose single or multiple browsers for playback. Suites can be played back sequentially in a single browser session, or run in parallel on a single machine or run distributed across multiple machines with parallel instances running on each machine. Simple or data-driven suites can also be created on the fly using the Create Suite functionality.

Ant targets and Jenkins support Ant targets for running with builds can now be created from the Script Editor itself via the "Create Ant Target" functionality. Read more in "Triggering Sahi Pro from Jenkins" section.

Triggering Sahi Pro from Jenkins

Sahi Pro needs real browsers to playback test scenarios. But most Jenkins/build machines run in server mode and do not have a GUI. This forces end users to either try with headless browsers or to execute Sahi scripts remotely. With the new changes this is what you can do: Jenkins machine (J): Run Jenkins on server. No Sahi installed. Sahi Master machine (SM): Sahi Pro runs on this machine and behaves as Master Sahi slave machines (SL1, SL2, SL3): These are slave machines with Sahi Pro running on them.

During the build process: Jenkins pulls the latest scripts from the Source Control Management (SCM) system. It calls the Sahi ant target. Sahi target copies over the scripts from Jenkins (J) to master (SM). SM then copies scripts to SL1, SL2, SL3, distributes the execution and collects all reports. Sahi ant target then pulls reports from SM to Jenkins. This allows Jenkins to remain a headless server and does not need Sahi installed on it. Also all distribution of scripts and pulling of reports happens through Sahi's ant target itself.

Object Repository

Object repository is now tightly integrated in Controller itself.

Better Reporting

Browser Page and Element Screenshots via _takePageScreenShot
Screenshots are a useful way to get more information in case of script failures. Sahi now has the ability to take screenshots of just the browser content and not the full desktop. One can even take screenshots of specific elements like a table or a div containing a graph. Have a look at _takePageScreenShot API for usage.

Better error stacktraces
On script failure or error, Sahi logs now shows the stacktrace of function calls, allowing easy navigation to calling functions.

Script locking for synchronization
API _lock allows synchronization between scripts. When a lock on one label is obtained another script cannot obtain the lock on the same label and will wait till _unlock is called. Similarly _lockWindow API can be used to exclusively work on a particular window. This is useful in taking screenshots during parallel playback. This is already used in global_include.sah

Globally included global_include.sah file
All scripts now automatically include global_include.sah file during playback. Common error handling functions like onScriptError and onScriptFailure can be defined here. Sahi Pro 6.0.0 ships with a default global_include.sah with default implementations of error callback functions.

Searching scripts within suites in Sahi's logs
It is now possible to search both by suite and script name and also see scripts executed as part of suite runs.

Improved Graphs
Graphs on suites reports page have been improved to present information better.

Compare images

APIs for comparing two images and asserting on images has been added. Combined with the ability to take screenshots of individual elements, you can now add assertions of graphs or specific UI elements which are to be asserted for their visual correctness.

Native events

Sahi Pro so far had support for native keyboard events. From 6.0.0 native mouse events are also supported. This allows complex functionality like dragdrop across multi domain iframes, complex file upload controls etc.

New APIs

Fetch related APIs Native click related APIs Assertion APIs Images related APIs Popup window related APIs Lock related APIs Documentation APIs Misc APIs Callback APIs

Modified API's

Other Features and Enhancements

Bug Fixes