Functional test software/framework that covers Asp.Net Web Apps? - asp.net-mvc

I recently began to use the NexusLight, a functional test automation framework.
Are there more frameworks that does a similar job?
Related question: End-to-End application testing from a users standpoint

I haven't really looked into NexusLight but I think InCisif.net is supposed to provide a functional test framework as well. You could look into it.

I test asp.net web apps for years and the only tool I use is Watir.

VSTT 2010 should be a good bet if you are looking for functional test automation. Web Services Testing, UI testing, Biztalk testing and Data Driven Testing Support. Please look at VSTT - http://msdn.microsoft.com/en-us/library/ee338734(v=vs.90).aspx
You can also try VSTT - http://blogs.msdn.com/b/slumley/archive/2009/05/28/vsts-2010-feature-enhancements-for-web-test-playback-ui.aspx
Telerik Test Tools - http://www.telerik.com/automated-testing-tools.aspx
Visual Studio UI Test Extensibility–Scenarios & Guiding Principles - http://blogs.msdn.com/b/mathew_aniyan/archive/2011/03/28/visual-studio-ui-test-extensibility-scenarios-amp-guiding-principles.aspx
VSTS Web Test Step-by-Step Primer - http://blogs.msdn.com/b/jimmymay/archive/2009/02/23/vsts-web-test-step-by-step-primer-7-minute-video-by-microsoft-a-c-e-performance-engineer-chris-lundquist-with-copious-notes-screen-shots-from-your-humble-correspondent.aspx

Found this one too:
http://www.automatedqa.com/products/testcomplete/index.asp
Unfortunately it's not free.

Reading a list made by Scott Hanselman, I found these two tools:
WatiN, to automated the tests;
WatiN Test Recorder, to automate the test code generation.
From WatiN page:
[...]WatiN (pronounced as What-in) website. Inspired by Watir development of WatiN started in December 2005 to make a similar kind of Web Application Testing possible for the .Net languages.
And from WatiN Test Recorder:
The purpose of the application is to generate code compatible with the WatiN (Web Application Testing In .NET) project.

Have a look at Seleno. It uses Selenium under the bonnet but abstracts all browser automation into Page Objects, which lead to well structured and fluid C# based tests.
It is particularly well suited to ASP.NET MVC, as each Page Object can be strongly typed (using Generics) to an equivalent MVC ViewModel, leading to a consistent relationship between View, ViewModel and Page Object.
Check out some of the samples in the Seleno codebase to see this in action.

Related

How to do ASP.NET MVC Integration testing using selenium

I need to know is it possible to perform integration testing using selenium for ASP.NET MVC applications. If yes then What are the requirements and how to do it. Will it be an external application to test from UI or should I be using views. Really confused. Please guide
If you are planning to write the Selenium tests using C#, which I'd recommend over using any kind of test recorder, then this will be a separate project.
You will run this and it will test a deployed version of your application, ideally in a dedicated test environment. There is extensive documentation available.
Personally I and others prefer WatiN for testing web applications using C# written tests.
Selenium can be used for testing any web applications include ASP.NET MVC. In general, you add test project to solution and write tests in it. Selenium open browser and execute commands that is described in your test. You can write test in c# or can use recorder and save record as c# test.

What tools are available for calculating code coverage using browser automation tests

I have a website written in ASP.NET MVC 3. I have put together some browser automation tests that target this website. I want to use this same set of tests to calculate the code coverage of the website code.
I know that NCover does this kind of work but based on my knowledge there are two issues. One, NCover gives code coverage figures for both framework's code and my code. Two, it's costly.
NCover has filters that you can use to ignore the framework code.
You could also use OpenCover or PartCover to get these metrics and they are both open source and free - they also have filters.
Hooking them into IIS is tricky but if it is for automation tests then you can run your tests against IIS express - much easier.

Is Visual Studio 2010 Express for MVC development?

