InfoQ

News

Catching up with Selenium: Testing Ajax, v0.8 Released

Posted by Floyd Marinescu on Sep 25, 2006

Community
Java,
Agile,
.NET,
Ruby
Topics
Software Testing
Tags
Testing ,
Selenium ,
TDD
Selenium is an web app functional testing tool written by ThoughtWorks.  Selenium uses JavaScript and Iframes to embed a test automation engine in your browser, allowing Selenium to execute in any JavaScript-enabled browser. InfoQ spoke to Jeff Xiong, one of the Selenium core developers to find out more about the recent 0.8 release of Selenium core.    Also, in this latest InfoQ article on Selenium, the Selenium team show how to configure the tool for testing Ajax applications using the waitForXxxx Selenium commands;demonstrating how to test a simple Ajax effect - an asynchronous text update - with Selenium.

Read Testing Ajax Apps with Selenium.

On the release of version 0.8, Jeff Xiong explained each of the new features:
  • A "multiWindow" option which places the application-under-test in a  separate window, allowing testing of "frame-busting" apps. In the past Selenium didn't deal with the applications-under-test (AUT) which use frames very well, because it put the AUT in an embeded frame instead of stand-alone window. That was one of the largest problems preventing people from using Selenium. In 0.8, we provided an option to put the AUT in a stand-alone window, so that we can deal with all kinds of AUT actions that previously might have broken Selenium (e.g. change location of "window.parent" or "window.top"). This is the most important improvement in this new version.
  •  More reliable page-load detection for popup windows. There's a bug makes firefox cannot detect "children" windows' page-load status. That means with the combination of older version of Selenium and firefox, there may be some unpredicatable test failures. In this new version we provided a firefox plugin, which enhances firefox and makes the test more reliable.
  • New cookie-management actions. The past versions cannot deal with cookies. Users had to set up cookie environment in AUT by themselves to test cookie-related functionalities like "login". 0.8 provided cookie-handling actions like "createCookie", "deleteCookie" and "storeCookie", so that users can setup and teardown cookie environment in test cases.
  • Run-speed slider and "Pause" button which replace the old Run/Walk/Step radio-buttons.  In past versions we provided only 2 different speed
    options: fast "Run" and slow "Walk". In 0.8 we provided a slider to control the speed. Users can choose any speed between "very fast" and "very slow", allowing them to observe the tests in action.
Selenium is open source and maintained by ThoughtWorks. The tool was designed specifically for the acceptance testing requirements of Agile teams.

Related Sponsor

VersionOne is recognized by Agile practitioners as the leader in Agile project management tools. Companies such as Adobe, BBC, CNN, Dow, HP, IBM, Sony and 3M have turned to VersionOne to help deliver greater value to their customers.

