I am into test automation for last 6 years and I have used tools like Selenium, Test Complete and many other tools. During one of the meetings with a friend of mine where I was bragging about Selenium and the power of the tool, he asked me to do a small comparison with a tool which I had heard before but never tried it.. Sahi Pro.

I thought about a challenge, about a little tricky problem statement and then see how the two tools compare.


Let me define the challenge steps:

  1. Enter URL in your browser
  2. Click on Departments
  3. Hover on “Faculty of Civil Engineering
  4. Select “Institute for Ocean Management”
  5. Verify title “Institute For Ocean Management – Anna University offers M.Tech in Coastal Management. ENVIS Center for Coastal Zone Management and Coastal Shelterbelts” (this is where we want to assert whether we have reached the proper page or not)

Why I thought this as a challenge is that while we try to automate the above problem statement in selenium webdriver, I realized that locating the element of ‘ Select “Institute for Ocean Management” ’ is very tough because when we hover on the element, it shows a list and when trying to inspect the elements of list , the hover list gets disappered, because of this issue, inpection does not work properly and it inspects some random element.  Thus even identification of the Xpath or equivalent becomes a challenge in itself.

Please try to find Xpath of Institute for Ocean Management and you would understand what I mean.

Other Challenges in the above problem statement when attempting in Selenium Webdriver:

  1. To handle hovering part in selenium webdriver, we need Action class (scripts size increasing).
  2. Hovering list takes some time to displayed, so we have to use some explicit wait because some times it appears very quick and some time it takes little time.
  3. And then clicking on the context menu whose xpath identification I mentioned about earlier.

So If we go for selenium webdriver for automation, the steps that are invoved in the complete scriptings are:

  1. Open the browser
  2. Open the application
  3. Click on Department link
  4. Create Action class object
  5. Hover on the element
  6. Define some wait here so that the hover menu item gets visible
  7. Select “Institute for Ocean Management”
  8. Verify the page title

These are the steps with the challenges mentioned earlier thrown in – the automation of these steps might take anywhere between 30-45 minutes if you are doing it for the first time. If you get stuck then you will have to go out and look for articles listing your problems, you might end up copying pasting the code too…


Having set the ball rolling, I thought lets try to do this automation challenge in Sahi Pro.

I opened the Sahi Pro Console and started the automation by passing on the web site. Started clicking on the respective elements..

Incidentally I did not have to do anything.. all the steps mentioned above Sahi Pro did not even frown. Amazing.

There were 3 steps auto recorded by Sahi Pro and the 4th one I had to write a small line for assertion.

  1. Open Application
  2. Click Department
  3. Select Institute for Ocean Management
  4. Verify the page title

Here is the script from Sahi Pro

_click(_div("Institute for Ocean Management[1]"));
_assertEqual("Institute For Ocean Management - Anna University offers M.Tech in Coastal Management. ENVIS Center for Coastal Zone Management and Coastal Shelterbelts",_title(),"Matched title");


Screenshot from the Sahi Pro editor is below


Here is the script from Selenium/Java

package scripts;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;

public class AnnaUniversity {
  public static void main(String[] args) {

    // step 1
    WebDriver driver;
    System.setProperty("", "src\\test\\resources\\drivers\\chromedriver.exe");
    driver = new ChromeDriver();	
    driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
    // step 2

    // step 3
    By byLink = By.partialLinkText("Depart");
    WebElement ele1 = driver.findElement(byLink);;

    // step 4
    Actions action = new Actions(driver);
    // step 5
    By byDepartofCivil = By.xpath("//*[@id=\"link3\"]/strong");
    WebElement ele2 = driver.findElement(byDepartofCivil);
    // step 6
    WebDriverWait wait = new WebDriverWait(driver, 5);
    By byHoverObj = By.xpath("//*[@id=\"menuItemHilite32\"]");
    // wait till the institute of ocean management comes
    try {
    catch (Exception e)
      // something wrong happened
      System.out.println("Error is " + e.getMessage());

    // step 7
    //now hover - institute of ocean management
    WebElement ele3 = driver.findElement(byHoverObj);
    // step 8
    if(driver.getTitle().equals("Institute For Ocean Management - Anna University offers M.Tech in Coastal Management. ENVIS Center for Coastal Zone Management and Coastal Shelterbelts")) {
    System.out.println("title matched");	
    }else {
      System.out.println("title not matched");

    // step 9



Hope you can easily understand the ease that Sahi Pro would have resulted in by looking at the above two code snippets.


Sahi Pro has also another advantage it provides a good editor built in so we can do some research on it, no need to learn another IDE like eclipse.

Please do note that I humbly accept that Round1 goes to Sahi Pro. I am a big fan and a user of Selenium so this actually has been a big surprise for me. Never imagined that kind of work we have been so proud to undertake using selenium does not even remain challenging any more if we have tools like Sahi Pro. Remarkable indeed.

But hey, I am calling this as my round 1 challenge – as I feel that unless we really test Sahi Pro well – or throw enough challenges towards Sahi Pro how can we really be certain about it’s worthiness..

You can check more about Selenium and Sahi Pro on the following URL’s respectively

I will be posting more blogs and videos on this.. Stay hooked.

Leave a Comment