views:

38

answers:

1

My situation is this: I have an ASP.NET web application that I want to implement tests for. When I initially tried WatiN, I was able to get the Google search example working, and a small test for one of the pages of the web application. But once I added the WatiN assemblies to a shelveset so a co-worker could try out my tests, WatiN stopped working on my machine.

Instead of successfully running tests, I get exceptions like this one:

WatiN.Core.Exceptions.WatiNException: Element wasn't available within 30 seconds.

The only thing WatiN seems to do right now is launch the browser with the URLs I've hard-coded. Any suggestions on what to do in order to get this working with .NET Framework 4.0 again would be greatly appreciated.

+1  A: 

Working on Framwework 4.0 or else doesn't really change anything, at the end of the day WatiN works with the UI no matter what language you're building your page with..

Yet, if your page performance is a bit slow, or your forms have lots of controls (that's pretty usual), WatiN usually becomes a bit slow in doing thing, so you need to set the timeout to more than 30 sec.

I guess you need check/use methods that wait, for eg ie.WaitUntilContainsText("text", timeOut) & other methods that set its timeout..

btw I just ran also into a similar question here, you might wat to check it

http://stackoverflow.com/questions/923629/timeout-problem-running-watin-tests-as-part-of-tfs-build

Shady M. Najib