I'm a little behind the curve and want to do my first serious ASP.NET MVC project.
Are there any significant limitations or drawbacks in using VS 2010 Express for asp.net mvc development?
No there are no limitations. Feel free to use the VS2010 Express version for ASP.NET MVC development. The only thing is that you cannot use the MS Test framework for unit tests and you have to go for something like NUnit which is not necessary a bad thing :-) It's just that you would probably get a little less integration into the IDE with things like Unit Tests, Code Coverage, ... you will have to use third party tools.
There's just one thing to consider and which is of utmost importance before starting a big project: is the time your developers spend on configuring third party tools cheaper than the paid versions of VS2010? In other words how much is your developers time worth? See point 9 of Joel's test.
One disadvantage is that VS Express doesn't support extensions. I use ankhsvn for version control, which can't be used in VS express. However, why don't you just start with Express? You can always switch to a paid version in case you really need it.
The express editions don't support the StartAction for Start External Program should you need it. See MSDN How to: Change the Start Action for Application Debugging.
I've not found an alternative for that case.
Update: Try http://www2.wealth-lab.com/Wiki/kbDebugExpress.ashx step 13 for a suggestion on making MSVC think its debugging your code directly. - Untried.

SpecFlow / BDD Examples

Just looking for some examples of BDD/SpecFlow - ideally a projectб so I can see how to use SpecFlow on big projects where multiple features my reference the same steps etc.
I've read a few blogs over the last few months, but haven't had a nice, juicy project of someone else's to mooch around through.
The official example set of SpecFlow can be found on github: http://github.com/techtalk/SpecFlow-Examples
The ASP.NET-MVC/BookShop sample is the one that you can have a look. It is not a very big project though. (If you a need VS2010 sample, switch to the VS2010 branch.)
Another great place to find examples are from the tests for the SpecFlow project itself.
In particular those used to test the Gherkin parsing: https://github.com/techtalk/SpecFlow/tree/master/Tests/TechTalk.SpecFlow.Specs/Features
Those tests show a lot of ways to write scenarios using syntax for mutliline parameters, table parameters, templates, and more.
Also check out Steve Sanderson's GuestbookDemo, which shows off how to use SpecFlow with WatiN in ASP.NET MVC.
Also, see Brandon Satrom's recent MSDN article on the topic: http://msdn.microsoft.com/en-us/magazine/gg490346.aspx
We have used SpecFlow to formulate scenarios on the CQRS Journey project. Check out the overview of how we did it and then take a look at the acceptance tests themselves in the code repo.
I know it is an answered question. Just in case some one needs a quick simple web test project skeleton. I have created a nuget package SeleniumNUnitSpecflow for quickly setting up Specflow with Nunit and Selenium.
PM> Install-Package SeleniumNUnitSpecflow
Details: Web page BDD test with selenium specflow nunit

ASP.NET MVC Unit Test

I'd like to try unit test in ASP.NET MVC framework. But I don't know which unit test framework I have to choose.
NUnit, xUnit.net, MbUnit. or the unit test framework included with Visual Studio, which one is better?
If you are interested in following BDD guidelines, I highly recommend xUnit.NET with Moq as the mocking framework. The two are some of the most forward looking and modern unit testing frameworks available these days, and combined they make both a powerful and flexible unit testing platform. xUnit.NET is extremely extensible as its Fact and Trait attributes can be extended with your own attributes, and the testing frameworks behavior can be changed to suit your needs.
A great example of this flexibility is the ObservationAttribute and supporting framework to allow BDD style testing with xunit.net, found here:
http://iridescence.no/post/Extending-xUnit-with-a-Custom-ObservationAttribute-for-BDD-Style-Testing.aspx
I use the above BDD-style testing to create Test-Class-Per-Unit style BDD tests for my ASP.NET MVC controllers (well, and everything else I unit test, too.)
ASP.Net MVC doesn't make any specific demands of a framework, any will work just fine. NUnit is the most widely used, and for that reason it is my default choice.
Once you get into unit testing, some of the other frameworks offer different advanced features that you may like to check out.
I don't know anyone using the MS unit testing framework.
I would recommend to start from xUnit if your have not used any testing framework before. It's hard to decide which framework is better but I think that xUnit is the "most modern" among NUnit, MbUnit and MSTest. Start learning xUnit from this article and then this
I am using MSTest :) so now you know one ;)
Seriously, I think that MSTest is a the best framework for the start with TDD.
It is liteweight and it is generating all that you need for the wrapup and the most important thing, it is integrated in the visual studio...so, why don't you start with mstest and later on you can switch to advanced frameworks with no problems.
So in short, I would recomend a MSTest.
cheers

Resources