Cool Functional Testing with Selenium

I came across a superb testing application called Selenium. You can even use it in the form of a Firefox Add-on. Basically it allows you to record (as you would a macro) functional tests.

For example, you could open the add-on via Tools > Selenium IDE, click record, then navigate to your web application (or anyone elses for that matter), log in, and try submitting a form. Go back to the Selenium IDE, and you will see a list of the commands you just performed, and you can check for certain results. So if you submit a form and don't fill in the required fields, you can check that it returns some text saying "failed". It is capable of much much more, including testing Ajax results etc.

Definitely worth a play!

dfitzgibbon on November 14, 2006 - 1:26pm. dfitzgibbon's blog
Submitted by Geoff Campos on November 14, 2006 - 1:40pm.

I tried this out a while ago but it didn't seem to work properly i.e. gave me a couple of incorrect results which scared me off. I'll give it another go.

Submitted by dfitzgibbon on November 14, 2006 - 3:06pm.

I had a few problems at first where I couldn't get assertTextPresent to act correctly, then I realised I needed to put the search text in the "Target" field, and it now works correctly. I think it'd be useful for PM's for writing test plans ;-)

Submitted by Ian J Cottee on November 14, 2006 - 4:01pm.

Does it record what you are doing into XML files that you can pass through? If not, how is the 'test script' recorded?

Submitted by dfitzgibbon on November 15, 2006 - 9:10am.

You can save it as a HTML file, which puts the test script in a normal HTML table. This can then be loaded and used again.

Submitted by Ian J Cottee on November 14, 2006 - 9:09pm.

By sheer coincidence I just ran into this http://www.openqa.org/selenium-on-rails/

 

Submitted by jbreckon on November 16, 2006 - 6:26pm.

Ian did demo to me and i like the look of this, pls keep in your mind that we could use these 'tests' to SHOW to the clients how the system is working and how it can work.

 

But having said all of that, please please keep on track of making sure our unit tests are done and have hardcopied results.

 

Equally I think PMs learning how to use this technology will be grand.

 

I guess my message is that I want the team to use the tools available not just the more technically gifted!!!

 

 

Submitted by Ian J Cottee on November 21, 2006 - 1:24pm.

BTW - it was watir (the ruby scripted/ie only one) that I showed you. 

Submitted by Geoff Campos on November 20, 2006 - 3:47pm.

Sure enough, it's spewing errors and I don't know if it's a problem with the app or the plugin. I get '[error] Element link=Maintenance not found' when playing back a recorded sequence of basic steps. Grrr.