Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to test webforms apps ( ASP.NET )

What is the best way to test my webforms applications?

Looks like people are loving Watin, and selenium.

like image 644
Brian G Avatar asked Sep 23 '08 01:09

Brian G


People also ask

Is webforms outdated?

ASP.NET Web Forms is no longer an option for new development. It's shunned but not dead — supported as a legacy product, but finally exiled from the future of . NET.

How do I test .NET applications?

ASP.Net can add Unit Testing for applications. To test an application, you need to add a Unit Test project to the ASP.Net solution. All tests can be made to run in Visual Studio. A test explorer will show the results of all of the tests.

How do I test an app in Visual Studio?

On the Visual Studio Start window, choose Create a new project. On the Create a new project page, enter unit test in the Search box. The template list filters to unit testing projects. Select the Unit Test App (Universal Windows) template for either C# or Visual Basic, and then select Next.


2 Answers

Just wondering, why would you call WatiN a unit testing tool? Last time I checked, it ran integration tests.

The best way would be to move all code that doesn't depend on HttpContext to a separate assembly and run unit tests as usual. The rest can be tested with Ivonna. She doesn't test the client behavior, that's where WatiN can be helpful; however, if you want to test your pages or controls in isolation, she's your only choice.

like image 197
ulu Avatar answered Oct 08 '22 03:10

ulu


UPDATE: Given WatiN has been stagnant for over a year now, I would direct anyone that needs web ui tests towards selenium, it is in continuous use & development by many contributors, and is actively used by Google.

WatiN is the best that I've found. It integrates into Visual Studio unit testing or nunit & you can do pretty much anything you need in the browser (click links, submit forms, look for text/images, etc.)

See the following questions for similar answers:

  • What is the best way to do unit testing for ASP web pages (C#)?
  • Web Application Testing for .Net (watin Test Recorder)
  • How do you programmatically fill in a form and ‘POST’ a web page?
like image 26
Glenn Slaven Avatar answered Oct 08 '22 02:10

Glenn Slaven