Java Chatter and Random Nagging

Wednesday, June 20, 2007

Selenium and Echo2 : No good !

Selenium is a test tool for web applications that runs directly in a browser. At my dayjob, they use it with some succes in combination with JSF, thus it seemed only fair to me to use it for testing the webinterface of my petproject (which is created using Echo2). Trying it is easy, simply download the Selenium IDE as a plugin in firefox and start recording.

This is already where it went wrong for me. Selenium needs fixed id's from components to execute its actions on it. Echo2 generates its own id's, outside control of the user. This wouldn't be too much of a probem, however the id's vary between user sessions, thus making Selenium unusable in combination with Echo2. (An Echo-Component does have setId() functionality, but this is only for internal Echo use, lookups and stuff).

Labels: , ,


At 1:05 am, Anonymous Jason Huggins said...

You don't have to use ids. You can use name, label, css locators, javascript (dom) expressions or xpath expressions, too. See the "Element Locator" section here:

Either way, try to find a non-brittle way to find the elements (regardless of locator style). This will take some experimentation based on how and where your UI is changing during development.

Jason Huggins
Selenium Project


Post a Comment

<< Home