Andy Pols Geek, Entrepreneur

Testing Challenge

I've been running several two week "challenge" assignments recently and really enjoyed them.

This week I'm trying to prove to a company that they can automate lots of their 3rd party vendor acceptance tests. They're spending vast sums of money on manual testing - any reduction in this would be a godsend.

The first application is a java web app. That should be easy. It turns out that it's using lots of really strange javascript.

For example, the login form looks like this:

<form id="login" name="login" method="POST"
                 action="security_check">
   <input name="username"/>
   <input name="password" type="password"/>
   <!-- click this to submit! -->
   <a href="#" onclick="submitForm('login',1,{'event':'login'});return false">
      <img src="/some/image/path/login.gif" .../>
   </a>
</form>

The post action security_check simply returns an error saying you can't post!! Why would anyone subvert the standard web form process like that? They have some javascript called from an image link that submits the form. If you don't do things in a standard way you can't test your application using standard tools.

Httpunit could not parse the javascript. If I clicked the link it simply returned to the same page (due to the href="#").

JWebUnit uses Httpunit under the hood, so was not really an option (although I did give it a spin).

Selenium did not work as I could not change the deployed webapp (the selenium javascript needs to be served up from the same server).

Then I discovered the lovely JExplorer library from MIIK. It basically wraps the IE components so you can embed Internet Explorer in a Swing application.

It worked a treat! I can now automate all my acceptance tests using JExplorer.

comments powered by Disqus