Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

automated functional web GUI testing frameworks (asp.net)

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.

like image 270
Ricky Gummadi Avatar asked Apr 18 '26 23:04

Ricky Gummadi


2 Answers

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.

like image 183
GarethOwen Avatar answered Apr 20 '26 12:04

GarethOwen


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/

like image 33
Paul Harris Avatar answered Apr 20 '26 13:04

Paul Harris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!