With the impressive growth of web services and the inter-connectivity that this implies, it is very common that web applications and websites include APIs that offer XML output, like SOAP, XML-RPC and REST. Symfony itself is a great framework to create APIs that generate different types of output, but Zend Framework and most other frameworks also offer these possibilities.

Selenium IDE has become a standard to automate testing of web applications, if you are not using it, wait no more!

It can also be used to test APIs. How?

Well, there is a kind of patch to it that adds the ability to assert the presence of an XML node and its value. Download and check out the example.

So, after you downloaded the attachment, append the content or create a new file user-extensions.js and place it somewhere of your preference. Then go to Firefox, open Selenium IDE in Tools, then go to Options and browse the location of your file user-extensions.js

Make sure you restart Selenium IDE so it picks up the changes. Once you restarted it, you will see the action assertTextPresentXML.

I am not sure why this has not been added to the main distribution, but it is one of the features that we most use.

In a future post, I will explain step by step how to use it.