Wednesday, 25 January 2012

Automated System/Functional/UI Testing

What tools could we use to create automated system tests using C# code? Or sometimes to record/replay UI activity?

Note: these are just my findings so far, they may change...

WatiN:
  • Free
  • Using which you can write C# test code and interact with the UI elements; entering text, clicking, etc.
  • Very easy to use for a C# Developer within Visual Studio.
  • Multibrowser support including IE.
  • Has no IDE.
  • Packaged with Nugget.
  • No native xpath support unlike Selenium.
  • Doesn't support record/replay natively; however, you could try using WatiN Test Recorder to record and replay your site by IE 6.0! Therefore, Selenium is better in this sense.
  • Unlike Selenium, it automatically waits for the page to finish loading, and can detect when it's finished loading.
Selenium WebDriver:
  • Free
  • Download the Selenium WebDriver from NuGet: http://www.nuget.org/packages/Selenium.WebDriver
  • You can write C# code and interact with the UI elements.
  • Built-in CSS selectors/XPath support
  • You can record/replay.
  • Supported browsers and programming languages are very limited.
  • The Selenium IDE only works with FireFox and unfortunately IE, Safari and Opera are not supported currently. The Selenium IDE is just a FireFox plugin, not an independent IDE.
  • Much more complex to learn than WatiN. So, you can't record and replay using IE.
  • It has various tools (Selenium IDE, RC, Grid, Web Driver)
  • More popular than Sahi.
  • Ajax support.
  • Selenium Documentation
  • It doesn't know when the page is loaded, unlike WatiN, which makes it  a bit annoying. There is a workaround and I'll post it here when I find few minutes.
  • It doesn't work well with iframes unlike WatiN but you can still navigate to an Iframe within another page and get elements of that iframe.
Sahi:
Visual Studio Ultimate/Premium Edition:

LoadUI/SoapUI
  • Allows load testing functional behaviour and measure performance.
  • Allows us to record and replay user activity on the page
JMeter:
  • Good for load and performance testing

1 comments:

V. Narayan Raman said...

Sahi has excellent documentation! Both online http://sahi.co.in/w/using-sahi and as a downloadable pdf http://sahi.co.in/w/file_download/3/Sahi.pdf
The real awesomeness of Sahi is in its ability to handle AJAX without waits and smart object identification mechanisms which do not use XPaths.