Load Testing with Selenium and Neustar

It’s not often I find something that is both really useful and quick to pick up and use but selenium and neustar combined make it really easy to load test your website.

As referred to in a previous post, we had a problem with a site at work, which suggested that database connections weren’t being closed properly. I needed something to load test the website. This kind of testing wasn’t something I had done. So I apprehensively googled around expecting long setups and arduous learning curves just to get some kind of load testing to work.

I found Selenium (IDE) and Neustar (formerly browsermob) first through a post from eventuallyconsistent.net. So I downloaded Selenium through Firefox and started working with it straight away thanks to the easy to use interface. Basically Selenium (IDE) launches from the Tools menu whilst in Firefox and automatically records all interactions with the browser. You can save these as a script and run them again. This means you can replicate bugs and then syndicate the script so there are no awkward conversations about explaining which button you are trying to get the other person to click to see the error.

Using Selenium, I generated a test script which we thought was generating too many connections, then tested a number of times whilst monitoring connections. Though there was a slight increase, there was nothing of note.

On top of replicating errors and general testing of the site you can do load testing through Neustar.

So after having a chat session with someone at Neustar, I decided to have a go at a free trial, to see if load testing showed up any potential problems with the site in terms of connections and/or problems which we may not have considered. To register you just need to supply the URL to test and your details

You have a number of options available once you login. To the bottom of the screen you can see Monitors and Load Tests. A default monitor has already been created which basically checks your website is up every 15 minutes (TBC). Clicking on New Load Test gives you a form to do exactly that. After naming and describing the load test, you can add how many users you want to emulate and how the load is managed in the Phase sections. Underneath the Regions section is a script upload control. This is where you upload your Selenium script. A couple of things you should do before you upload the script after a few issues on my part:

  1. Check that it works by running it in Firefox(!)
  2. Make a note of exactly what script it is as you may want to use the same script but under a different load test and its difficult/impossible to identify your script once its uploaded.i.e. it doesn’t show the original file name.

As you fill in the form, Neustar gives you a cost against your initial free $10 in the Cost breakdown section. You also have the option to schedule now or at a defined time. Obviously you can buy more credit for these load tests.

Once the load test is saved, you can monitor it in real-time. and analyze the results afterwards . It gives a MySql dump of all the data, which I haven’t used but imagine would be handy. For me I just wanted to see if the site held up and the database connections weren’t rising too much. Thankfully they didn’t.

So in short I would heartily recommend these two products mainly for the ease of use but also the ability to quickly set up test cases and load tests and get useful data from them.

Advertisements

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 )

Google+ photo

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

Connecting to %s