views:

255

answers:

9

What's the best way to automate testing the UI in an Asp.net Page?

+4  A: 

Watir or Watin are a great place to start.

More info here

Darren Kopp
+3  A: 

Quite loosely defined question so a good answer is almost impossible. Would dare to suggest that using Selenium might help with automating the task.

Ilya Kochetov
A: 

Not sure about the "best" way, that's probably quite a loaded question...

One way is to use the Web Tests in the Test edition of Visual Studio, see MSDN documentation. Also here's a simple tutorial.

Ola Karlsson
A: 

What specifically are you testing for? Cross browser compliance? Performance? Usability? That's a pretty broad question - can you define it a little more?

Chuck
A: 

In terms of User Acceptance? Bug hunting? Load testing?

For the first one, get other people to use it and comment on it.

For the second one you should use your test plans and test cases that you wrote beforehand to test the UI, in terms of data validation (server-side as well as javascript), range checking and all that stuff. I believe there are tools that simulate clicks as well that you could use.

For the third, try JMeter.

As for testing the engine behind the website, you can bypass the web interface and write test classes that call the engine directly (if it isn't coded directly into the ASP) to test its functions. I would call this a different task to testing the UI however.

JeeBee
A: 

AspUnit which can be found on SourceForge.net. However the project is no longer actively developed but it will work on .Net 1.1 and 2.0.

Dave_H
A: 
  • Setup a room with several terminals running your application
  • Prepare a list of tasks to be completed
  • Bring in volunteers to run through the tasks
  • Monitor the actions of the volunteers either through taping or a one way mirror

Rinse and Repeat!

pdavis
eek the old fashion way!
smaclell
+2  A: 

If you are the only coder on a project, I would suggest testing it by hand. That said, you will likely suffer from coder myopathy. Since you wrote the code and know what it is supposed to do, you may subconsciously avoid actions that will break it.

I have worked with different automation methods and they tend to be fairly heavy. In other words, you will find yourself working on updating your tests more often than you would like. In my opinion, automated testing only becomes necessary when you have more than one developer on a project and they are not aware of the full scope.

In the ideal environment, a developer would have a dedicated tester who would write and maintain tests, as well as validate that the code was functionally correct and met the business requirements.

In the real world, lots of developers are basically lone wolves with limited resources and time and the best way to have solid, bug-free code is to understand the business requirements and then make sure that when writing the code, you make no mistakes. :-)

Timothy Lee Russell
A: 

I vote for Test Manager in Visual Studio 2010 and then generate "Coded UI tests" for it!

  • Very easy to create assertions
  • Very nice code (Readable!)
  • Easy and maintainable, because the code is easy to read and you can change the way how controls are found on the page

I did a quick comparison or WatiN, Selenium and Test Manager VS2010

Peter Gfader