Messing with Selenium and Watir

Wow… long time since I posted. We have an application that is getting ready to go live for the customers of my customers and I wanted to do some load testing of the solution. The application was written by a contracting firm and was written using AJAX and RichFaces. The RichFaces and AJAX part adds complications to the conversation between client and server making it hard for tools to be used for automated activites. This posed a problem for me when I wanted to load test it.

Some Background: We’re going to offer an e-bill presentment application for our local companies’ end customers to use to view their invoices online. As mentioned above, we contracted with a software development firm to write the application for us since we have limited resources and wanted to get this out ASAP. Our contract basically has the contractors handing us WAR files as the deliverable so we have a lot of responsibility to test and assign issues to them. Since we don’t have a server administrator I get to play that role. Being the technical lead of the group who is responsible for the application I wanted to run it through it’s paces on our new Application Server infrastructure to do some load tests.

My tool of choice was JMeter because I have used it before and found it good at cranking up pure traffic to see how the servers would handle it. As a matter of fact, when we deployed our WebSphere Portal cluster close to two years ago we managed to put a hurting on our big-iron ERP system while load testing the cluster using JMeter. I tried using JMeter’s proxy to generate some tests but kept having issues with the login. Not being familiar with the application or RichFaces, I am having issues figuring out how to get JMeter to recognize session indicators and using them rather than sending ‘recorded’ traffic.

For speeds sake, I decided to look into alternative testing methods. I knew if I could do actual ‘click’ testing where it was more of a user gesture recording than pure network traffic recording I’d probably have better luck, at the expense of not being able to generate as much load.

I started with Selenium. It’s super simple and ultimately I bet it will work well. Unfortunately, I had some problems with the login again. If I manually logged in using the browser then ran the Selenium scripts it worked great. That wasn’t an option – how could we load test if a human had to get the login part over? I’m betting I’ll be able to get into the selenium scripts and/or APIs and get it to work well too, but I was in more of a ‘spike’ mode so I wanted to go with multiple options rather than spend a whole lot of time on a single option.

Enter Watir. I dig Watir. I have only toyed with Ruby, but now I can see myself using it regularly, if only for use with Watir. I downloaded the Watir examples and within an hour was ‘load testing’ the application – al least to the degree that one laptop can run Internet Explorer multiple times. I’d love to see something like this that could interpret the DOM without actually having to show the UI, but since I’m not working on a solution for it I’m not going to complain about it.

Since I have a solution using Watir (even if I have to fire it up on 5 or 6 computers simultaneously) I’m going to reverse course and head back to Selenium to see if I can get the login to work. If I can, then I’ll need to get something that’ll allow me to run the scripts in a multithreaded way to do the load part of load testing, but I suspect there’s already something like that for Selenium.

Advertisement
Posted in Agile, code, java, OpenSource, SoftwareDev
One comment on “Messing with Selenium and Watir
  1. Mike,
    You might be interested in looking at my company, BrowserMob (http://browsermob.com). It does exactly what you were trying to do: use real browsers for a load test. Would love to get your thought on it and try it out. Feel free to contact me or our team via the Contact page and we can probably work out a more extended trial if you need it.

    Patrick

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Error: Please make sure the Twitter account is public.

Archives
Categories
Blog Stats
  • 8,170 hits
%d bloggers like this: