Tuesday, 17 January 2012

How to debug selenium / webdriver tests live

I don't really remember where have I found that, yet I guess it would be nice to have the quick reference here.
What I have are:
  • Visual Studio 2010 Pro
  • hub + webdriver started
  • NUnit based tests
What I need is:
  • start a test execution both in debug or normal mode directly from Visual Studio
  • an ability to use breakpoints, watchers etc

As a solution, we just need to convert NUnit tests into MS Unit Tests, thus you may start them in debug or normal mode. NUnitforVS is the tool which actually does that. Once you've got it installed, open a ms tests' view (you should get the list of NUnit tests there) and enjoy debug.
You would ask why I called it "live debug"? If I follow each call of test's code step by step , changes are immediately reflected at a browser's window. That's real magic.

No comments:

Post a Comment