Why Sahi Pro is much more than Record & Playback !!!

Published on 13th June 2016 Test automation

Why Sahi Pro is much more than Record & Playback !!!

We associate few experiences to some phrases. The phrases immediately trigger back the memories to us. Some famous phrases in the realm of test automation include “100% testing”, “XPATH”, “record and playback”, “GUI Testing”, “Assertions”. One such phrase associated with strong reactions is “Record and Playback”. While some hate the limited capability of the record and playback mechanism and its brittleness in relation to the mouse coordinates, others like it for the simplicity and how it can be a quick and dirty solution.

Some perceptions take time to change. I was also of the opinion that Record and Playback tools meant unreliable and something that can be used only for a short period of time. My experience with AutoIt and the struggle with the mouse coordinates did not help change the perception. And then, I used Sahi Pro. The tagline is quite interesting—“The Tester’s Web Automation Tool”. I was curious as to why it was called the “Tester’s Web Automation Tool” and not just “Web Automation Tool”. I got my answer as soon as I started to play with the tool. It starts as a record and playback tool and extends itself much beyond that.

Power of Java within Sahi

For a start, one can use Java libraries right from the Sahi Script. Sahi’s JavaScript is executed in a Rhino JavaScript Interpreter, running inside Sahi’s proxy. As Sahi scripts run on the Rhino JavaScript engine, this allows Sahi to call any Java code in the classpath of Sahi. What does this mean to someone who is experienced in programming languages? They can use Sahi Pro to write powerful scripts quickly by making use of the many Java libraries available. They can test Java classes by writing scripts.

Powerful Accessor Repository

When you record, you can have Sahi Pro create a Accessor Repository(AR) file for you by turning on the ‘Record with Accessor Repository’ option. Once a Accessor Repository file is chosen, an element will always be identified first by its AR entry, even when not in recording mode. This prevents the same element from being identified in multiple ways in different scripts. One can thereby get rid of the brittleness of the recorded scripts. There is also provision to modify existing AR entries.

Use ( . ) to get attributes

Adding a dot (.) after the accessor in the accessor field, shows all the properties of the accessor. Further typing narrows down the list of properties.


Clicking on an option (say, disabled) or typing .disabled directly in the accessor field and pressing Enter will populate the value in the “Value:” box. (In this case, .disabled is false)

Clicking on Assert will create an assertion for just that property.

Excellent logs and reporting mechanism

When record and playback tools restrict themselves to the recording of the scripts and the tester has to write code to get logs and reports, Sahi Pro is different. One does not have to write a single line of code to get the logs, reports of the scripts/suites. It’s inbuilt logging and recording feature is quite handy. One could also run SQL on the reports to get the exact report they desire.

Distributed Playback

I don’t think many record and playback tools, in fact many automation tools provide the feature of distributed playback. What Sahi Pro does is something quite amazing. You can play multiple scripts at once – on a single machine or even better across machines. Do you know any other tool which can run multiple instances of Internet Explorer on the same machine? Sahi Pro does it with ease.

Distributed Playback

With such powerful features, Sahi Pro not just relies on record and playback but is much more powerful. So, as a tester you can start with Record and Playback and build on it based on the context. Start adding assertions, create functions at the click of a button, use the common accessor repository or use the exhaustive documentation about the different APIs supported by Sahi Pro.

It is time to change your perception about record and playback tools and consider Sahi Pro to be the Tester’s Web Automation tool. Try it out here and let us know what you think. Here is the quick tutorial to get you up to speed.