2
votes

we have a mix of ASP.NET webforms and upcoming MVC projects; I am after a reliable and maintainable web GUI testing tools/framework; At the moment we have some Watin tests and seeing that Watin hasn't been actively worked on over over 15 months I am a bit reluctant to invest any more in this or should I?

What are the options and what is the best one to use.

Selenium - Although limited Visual Studio integration seems to be a good one.

Watin - Seems obsolete and doesn't seem to cope well with modern JQuery websites.

Telerik Test Studio - Looks very promising, has any one tried it? is it worth it?

Are there any other viable options for ASP.NET and possible visual studio integration?

I know there is an existing question on this Web testing frameworks for ASP.NET web application but it doesn't really answer anything.

for green fields projects what are people using out there for automated function UI testing.

5
Do you want to run the tests against a number of different browsers?GarethOwen
Ideally yes, but can live with just one or two browsers as long as I can fully functional testRicky G
We use selenium + Nunit. Not much in the way of visual studio integration, but it seems to be a widely used well supported combination and runs all the major browsers.CIGuy

5 Answers

3
votes

We are also researching ways of testing the front end of our web app.

Currently we have some tests that use the headless browser, phantomJS. The tests are written in JavaScript and look like this:

(function () {

   // require is part of phantom API
   var userName,
       page = require('webpage').create();

    page.open("http://<url of page to test>", function (status) {

        if (status !== 'success') {
            phantom.exit(1);
        } else {
            // get the text of the DOM element that displays the user name
            userName = page.evaluate(function() {
                return document.getElementById('userName').innerText;
            });

            if (userName !=== 'Guest') {
                phantom.exit(1);
            }
            phantom.exit();  // Success!
        }
    });

})();

And we call this from Jenkins with a command like this (where assert_Username_EqualsGuest.js contains above JavaScript):

phantomJS.exe assert_Username_EqualsGuest.js 

We also have similar tests written in powerscript, which use the System.Net.WebClient class to download dynamic resources from the web server, assert what comes back, and record the response time for keeping track of the server performance over time. Also fired by Jenkins.

So this answer is just to let you know what we are doing currently, but we are also investigating better ways. And I am very interested to hear what others are doing.

3
votes

What version of Visual Studio are you using? It might be you have one of the top end ones which means you can write test scripts in CodedUI which is relatively nice and would keep the tests in a similar language/toolset that you are used to. http://msdn.microsoft.com/en-us/magazine/hh875174.aspx

If not I would vote selenium with the .net bindings, it really is the most fully featured Web automation tool and you are likely to be able to get help with it the easiest. The following web page tells you how to get selenium to work in visual studio http://www.joecolantonio.com/2012/07/31/getting-started-using-selenium-2-0-webdriver-for-ie-in-visual-studio-c/

2
votes

If you want to test only in IE, you can try IBM Rational Functional Tester. It lacks support for recent Firefox version (only up to 10.6)

From the website you can download a free 30 days trial version. I'v posted about it here https://sqa.stackexchange.com/questions/4995/reviews-feedback-on-rft

Another piece of software is QA Wizard but I do not have direct experience with it.

2
votes

If you are willing to pay, Telerik Test Studio is a very nice product. It's a great tool that works in different browsers. It has a very easy to use recording feature that allows you to point and click within the page and select elements to test. Another tool (paid) is Test Complete, which works very similarly. Check out the videos on both products, which the documentation is pretty good.

The thing about these tools is that they are much hands-off of requiring manual coding, but you can code tests too if the UI can't do what you are looking for.

2
votes

This doesn't really answer your question directly, but you should check out the test pyramid article by Martin Fowler:

The test pyramid is a concept developed by Mike Cohn, described in his book Succeeding with Agile. Its essential point is that you should have many more low-level unit tests than high level end-to-end tests running through a GUI.

On the projects I've worked on, we've implemented unit tests using a variety of test utilities (NUnit, MBUnit, xUnit, etc), service (integration) tests using FitNesse, and left the GUI tests as a manual task (although FitNesse can get fairly close to the presentation layer if required). This has worked well for us.