views:

171

answers:

2

Similar to htmlunit, but for use with C#. I've seen that you can use htmlunit with .NET via IKVM, but I'd like a native solution if at all possible.

The aim is to add UI tests to our existing (xUnit.net) tests being run on the CI server. I'd like to be able to run UI tests in memory (since I don't want to be opening browser instances on a machine I have no control over), without any dependencies on other machines (as would needed if I used Selenium RC, for example).

Does anyone know of a way to achieve this?

UPDATE: Selenium 2 now provides HtmlUnit as one of its supported browsers. Anybody that wants to use HtmlUnit without going via IKVM should have a look at Selenium 2 instead. I've updated my answer below to reflect this.

A: 

Perhaps WatiN can help?

The framework is not headless because it still uses an IE browser object (with FF in development). However these browser objects should all be created in-process, meaning they will be cleaned up when the CI build process completes, especially if the CI build process spawns a separate process such as NAnt to actually run the unit-tests.

Mark Glasgow
Thanks for the suggestion, but I'd rather try to find a headless solution if I can.
BenA
A: 

After experimenting with a couple of frameworks, it seems that using Selenium RC is the best available solution. Despite wanting a solution that does not depend on external machines, it feels like gaining the ability to run tests on multiple versions of the same browser is a worthwhile trade off.

UPDATE: headless test execution for .NET is now also possible using Selenium 2. The new codebase (having merged with WebDriver) provides HtmlUnit as one of its supported browsers.

BenA