MathJax

SyntaxHighlighter

Highlight

Custom CSS

Friday, September 8, 2006

Gotchas with Selenium WAT Framework

Lately, I've been doing some research on WAT frameworks such as Selenium. You can use Selenium to record or script automated tests that will be executed directly in the browser of your choice. Note that Selenium IDE only works with Firefox (as it's a Firefox extension), and that Selenium RC works with most browsers but does not support the HTTPS protocol.

The reason for this is that Selenium RC must inject some HTML and Javascript into your site for it to do its testing work. Rather than including the Selenium Core HTML and Javascript in each page you want tested, Selenium RC runs a proxy server you access, and this proxy server injects the code on each request. You need the client libraries (included in the Selenium RC jars) if you want to write test cases. The side effect is that if the proxy server doesn't support HTTPS, you are out of luck. As of the version I tested (0.8.1), this seems to be the case.

Also, if you happen to write form submission HTML like so, with an empty string as the action (so the page posts to the same URL, a common pattern), your acceptance tests will fail:

<form name="myForm" method="post" action="${action}">...</form>

Instead, you must give the absolute URL for Selenium RC to be able to post properly. Don't ask me why =P
Post a Comment