Tuesday, November 4th, 2008

Testing Ext Applications With Selenium

Category: Sencha, Testing

Darrell Meyer has written a detail article on testing Ext applications, both Ext JS and GXT versions:

Both Ext JS and Ext GWT applications can benefit from Selenium tests. In fact, with few exceptions, the tests created for one product should be interchangeable as both products produce the same DOM structure.

With GXT applications, GWT provides built in JUnit support. This provides a great way to test your application. However, these tests run only in host mode. Being able to test your compiled application in multiple browsers is important as some issues only appear within your compiled application.

In general, you create Selenium tests and then execute them in a variety of ways. This tutorial will demonstrate creating tests with Selenium IDE, a Firefox plugin, and creating tests within Java. Tests will be loaded and executed within the Selenium IDE, and Java JUnit tests will be executed using Selenium Remote Control.

Darrell walks through Selenium IDE and shows creating a test, and then Selenium Remote Control, which runs tests in the various browsers:

Selenium IDE provides a great way to create your tests and execute them in Firefox. Tests can only be run by manually opening Firefox and executing tests. What if you want to run you want to automate your tests and run them in other browsers? This is where Selenium Remote Control comes into play.

From the Selenium website: “Selenium Remote Control (RC) is a test tool that allows you to write automated web application UI tests in any programming language against any HTTP website using any mainstream JavaScript-enabled browser. Selenium RC comes in two parts. 1. A server which automatically launches and kills browsers, and acts as a HTTP proxy for web requests from them. 2. Client libraries for your favorite computer language.”

Posted by Dion Almaer at 7:15 am

4.3 rating from 64 votes


Comments feed TrackBack URI

Just a note about the above quoted text from the article (already posted as a comment to the original article on the Ext JS blog): GWT test cases can be run in “web mode” (compiled code) in any browser (eventually several browsers simultaneously, and eventually using Selenium RC to launch the browsers); though GWT/JUnit integration is all about unit-testing, not UI-testing.

Comment by tbroyer — November 4, 2008

Thanks for pointing that out, Thomas. I want to add that in 1.5 you actually can already launch remote tests using selenium (just use the -Dgwt.args=”-selenium host:port/*browser” vm option when launching the test). This makes it a lot easier to test multiple browsers.

I also want to add that while Selenium is great for end-to-end functional tests of your UI, you can use the JUnit framework to test many things more easily, because your Java code usually already has references to the things you want to test (as opposed to having to do lots of XPath tricks).

Comment by jgw — November 4, 2008

Thanks guys for your comments and information, it is very helpful. I think both Selenium and GWT JUnit tests complement each other (unit tests vs. integration tests) and can provide betting testing coverage for when combined.

Comment by darrellmeyer — November 4, 2008

I just wrote an article on how we’ve been testing an ExtJS UI in Java at:


Primarily, it describes how we got around having to assign hand-crafted IDs to all the Ext components and how we synchronise the tests with AJAX.

hope it helps somebody,

Comment by neocoder — March 4, 2009

Leave a comment

You must be logged in to post a comment.