- Explore
Introduction, screen-shots, features, limitations
- Getting started
Prerequisites, download, install, browser configuration, record, playback, view logs
- Sahi Scripting Basics - I
Statements, variables, functions, conditions and looping, _include
- Sahi Scripting Basics - II
- Sahi APIs (built-in functions)
- All APIs
- Browser Accessor APIs
- Browser Action APIs
- Miscellaneous APIs
- Sahi Scripting - Calling Java
- Exception handling using try-catch
- Recovering without try-catch using _setRecovery
- Script lifecycle call back functions
onScriptFailure, onScriptError, onScriptEnd
- Data Driven Testing
_getDB, CSV Files, Excel, Databases
- Multithreaded Playback (Parallel execution)
suites, commandline, ant
- Advanced techniques, tips and examples
- HTTPS/SSL Sites
- Configuring an External proxy
- Adding jars to Sahi's classpath
- Configuring Browser Types
- Sahi GUI Less Installation
- Sahi headless with PhantomJS
- Sahi headless with Xvfb
- Sahi with Android
- Tweaking Sahi APIs
- Jenkins Integration
- Sending Emails
- CSV Files as Suites with Tags
- Working with SSH
- Reading PDF Files
- Run Sahi Scripts from Java
- Other language drivers
Driving Sahi from Java, Ruby etc.
- Java
- Ruby
- Trouble Shooting Sahi
- Sahi Pro
- Sahi Pro V4.2 Documentation (PDF)
- Excel Framework
- Load Testing (Beta)
- Sahi Flex Support - sfl (Beta)
- Sahi Applet Support (Beta)
- Running tests on multiple machines
- Web based Testrunner
Concept
Sahi Pro lets you run load tests on your application. There are 2 Sahi scripts involved in this. One is used to generate the load. This script is called the noise and is run on a headless browser. The steps in the noise file are generally in an infinite loop so that they never terminate. The other script is called the subject. The subject is the script whose steps you would like to measure periodically at different loads.
Instructions
- Get the headless browser: PhantomJS
Read this article to add PhantomJS to Sahi.
- Start Sahi Pro. PhantomJS should be visible on the Dashboard as one of the browsers.
- On the dashboard, click on the “Bin” link. This will open up a command prompt at userdata/bin
- On the command prompt, run
dload.bat demo/load/noise.sah demo/load/subject.sah http://sahi.co.in/demo/training firefox
This will do the following:
- Run 1 (min) threads of noise.sah on PhantomJS (This will not be visible)
- Run subject.sah on firefox browser and store the time of steps.
- Wait for 5 seconds (interval)
- Run 2 (incrementby) more threads of noise.sah on PhantomJS
- Run subject.sah on firefox and store results
- Keep incrementing the noise threads at periodic intervals, run the subject, and store results, till it reaches max noise threads.
Once done, click on “Logs” link on the Dashboard to view results.

To test your application, go to userdata/scripts/demo/load folder.
- Open noise.sah and add your sequence of steps. These steps should be representative of a normal user interaction. Note that your steps should be in a while(true){} loop so that the threads don’t die out. (Refer to existing noise.sah)
- Open subject.sah and specify the sequence of steps whose reaction times you would like to measure at different loads.
The parameters min, max, incrementby, interval etc. can be edited in dload.bat file.
It is also possible to involve multiple machines in creating the load by modifying the “NODES” variable (Look in dload.bat)