Organizations which create or maintain web applications need to test a lot of functional flows before releasing a new version of the software. Typically a manual tester would sit and test the features before release and this can take up to a month of effort, and is prone to human error. When fixes are rolled out for bugs in this period, those functionalities need to be re-tested and verified, adding to the testers work load. Automating known work flows can easily bring down the testing from 1 month to a matter of days.
Testing repeated steps is also a drudgery which can be alleviated by automation, allowing testers to focus more on creative exploratory testing.
Specifically, in the web domain, there are a profusion of browsers (Internet Explorer, Firefox, Chrome, Safari, Opera etc.) which the end user may use to access the application. Browsers can differ from one another in the way they behave causing an application to work on one browser but not on another. Application developers need to test the application across browsers, thus multiplying the testing effort. Sahi Pro allows users to develop automation scripts which can test applications across browsers and report failures.
Let us see how Sahi addresses common test automation problems:
There are a lot of browsers and they need to be tested for functionality
Sahi Pro works across browsers and Operating Systems. Scripts written for one browser will work on another browser without modification
Sahi Pro’s Controller comes with a very good Recorder, which will help quickly come up with test cases. The recorder also helps identify elements on the browser and test Sahi commands instantly. The Sahi Pro Controller works on all browsers and Operating Systems.
Record and playback is just a stepping stone. It lets users quickly come up with the first cut of their testcases. For maintainability one needs to restructure their code into reusable functions. Having said that, using the Recorder to identify elements, record actions and experiment with Sahi code can save tremendous amount of time. For a single step or for a few steps, a recorder is really useful. It auto generates the code that you need. You can then copy paste it into your reusable functions and parameterize it.
Sahi uses the various DOM attributes of an element for identification. Sahi also has nice APIs like near, in, under etc. which lets us identify one element with respect to another. For example, a textbox near a label can be identified as
Sahi does not solely rely on ids for identification. It uses many other DOM properties, with emphasis on visible text. Sahi’s relational APIs like in, under, near etc. help identify one element with respect to another.
There are 2 types of dynamic ids generated. One which comes up because the application uses 3rd party widgets like ext-js, zkoss, gwt etc., which automatically generate unique ids on the browser. Your developer does not have full control over these. Even if he did, it is a waste of time to try to control that. With Sahi, some part of the visible text will be used to identify the rest of the component. For example, in a tree control, a + icon near a text span may need to be clicked, which may be done using _image(“plus.gif”, _leftOf(_span(“Folder 1”)))
The other type of dynamic id is when there is a list of items being displayed and each item has unique ids against them. But fortunately, at least one piece of information will uniquely identify each row. For example, if it is a list of user names with edit, delete links against each, Sahi can use the username to find the edit and delete link near it.
Using XPath leads to brittle, unmaintainable and slow tests. XPath is used to traverse XML structures which represent data. An HTML page is not data. It is a visual representation of data and is prone to modification. Further XPath is not natively available in browsers. One may need to use external libraries for it. Browsers also have differences in their implementation of XPath.
Unfortunately, browsers differ in the way they expose the DOM. One needs to write wrapper functions to make the script across browsers. Sahi’s APIs does this normalization very well.
You need to configure Sahi to use your proxy. So, browser uses Sahi proxy, Sahi uses your proxy. Details: /w/configuring-an-external-proxy
Sahi will work on all web applications which render on browsers. Your web application may be using J2EE, .NET, PHP, Ruby on Rails, Python or any server side technology. As long as the output is accessible via the browser, Sahi can automate it.
However browsers may render some content via plugins. For example, flex, applet, Silverlight etc. are some technologies which use browser plugins. Of these, flex and applets are automatable via Sahi.
Yes Sahi supports iframes and frames. In fact Sahi automatically loops through all frames and iframes, so you need not explicitly add any script for handling frames and iframes.
Yes Sahi supports all of these. (alerts, confirms, prompts, popup windows, modals launched from showModalDialogs)
Yes Sahi works easily with HTTPS and SSL sites.
Yes, Sahi handles 401 authentication dialogs. It creates its own page with username and password fields, which can be automated like a normal HTML page.
Sahi also has drivers in Java and Ruby. Note that the Java and Ruby drivers let you control the browser, but do not have any of Sahi’s features like automatic reports, distributed playback etc. You may need to write your own framework or use some else’s framework if you use the java or ruby driver. Sahi’s also has a PHP driver which is written and made available by folks from Symfony.
Yes, Sahi can read and write databases, excel sheets, csv files and plain files.
1) Record the first script and play back from the Sahi Controller
2) Add a few more scripts and execute them from the Controller
3) Modify slightly and make sure tests are repeatable.
4) Experiment with Sahi Excel Framework and check if it is suitable for team
5) Create a suite file, add the created scripts/excel files and run them from command line.
6) Run from ant, integrate with continuous integration system like Jenkins
7) Add more scripts, start version controlling the scripts itself and execute longer running test cases.
8) Build time increases, so break into separate suites for smoke tests and complete tests.
9) Distribute tests across machines to reduce playback time. Also configure auto retry.
Selenium 1 is not under active development and Selenium 2 uses the Webdriver technology. Webdriver uses native wrappers around browsers to be able to automate them. This ties Webdriver too much to the implementation of the browser itself. The Webdriver team has now made it a W3 standard and the onus has shifted on the browser vendors to implement and expose these APIs. Webdriver is still a work in progress. Tyto has started working on an implementation of Sahi which uses Webdriver underneath, so when this technology becomes stable enough, our users will be able to transition smoothly underneath to the Webdriver implementation. Currently Sahi is superior to webdriver because of the following reasons:
1) Better location strategy. Webdriver still uses XPaths, css selectors, ids.
2) Better wait mechanism: Sahi can automatically wait for AJAX requests while Webdriver cannot. Code needs to be written to correctly synchronize every AJAX call. This can be abortively expensive to write and maintain, especially by a testing team.
3) Sahi can work without browser focus, while Webdriver cannot, causing flakiness in tests.
4) Sahi can run tests on multiple instances of a browser like IE in parallel, which Webdriver cannot
5) Sahi’s APIs are simple and geared towards testers. Webdriver insists on developers building frameworks on them before it is consumed by testers.
6) Tyto provides support with Sahi Pro
Support is provided via email with a guaranteed response time of 1 Indian business working day. If needed, we use GoToMeeting to trouble shoot issues via desktop sharing.
If you buy Sahi Pro version 3.5 in March 2011, you will get free updates till March 2012. You can continue to use the software after that, but you will not get support or updates. If you wish to continue to get upgrades and support after that, you would need to renew licenses.
If you have a 5 member testing team, you will need to buy 5 licenses. But you can use the same license for playback on multiple machines if needed (for example, with build farms or CI systems). If a team member is replaced by another team member, the same license can be used for the newer user, as long as the number of users remains the same.
After the first year, Sahi Pro licenses can be renewed at same cost/year for following 2 years. The price is subject to change after that.
Yes, Sahi Pro can be downloaded from here: /downloads-archive/
A one month trial license can be obtained from here after registration: /download-sahi-pro/
You can buy online from https://crm.sahipro.com/pay/index.php/order/create
Or email email@example.com with your query.
If you are releasing features often and repeatedly verifying the same features with each release, you should automate.
Sahi lets you automate interactions with the browser. Sahi scripts can run entire scenarios in a fraction of the time a manual tester would take.
Sahi is easier to learn and use for testers. Sahi’s recorder works on all browsers. Sahi automatically waits for AJAX and page loads. It does not use XPaths, but uses more intuitive APIs like _in and _near. Sahi works well across frames, iframes, popup windows, sites with dynamic ids, https sites, 401 authentication sites etc. It has inbuilt HTML reports, and ability to run multiple scripts in parallel.
Sahi was started in 2005 by Narayan Raman while he was working with ThoughtWorks. Sahi’s aim was to address the limitations of Selenium and simplify web automation to make it easily usable by testers. Sahi became open source in October 2005 and has since evolved into a stable, mature testing tool.
2005 – Sahi started
2006 – Reached top 50 projects of SourceForge
2007-08 – Evolved and stabilized
2009 – Commercial support started which further stabilized and validated Sahi
Won Safari Books Online’s Coder Challenge award
ThoughtWorks Twist integrated with Sahi to provide record and playback capabilities across browsers.
PushToTest’s TestMaker uses Sahi’s technology to create a next generation web automation tool
Released Sahi Pro V3.5 and Sahi Pro V4.0
Added support for a host of new browsers and browser versions
KnpLabs folks released PHP driver for Sahi as part of their Behat project.
Tyto Software was founded by the author of Sahi in 2009 to help organizations achieve automation easily. Tyto provides products, services and training around Sahi.
ThoughtWorks, S1, Deloitte, and some of the biggest service providers in India use Sahi.
A partial customer list of Sahi Pro can be found clients list page.
Sahi Pro, released in August 2010, is a commercial version of Sahi. The current release is V4.3.2. A comparison of Sahi OS and Sahi Pro can be found here
ThoughtWorks Studios’ Twist and PushToTest’s TestMaker leverage Sahi for web automation.
Community support is available via the forums
. Commercial support is bundled with Sahi Pro. Please email firstname.lastname@example.org with your Sahi Pro queries.