views:

15

answers:

1

I'd like to have a configuration where my build server runs a NUnit test that opens and drives a browser on a remote machine. What would be the best way to accomplish this?

It was easy to do in Selenium 1, because the java proxy server sat between your tests and the browser. In Selenium 2, your tests communicate directory with the browser (at least in IE).

Is there a good way to do this? Possibly with a WCF service or something?

A: 

You need to get the Standalone Selenium Server (current is selenium-server-standalone-2.0a6.jar) from http://code.google.com/p/selenium/. Then start is with the command line on the remote machine (you need Java installed there):

java -jar selenium-server-standalone-2.0a6.jar

Also there's a .NET implementation of the server, but its version is behind the Java one

Then you should use the RemoteWebDriver:

IWebDriver driver = new RemoteWebDriver(new Uri("http://127.0.0.1:4444/wd/hub"),DesiredCapabilities.InternetExplorer());

And then use the driver as you do in your "local" tests

More info:

http://code.google.com/p/selenium/wiki/RemoteWebDriver

http://www.google.com/codesearch/p?hl=en#CJyJMZi8hYc/trunk/remote/client/src/csharp/webdriver-remote/RemoteWebDriver.cs

http://code.google.com/p/selenium/wiki/RemoteWebDriverServer

ZloiAdun