开发者

"Watin + Gallio + IE" performs badly?

开发者 https://www.devze.com 2023-02-25 16:05 出处:网络
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

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

  1. You are using any specific browser/test runner that makes watin tests run fast
  2. You are following any specific design pattern that enables running watin tests in parallel
  3. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消