Home » Sahi » Sahi Web Automation Tool – Basic Understanding !

Sahi Web Automation Tool – Basic Understanding !

  1. Sahi is Web Automation Tool in which two kinds of tools available for use

    Sahi OS: It is open source .
    Sahi Pro : It is paid tool.   http://sahi.co.in

  1. I am using Sahi Web Automation Tool. It’s a very good tool to use for Web Automation.
  2. Start with Sahi Open Source.
  3. Download latest version  of JDK 32 bit. And install JDK on your machine.
  4. Remember 32 bit of JDK supports ODBC connection so you need to install 32 bit JDK.
  5. After Installing JDK set  value in “path”  environment variable also.

    Path=C:\Program Files\Java\jdk1.7.0\bin

    Note : To set path in environment variable please right click on Computer and click on Properties.
    Go to Advance system Setting and click on Environment Variables and set path in “path” environment variable.

  1. Now download latest Sahi OS version ( http://sourceforge.net/projects/sahi/files ) and install Sahi.After Installing you will get folder of sahi on your drive where you have installed Sahi.
  2. Now you are ready to start with sahi.
  3. Click on Sahi shortcut created on desktop.
  4. By default, all browsers installed on your PC are shown. If not then click on Configure link
  5.  Go to browser_types.xml, you will see that there is some configuration for browsers. Check whether path for installed directory of browsers is mentioned properly or not. If not, change the path and restart the sahi.
  6. To check Sahi is working on all browsers taking example of one browser i.e. Mozilla
  • Start Sahi
  • Click on Mozilla browser you will get following screen.Image
  • ALT + Double Click to open sahi controller you will get controller as shown below
  • Now to identify object just press “Ctrl” key and over the mouse on any object you will get all the details of the objects in Accessor and Alternatives.
  • For checking that sahi is working or not; press Ctrl and hover the mouse on textbox of name “Enter start URL:” and enter value as “Test” in “Value:” textbox of controller.
  • Click on Set button on controller. You will see that Test is entered in textbox as shown in figure. If Test is entered then Sahi is working properly.
  • Else you can check
    1. Firefox:   http://sahi.co.in/forums/discussion/4779/firefox-20-0-giving-issues-to-anyone/p1
    2. Chrome (If controller not opening for Chrome browser): http://sahi.co.in/forums/discussion/4624/sahi-controller-doesnt-open-with-chrome-version-24-0-1312-52-m/p1
    3. Or just search on Google with your problem. I am sure; you will get many solutions from Sahi forums and Sahi blogs.


  • As described above; check all browsers are working and controller is opening for each browser.
  • Now you are ready to start with Sahi Web Automation Tool and Sahi Scripting.
  • Before starting; Please go through http://sahi.co.in/w/using-sahi for better understanding of Sahi Web Automation Tool.
  • Some sample format of how to write script please refer below scripts(Generalized)
  1. Action= name of operation you want to perform on objects.
  2. Object type= name of object type e.g. “textbox”,”button”,”link” etc
  3. Object name= name of object
  4. Value= Value if any.
  5. Position=near or under position( This is basically used when you are performing action on particular object with reference to another object)
  6. Nearobjecttype: Type of reference object
  7. Nearobjcetname= Name of reference object
  8. Underobjcettype– Type of reference object
  9. Underobjcetname– Name of reference object
  • Please refer some generalize script which is helpful to understand “How to write ascript?”
  1. _action(_objecttype(“object name”),”value”);
  2. _action(_objecttype(“object name”));
  3. _action(_objecttype(position,_near(_nearobjcettype(“nearobjectname”))),”value”);
  4. _action(_objecttype(position,_near(_nearobjcettype(“nearobjectname”))));
  5. _action(_objecttype(position,_under(_underobjcettype(“underobjcetname”))),”value”);
  6. _action(_objecttype(position,_under(_underobjcettype(“underobjcetname”))));
  7. _action(_objecttype(position,_near(_nearobjcettype(“nearobjcetname”)),
  8. _action(_objecttype(position,_near(_nearobjcettype(“nearobjcetname”)),
  • With the above script; you can check “How actual script is written?”
  1. _setValue(_textbox(“Login”),”Abhijeet”);
  2. _click(_button(“Submit”));
  3. _setSelected(_select(0,_near(_label(“Country”))),”India”);
  4. _check(_checkbox(0,_near(_label(“Male”))));
  5. _setValue(_password(0,_under(_span(“Please Login”))).”abcd1234”);
  6. _click(_radio(0,_under(_label(“Male”))));
  7. _setValue(_textarea(0,_near(_cell(“Samsung”)),_under(_cell(“Prize”))),”250”);
  8. _click(_submit(0,_near(_div(“Samsung”)),_under(_cell(“Prize”))));
  • Hope this will helpful for you to understand how script is written.

Hope, this Document will help to start with Sahi Web Automation tool .

For More Information Visit   http://sahi.co.in  and Thanks to Narayan and Tyto Software Pvt. Ltd team for making wonderful tool for Web Automation tool. 

All the Best.


One thought on “Sahi Web Automation Tool – Basic Understanding !

  1. Pingback: Behind the Code, Development and Testing: An Inside Look at Quality Assurance « Webonise Lab

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s