| Share

Wednesday, December 28, 2011

Been a long year!

2011 has been awesome for us. Tyto Software has grown and become a self sustaining unit with a team that has really come together. Sahi Pro is well received and we released V4.0 recently. We also added a lot of new customers; customers, who have expressed happiness at how our product works and how we support them. We added Flex capability, load testing, better reporting etc. to Sahi Pro, and the results have been very positive. A surprising hit feature was our Excel Framework, which saves a lot of time for users not very comfortable with programming.

While our support is generally well appreciated, we have been trying our best to keep improving on it. One sore point has been our lack of online payment processing methods, which we are trying to alleviate in January 2012.

Over all, we are geared well for 2012, having brought on a couple more to the team and put in processes which make the end user benefit a lot from using our product.

So where is Sahi Open Source? We have been very busy with the Pro version and we should be able to get a breather in January to port back fixes into Sahi OS.

Thank you all for your patronage, and wish you a very happy and prosperous New Year!

Monday, March 14, 2011

Sahi V3.5 2011-03-14 released

Sahi V3.5 2011-03-14 is now available on SourceForge.

1) We have added support for HTML5 elements, so, for example,
<input type="number" id="myId"> is identified by Sahi as _numberbox("myId")

2) Proxy switching on IE has become a little better

3) _collect and _count have been added.

Eg.

_assertEqual(5, _count("_link", "View Details"));


and

var $els = _collect("_link", "/View/");
var $len = $els.length;
_assertEqual(5, $len);
_assertEqual("View Details", _getText($els[0]));


4) Ignorable ids made a user modifiable property in sahi.properties/userdata.properties. So if you have a new framework which generates ids in a definite pattern, you can ask Sahi to not use them as identifiers for accessors.
Look at recorder.ignorable_ids.pattern in sahi.properties

5) Checkbox simulation has fluctuated a bit in the last few builds of Chrome. Sahi now assumes Chrome 10+ as default. This is modifiable in sahi.properties
simulation.chrome.explicit_checkbox_radio_toggle=true

Change to false if the checkboxes seem to toggle back to original state.

Download the latest version from here: https://sourceforge.net/projects/sahi/files/
and do spread the good word. You can tweet about it, or like us on Facebook or write a blog post about it.

Wish you happy productive testing!

Sunday, February 27, 2011

Stable accessors/locators using UI Relations

Identification of elements in a web interface is one of the toughest challenges of software UI automation. First came accessing by location (x,y coordinates), which quickly faded away due to window resolutions, rendering differences etc. Then came the concept of identification using code structure. XPath became hugely popular;

Reasons being
1) Automation was only attempted by established developers and they understood XPaths
2) 5 years back web applications were simple enough to easily look at the DOM and identify XPaths.
3) Some (silly!) tools adopted and hugely promoted XPaths for want of innovation on that front.

But XPaths quickly became notorious for being unmaintainable and difficult to understand. If test automation was to spread to non-programmer testers, this would be a huge barrier. Tools then tried to move on to css-selectors, which is still complex for the target test automation teams.

So what could be a possible solution? The answer is in the User Interface.

What is often forgotten in the software industry, is that applications are built to satisfy business needs. So whatever the id, XPath or css-selector is, a textbox meant for "loan amount" will always be near some label saying "Loan Amount". An expand or collapse icon in a tree gets its meaning from the attached "User name" label for that node. These business requirements do not change as often as code or underlying HTML structure. An HTML table may get converted to an ext-js grid with scrollbars, but the cost will still be associated (and aligned) with a product and listed under the heading "Cost". Items related to each other would be shown inside a box with an appropriate heading.

How can we use this information to identify elements? Use UI relations for identification. Sahi, which has been a pioneer in web-automation innovation, handles it as below:

A textbox meant for "loan amount" becomes

_textbox(0, _near(_label("Loan Amount")))
or
browser.textbox(0).near(browser.label("Loan Amount"))

The cost becomes

_cell(0, _near(_div("My product one")), _under(_div("Cost")))

The expand collapse icon becomes

_image("/tree-node-icon/", _near(_span("Expand me")))


1) These accessors clearly communicate what the intention of the accessor is, in a straight forward way (within the constraints of programming language constructs).
2) These also take away the complexity in identifying and stabilizing XPaths, or understanding complex css-selectors, or writing custom javascript loops to accomplish the same thing.
3) They are quite stable. _near allows for more elements to come between two related elements, _under is spatially aligned. So you can move different elements around on the UI and still have your scripts working properly.

UI Relations are guaranteed to exist in any business application, irrespective of whether you have ids or not.

One argument that comes up is, what if there are two similar elements which satisfy the same condition. While it is still possible to index the similar accessors and uniquely identify them, it seldom happens in a real world application. If you have two textboxes near "Loan amount", it is going to confuse your end user. User-interfaces do not generally have such anomalies. That said, an added index to the accessor handles that scenario too, if it arises.


