I was using Ruby for Watir, but now there’s Watij!

I need to do a comparison of Selenium, Watir, Sahi and well I just found out that there is something called Watij as well. I had almost settled on Watir but a Java equivalent is good news, and better continuous integration options with JUnit etc. come to mind.

The things I liked about Watir are the following:

  • Unlimited flexibility, because you can script and control pretty much whatever you want. Nested frames, tables, no problem.
  • No need to mess around with the web-server (Selenium) or set up a proxy to get things to work (Sahi). You need Ruby and Watir installed though.
  • One of the areas where you immediately get stuck when doing browser automation is handling popups. I was able to get Watir to work when handling one of those horribly over-javascripted pages (treeviews and all) by finally switching to “brute force” mode, i.e. simulating key presses etc.
  • Integration with the Ruby unit testing framework allows you to neatly structure even the order of your test cases, assert for expected results and get a summary at the end.

Main gripes with Watir at the moment:

  • Only IE support so far. There is a “FireWatir” being worked on, but it has to reportedly improve on the performance front.
  • No “record” option, but Selenium IDE barfed on some of the extreme javascript I encountered. I have not tried Sahi yet, and plan to – I heard some good feedback from colleagues who attended a recent Agile conference in town.

I totally am sold on Ruby being a great DSL for testing used with Watir, and I can’t wait to look at equivalent Watij scripts and compare. Would be interesting to see if it offers some good integration with JUnit for example…

12 Responses to I was using Ruby for Watir, but now there’s Watij!

  1. Jake Dempsey says:

    Take a look watij. Watij is actually intended to be used with the Junit framework. Watij is actually listed as an extension on junit.org. Watij also has a growing user base and Brian Knorr, Johnathan Conley and I are actively adding new features, and supporting our growing user community. We would love for you to try it out and offer feedback/suggestions/comments on watij.

    With watij, you get the benefits of watir with better popup window support, blindly fast XPATH support, the robustness of the java language and libraries, and also you can integrate watij tests as you would any other junit test: including continuous integration, code coverage, great performance, etc…

    It is perfect for agile teams wanting to automate acceptance tests and build robust regression suites.

    Let me know if you have any questions.

    Jake Dempsey
    Co-Creator of Watij
    http://watij.sourceforge.net
    watijhelp@gmail.com

  2. Peter Thomas says:

    Thanks Jake, I will indeed dive into Watij right away – and knowing that it indeed is JUnit friendly is terrific. Now I can un-install Ruby :) Not that I have anything against Ruby – but I’m sticking with Java and Spring for the moment.

    As a suggestion, you could mention the JUnit support on the Watij home page, right at the top – I was looking for that important piece of info actually.

    I will definitely post my findings here soon and a comparison with Watir.

  3. Jake Dempsey says:

    Peter,

    Let us know if we can be of any help. Make sure to check out http://watij.sourcefoge.net and sign up as a member on our xwiki site. I would love to get your feedback posted on the google group so that it can be viewed by the watij community. Thanks

    Jake Dempsey
    http://watij.sourceforge.net
    watijhelp@gmail.com

  4. There is a flash tutorial available on the Sahi website.
    You could check it out without going through the efforts of installing it.
    Check it out at http://sahi.sourceforge.net/sahi_tutorial.html

    Looks like all tool writers are trying the convincing act here :)

    Now let me go checkout watij.

  5. Pingback: Incremental Operations » Watij and running JUnit test methods in the order that you want

  6. Angrez says:

    Hi,

    FireWatir version 1.0.1 is released with all the problems regarding the performance fixed. Now you can run the scripts targeted for watir on Firefox with minimum changes.

    For more details:
    http://code.google.com/p/firewatir

    – Angrez

  7. rafa.ferreira says:

    FireWATIR, which actually was not mature as WATIR. I found some limitations, like we could not click in a html .

    I need to integrate WATIR or FireWatir or Watij with some js coverage tool.

    I have tried the JSCoverage, but it is not perfect for me yet!

    Anny sugestion?

    Thanks
    Rafael Ferreira

  8. Peter Thomas says:

    @Rafael – you could try Selenium, I actually switched from Watij a while back.

  9. dk says:

    Is there a open source gui based “watij” version

  10. Peter Thomas says:

    @dk – I use Selenium nowadays, and the Selenium IDE FireFox plugin is something you may want to look at.

  11. Arham says:


    Permissions

    The above snippet is for clicking on a tabbed link named
    “Permissions”.
    I tried
    ie.frame(sf.name, “content”).link(sf.text, “Permissions”).fireEvent
    (“onClick”);
    and
    ie.frame(sf.name, “content”).executeScript
    (“javascript:document.getElementById
    (‘btnRolePermissions’).value=’clicked’;
    CCUtility.submitEnclosingForm(this);”)
    and
    ie.childBrowsers()… but none worked.

    Please help!!
    Arham.

  12. Arham says:

    The snippet can be found as follows:

    <frame id=”main” name=”content”>
    <li>
    <input id=”btnRolePermissions” type=”hidden”
    name=”btnRolePermissions”/>
    <a onclick=”javascript:document.getElementById
    (‘btnRolePermissions’).value=’clicked’;
    CCUtility.submitEnclosingForm(this);” href=”#”>
    Permissions </a>
    </li>
    </frame>

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

%d bloggers like this: