Can we run Selenium WebDriver Test case with IIS, instead of Visual Studio Development server


I am working with Selenium 2 WebDriver. Instead of UnitTest project, i initiate it from website because of following reasons:

  1. It should automatically run every 24 hours. I have written some scheduling code using System.Threading.
  2. Provide some UI to customer to run it intermediately when they require.
  3. At every run an email would be sent as a part of test result.

My target site is:

I have created a Class which has all the Selenium Code. I call that Class using System.Threading upon page load of default.aspx.

It works fine when i run default.aspx from visual studio by pressing F5 OR Ctrl+F5 i.e. with Visual Studio development server e.g. http://localhost:3251/default.aspx.

But, when i try to run it directly from IIS, with default port (80) e.g. http://localhost/seleniumTest/default.aspx, then it fails with following observation/error:

  1. It runs the Selenium code to an extend, but doesn’t show the broswer.
  2. It fails after some steps with No response from server for url http://localhost:7094/hub/session/4bbe4b0c-aeee-4fa3-8bc0-aae47c6869af/element

It is possible what i am trying to achieve.

FYI: Let me know if further details are required.

  • You must to post comments

I have managed to find the solution myself.

Basically, RemoteWebDriver has to be used instead of FirefoxDriver.

  1. Change the initialization of FirefoxDriver to RemoteWebDriver as:

Change from

IWebDriver driver = new FirefoxDriver();


DesiredCapabilities capability = DesiredCapabilities.Firefox();
Uri url = new Uri("http://REMOTE_IP:4545/wd/hub");
IWebDriver driver = new RemoteWebDriver(url, capability);

2. Download Selenium Standalone server and initiate it via command prompt using ~

java -jar E:\Software\selenium-server-standalone-2.24.1.jar -interactive -port 4545

This approach has 2 benefits:

  1. One could use the local IIS for running the test.
  2. Test could be run remotely. Refer Selenium RC documentation. One could see the screenshots remotely using


I am thinking to modify the code of hub.html and client.js file used within it to provide a better Remote feel.

I hope this can be useful for others as well.


  1. IP address REMOTE_IP could be changed to any realtime IP address OR localhost. Use the above mentioned port while initiating the page request.
  2. Start/Stop code of Standalone Server could be fitted inside the test, so that it is automatically started/stopped via batch file.
  3. Keep the server running by not closing the command prompt.
  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.