There is one other simplification that Sahi does in its accessor APIs. It does not explicitly state what the identifying property is. For example what could have been

_textbox(<where name="username">)

is simply given as

_textbox("username") in Sahi.

Why? Because there are very few cases where one textbox has name="username" and another has id="username". Such naming would obviously confuse the web developer forcing him to not do something like this.

Combined with UI relations, Sahi also takes care of automatically waiting for AJAX requests and page loads. This makes for robust scripts which hardly have unexpected failures. Other features like parallel playback of suites, automatic report generation, ant integration etc. make Sahi one of the most advanced web testing tools in the industry. If you have not tried it yet, download from http://sourceforge.net/projects/sahi/files/ now. You can also use Sahi from inside ThoughtWorks Studios Twist or PushToTest's TestMaker 6.

Monday, November 08, 2010

October 2010 Update

Hope you had a happy Deepavali.

October continued to be busy. We worked towards the next open source release, with lots of fixes and enhancements. Release was made on 3rd Nov. 2010, just before Deepavali. Part of the focus was on better integration with test management tools. A detailed post on integration shall follow. The new build can be downloaded here: http://sourceforge.net/projects/sahi/files/sahi-v3/2010-11-03/sahi_20101103.zip/download

We did a 2 day online training of Sahi for Advance Internet Inc. We also delivered proof of concept of flex automation to a prospective customer in the banking domain. The flex solution does not need re-compilation of flex code, so may be suitable for environments where modifying code may not be possible.

We could not conduct a webinar last month, but we shall be conducting one on 16th Nov. 2010. Click here to join our webinar: https://www3.gotomeeting.com/register/301637230

We are streamlining the process of support and sales for Sahi Pro online, which should be done by the end of November. Meanwhile, if you have queries on Sahi Pro, please email us at support@sahi.co.in

I did get invited to GTAC on the second day, and managed to talk a little about Sahi's object recognition mechanism. But it would have been much better if I had had time for a full presentation on Sahi. We also had discussions with the WebDriver developers to see if we could adopt WebDriver underneath Sahi. Preliminary investigations reveal that we need to wait some time for WebDriver to mature before we can adopt it. Currently WebDriver supports only one instance of IE on a machine, which may work if you had a Google farm at your disposal, but will not work for Sahi's users who are used to running multiple IE instances simultaneously on a single machine.

Tuesday, October 05, 2010

September Update

The past month has been very special for us. We delivered Sahi Pro to our customers, and without even publishing about it, we got many inquiries about Sahi Pro. This was something we had not expected, but would like more of.

Given the number of support queries coming in, we had to scale to better serve our customers. So Boopathi M joins our team as a support engineer. With a background in programming and teaching mathematics online, we look forward to utilizing his tutoring capabilities to solve technical issues in Sahi for our customers.

We also managed to have a presence in Java One, thanks to PushToTest's generous offer to all its partners to show case themselves. Given that Sahi has started playing a good role in TestMaker's web automation part, this turned out to be a good point of synergy.

I (Narayan) also participated as one of the panelists in the Birds Of a Feather session on open source testing tools, thanks again to Frank, CEO of PushToTest. (It is amazing what PushToTest is doing to promote open source products. If ThoughtWorks is the breeding ground for open source projects, I would say PushToTest is one of the few companies that helps them bootstrap and become commercially viable.) We realized Sahi is almost unheard of in the Java developer community! So we are coming up with ways to rectify that. If you have suggestions, do let us know.

This month was also great because we got lots and lots of praise for Sahi (read some testimonials). We had 4 instances of Sahi users reporting that they shifted from QTP to Sahi because QTP had problems identifying some web elements, which Sahi could easily identify. Some of them also had problems on QTP's Windows 7 support.

Selenium continues to annoy us with its presence. We again had 3 different discussions with users who said "We find Sahi to be much easier to use but developers/management (in the US) have heard only of Selenium." A stackoverflow question has considerably undermined Sahi's capabilities and slandered DP, one of Sahi's old and staunch supporters. It was frustrating to know we can't do much about it. Equally unhelpful is the fact that we will not be able to participate in GTAC 2010 because "the committee reviewed each application with special attention towards contributions to the professional community, among other aspects. We regret to inform you that you have not been short-listed to attend this year's conference." We would have loved some discussion with the WebDriver guys.

Our website was hacked twice last month and if you find google search results showing weird titles for Sahi searches, please let us know on the forums or email us.

We have started a facebook page for Sahi, so please do spread the word.

We now have integrations with Test Management tools like XQual, Testuff and Neuvosoft Test Manager, and we will continue to support more. Coming up is integration with QMetry

Things on the roadmap (Oct-Nov):
1) Flex/Flash support(Pro)
2) Simple loadtesting through HTMLUnit (Pro)
3) Integration APIs for Test Management tools (Open and Pro)