very cool feature by Alex Popescu Posted Sep 25, 2006 4:41 PM
Re: very cool feature by Stefan Tilkov Posted Sep 28, 2006 3:39 AM
Good Article by jessica winslet Posted Apr 1, 2009 7:31 AM
Re: Good Article by Victor Hugo Saavedra Posted Oct 20, 2009 3:03 PM
Commercial tool support by Patrick Lightbody Posted Sep 28, 2006 8:55 AM
Re: Commercial tool support by Alex Popescu Posted Sep 28, 2006 4:49 PM
AJAX functional Testing by Alex F Posted Feb 16, 2007 11:40 AM
Re: AJAX functional Testing by meenakshi ghosh Posted Sep 4, 2008 12:53 PM
  1. Back to top

    very cool feature

    Sep 25, 2006 4:41 PM by Alex Popescu

    I must confess that in the past all my AJAX pages were tested using pause(), and not only because of Selenium limitations, but also because it gave me a way to see what happens when the server timeouts (which by the way is something that must be tested).

    Now, regarding the new commands I am noticing in the above example that you need to provide twice the future value (the waitForX command and also to the assert). I am wondering what were the reasons behind this decission, instead of having a single command/assertion that does both jobs (wait for result and assert).

    ./alex
    --
    :Architect of InfoQ.com:
    .w( the_mindstorm )p.
    Co-founder of InfoQ.com

  2. Back to top

    Re: very cool feature

    Sep 28, 2006 3:39 AM by Stefan Tilkov

    For Ruby, an alternative is to use the unit testing support built into script.aculo.us.

  3. Back to top

    Commercial tool support

    Sep 28, 2006 8:55 AM by Patrick Lightbody

    We're also very excited about this new release. The original work on the multiWindow mode actually came out of the commercial work we've been doing on HostedQA and AutoQ. The reason is that we didn't want our customers running tests in an iframe (like Selenium requires by default) as opposed to running in a normal browser window. (You can see what the reports/screenshots look like for some popular opensource projects here).

    If you find that you like Selenium, but wished it had some additional features (auto deployment of Java/Rails applications and databases, screenshot support, or refactoring features), then it might be worthwhile to check out our stuff. The nice thing is you can use Selenium IDE to import tests and you are free to export your tests at any time. Combine that with a free trial, and it's pretty much no-risk to check out.

    The next feature we're going to be pushing back in to the Selenium project is HTTPS support. Up until now, there was no way to test HTTPS applications with Selenium RC, but as of this week we've donated some code to the project that will allow this.

  4. Back to top

    Re: Commercial tool support

    Sep 28, 2006 4:49 PM by Alex Popescu

    Great job Pat! And thanks for contributing it back to the community.

    ./alex
    --
    :Architect of InfoQ.com:
    .w( the_mindstorm )p.
    Co-founder of InfoQ.com

  5. Back to top

    AJAX functional Testing

    Feb 16, 2007 11:40 AM by Alex F

    You can also check SWExplorerAutomation SWEA from webiussoft.com. SWEA was specially designed to support AJAX (DHTML) applications. SWEA supports windows (alerts, login) and html dialogs, popup windows, mouse input simulation, file downloads, frames (cross domain) and more. SWEA can test scripts can be used in NUnit and Visual Studio unit tests.

  6. Back to top

    Re: AJAX functional Testing

    Sep 4, 2008 12:53 PM by meenakshi ghosh

    Can anyone let me know how to capture a piece of data that is created randomly in a test flow using selenium HTML scripts?

    I need to know what command we can use to capture that random data generated in a page. Also I need to store the data and pass as a string in some other page.

    Can anyone throw some lights on this one?

  7. Back to top

    Good Article

    Apr 1, 2009 7:31 AM by jessica winslet

    I am trying to see if Selenium is good for testing my applicaton or not. Am using the Selenium Ide. I want to know where the core files are installed along with
    meilleur site de jeux de casino the IDE? I need to change the sample files where?

  8. Back to top

    Re: Good Article

    Oct 20, 2009 3:03 PM by Victor Hugo Saavedra

    Excelent.

    I don't know de waitForXXX, but i can't know the end httpRequest de ajax???


    sorry by my english, I speak and write only spanish, I am from Chile
    --
    Atte.
    Victor Hugo Saavedra.
    vhspiceros.blogspot.com

Educational Content

Brian Marick on 4 Challenges and 5 Guiding Values of Agile Software Development

Brian Marick takes us through a quick tour of the most important values and challenges to adopting Agile successfully (they aren't the typical challenges and values we hear in the community).

Are You a Software Architect?

The line between development and architecture is tricky. Does it exist at all? Is an ivory tower actually needed? There's a balance in the middle, but how do you move from developer to architect?

Agile – A Way of Life and Pragmatic Use of Authority

The word 'authority' sometimes produces an allergic response in hard-line agilists. Freedom and authority – both are bad if misused and both are good if used in right spirit for a noble cause.

Getting Started with Grails, Second Edition

"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, and Taco Bell are all using Grails. Are you ready to get started as well?

Using ITIL V3 as a Foundation for SOA Governance

Those familiar with only ITIL V2 often scoff at the thought that ITIL could serve as a governance framework for SOA. With ITIL V3, the focus of the framework shifted towards service-orientation.

Adrian Colyer on AspectJ, tc Server and dm Server

SpringSource CTO Adrian Colyer discusses AspectJ, SpringSource's dm Server and tc Server products, OSGi and Scrum.

Adam Wiggins on Heroku

Heroku's Adam Wiggins talks about Rails, Background Jobs, Add-Ons, Ruby, and how Heroku manages to work around Ruby's inefficiencies using Erlang and other languages.

SOA as an Architectural Pattern: Best Practices in Software Architecture

For Grady Booch the foundation of a good architecture is patterns, SOA being just one of many patterns. In this Second Life presentation, Booch attempts to bring more clarity on what architecture is.