I am having around 300 Watin tests and I run them in IE using Gallio test runner. These tests take around three and half hours to run completely. I was wondering if everyone here sees the same kind of performance with Watin or I'm doing something terribly wrong. In this regard I would like to know if
- You are using any specific browser/test runner that makes watin tests run fast
- You are following any specific design pattern that enables running watin tests in parallel
- You are following any design pattern that allows me to run multiple tests in the same browser instance so that I do not have开发者_开发知识库 to close and open the browser after every test
I don't know about running them in parallel, but you can certainly re-use the same browser instance, you just need a static reference to it. I'm using MSpec so the code is a bit different, but if you just have a static class containing the browser reference or similar, that should sort it.
The author also wrote a blog about it, but this method is much more complex than anything I've had to do: http://watinandmore.blogspot.com/2009/03/reusing-ie-instance-in-vs-test.html
Another think to check is that you're not 'typing' text unless you need to. For example this:
browser.TextField(Find.ByName("q")).TypeText("WatiN");
Takes much longer than this:
browser.TextField(Find.ByName("q")).Value = "WatiN";
Because in the first line, it types each character individually. You may need to do this to check your JavaScript, but often you don't.
精彩评论