We continue with our integrations with PushToTest's TestMaker and Test Object Designer, and with ThoughtWorks Studios' Twist.

We will be starting webinars every two weeks as an introduction to Sahi. The first session is (tentatively) scheduled for 22 October 2010. If interested please email us at support@sahi.co.in

Thanks for reading through. If you have suggestions, queries or advice, please email us at feedback(at)sahi.co.in. Hope to see you next month!

Thursday, June 10, 2010

Sahi V3 2010-06-10 released

Sahi V3 (2010-06-10) is now available for download. https://sourceforge.net/projects/sahi/

There have been significant improvements and bugfixes in this release.

  • API _under ( http://sahi.co.in/w/browser-accessor-apis ) has been added to locate elements physically under another.

  • API _byXPath has been added to help users from Selenium and other tools move to Sahi.

  • API _row and _option have been modified to be in sync with other APIs. Existing scripts may need to be modified if you use these APIs.


Below is the changelog:


10 Jun 2010
-----------

* Bugfixes
Fixed data truncation bug introduced in 30 Apr build
Fixed getText bug which returned ab on FF and a b on IE for a<br>b
Fixed for &nbsp; in select option text
Fixed window.opener behaviour for link clicks
Fixed parsing error for $a == $b

* Features added
Added Shiretoko as variant of Firefox
_byXPath added.
For browsers without XPath support,
download the javascript file from http://coderepos.org/share/wiki/JavaScript-XPath
and save the contents in sahi/htdocs/spr /javascript-xpath.js
_under added as a positional relation
Lets identify elements under another element eg. _cell(0, _under(_tableHeader("Status")))
5xx errors are displayed on screen too.
Time taken by each test is displayed in logs.
XHR redirects are excluded from injection
Added Driver.setControllerMode. Takes sahi, java, ruby
_option brought in sync with other APIs.
NOTE: older _option(selElement, value) will not work any more
Replace with _option(value, _in(selElement))
_row brought in sync with other APIs.
NOTE: older _row(tablElement, rowNumber) will not work any more
Replace with _row(rowNumber, _in(tablElement))

Monday, May 10, 2010

Ruby Sahi with Cucumber

What is Cucumber?
Cucumber lets software development teams describe how software should behave in plain text. The text is written in a business-readable domain-specific language and serves as documentation, automated tests and development-aid - all rolled into one format.
- From http://cukes.info/

Follow the steps below to get started with Ruby Sahi and Cucumber.

  1. Install Java

  2. Install Ruby

  3. Install cucumber:
    gem install cucumber

  4. Install Sahi proxy: Download Sahi from sourceforge and unzip to some location. (say D:\sahi)

  5. Start Sahi:

    cd D:\sahi\userdata\bin
    start_sahi.bat


  6. Install Sahi Ruby client:
    gem install sahi

  7. Create a file D:\test\login.feature, add the content below and save it.

    Feature: Login
    In order to access the system
    As a user
    I want to be able to login

    Scenario: Login with valid credentials
    Given I am not logged in
    When I try to login with "test" and "secret"
    Then I should be logged in

    Scenario: Login with invalid credentials
    Given I am not logged in
    When I try to login with "test" and "wrongpassword"
    Then I should not be logged in
    And I should be shown error message "Invalid username or password"


  8. Run this feature:

    cd D:\test\
    cucumber login.feature

    There will be a lot of messages with hints on implementing the right steps.

  9. Implement the steps:

    Create a file D:\test\login.rb, add the content below and save it

    require 'sahi'

    def init_browser()
    #Use the correct paths from your system
    userdata_dir = "D:/sahi/userdata"
    browser_path = "C:\\Program Files\\Mozilla Firefox\\firefox.exe"
    browser_options = "-profile #{userdata_dir}/browser/ff/profiles/sahi0 -no-remote"
    return Sahi::Browser.new(browser_path, browser_options)
    end

    #open the browser at the start
    browser = init_browser()
    browser.open

    #close the browser on exit
    at_exit do
    browser.close
    end

    Given /^I am not logged in$/ do
    browser.navigate_to("http://sahi.co.in/demo/training/index.htm")
    end

    When /^I try to login with "([^\"]*)" and "([^\"]*)"$/ do |username, password|
    browser.textbox("user").value = username
    browser.password("password").value = password
    browser.submit("Login").click
    end

    Then /^I should be logged in$/ do
    if !browser.button("Logout").exists?()
    raise "Not logged in"
    end
    end

    Then /^I should not be logged in$/ do
    if !browser.submit("Login").exists?()
    raise "Logged in"
    end
    end

    Then /^I should be shown error message "([^\"]*)"$/ do |msg|
    value = browser.div("errorMessage").text()
    if value != msg
    raise "Incorrect message: #{value}"
    end
    end


  10. Run and watch the tests complete successfully

    cd D:\test\
    cucumber login.feature


  11. Done!