Friday, 28 November 2014

Selenium Testing with SauceLabs, NUnit and Saucery

Welcome to the next installment of JenkinsHeaven,

I've written previously on how to install the Jenkins Selenium plugin to turn your Jenkins into a SeleniumGrid installation.

This is certainly how we used to do it a few years ago.  That approach requires you to maintain VM infrastructure to have machines running the various versions and type of browsers.  With so many target platforms available and required these days this gets unmanageable quickly.  Not practical.

The solution to achieving cross-browser AND cross-platform testing is to go convince your manager to invest in a SauceLabs testing account.

SauceLabs provides a SeleniumGrid in the cloud and has literally hundreds of platforms available in pristine (on a per test basis) VMs.  With a SauceLabs account you can test your application across all these platforms.

Go do that now and I'll wait...

...ok, you're back? I trust you successfully convinced them of the considerable value to be added.

With a Saucelabs account, cross-browser testing is achievable.

Now with all these available platforms, your next step will probably be to agree with your manager what the corporate-defined list of supported platforms will be.  What platforms will you need to test against? What platforms will the organisation support?  These questions will be answered jointly by the IT department and key stakeholders from the business.

Why don't you do that now and I'll go get a coffee...

...Ok, what did you come up with?

The team at Full Circle Solutions has been through this process on a few occasions already and we know you can easily come up with 50-75 platforms without breaking a sweat by the time you include a few popular desktop browsers and some Apple and Android mobile platforms. As with NUnit Parameterised tests, the combinations blow out quickly.

With this shiny new mandate in hand and the blessing of your manager. all you have to do is request this set of desired platforms as part of your test [Setup] method before each test.

How to do this?

You could google it...

You could even trawl through SauceLabs documentation...

What you will quickly realise however is that targeting your newly agreed on set of platforms in a holistic, non-piecemeal manner isn't easy.

Saucery For NUnit knows all the rules to request platforms correctly so you don't have to.  Saucery For NUnit allows your team to focus on writing your test cases so you can deliver code coverage to the business faster.

The How To page explains the detail of integrating the NuGet package into your test suites.  Make sure you upgrade to the latest version and purchase an activation key.

Having just invested a couple of thousand dollars to get a SauceLabs account, only $99 invested in Saucery for NUnit to unlock SauceLabs and solve the DesiredCapability problem is well worth it and will pay you back in spades.

Till next time...

No comments:

Post a Comment