TeamCity and Selenium 2 WebDriver .exe path?

I am trying to get my Selenium UI Test to run on our company's TeamCity build server. We use C#/VS 12.  

Selenium needs a .exe of the specific web browser to run the test, and I can't seem to get teamcity to pick up the .exe file.  

The Error:

Fail:  Test execution error | The chromedriver.exe file does not exist in the current directory or in a directory on the PATH environment variable. The driver can be downloaded at
In VS, the .exe file needs to have its properties changed so that Copy to Output Directory is set to Copy if newer in order for it to run locally.

I wasn't sure if the .exe file's properties should be changed in VS, if the path had to be set in the TC General Settings, Build Step, or somewhere else.  I also wasn't sure if I had to put the files (ie chromedriver.exe, iedriverserver.exe) on the agent/build server itself and set them as agent parameters.

Hopefully this is a simple problem with an obvious answer I am missing.
Comment actions Permalink

I suppose I didn't paint the full picture with my question, however, I had a TestData folder for csv files.  I tried putting the driver .exe's into each level of my solution and the TestData folder was the winner.  Which is strange because it will not work locally for me from that location, so I need the webdrivers in two locations in my solution.  Or at least that is the way I know how to make it work both locally and on TeamCity.

Comment actions Permalink

Any chance you can post a sample of a working selenium browser test that you can get to run via TC 8.x? I am using the webdriver version as many people say the remote control is not recommended any longer. I just can't get the test to run on the server. Firefox is installed. here is a basic test.

using System;
using System.Text;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;

namespace Deployment.Tests
    public class DoesinvoiceLoadTest
        private IWebDriver driver;
        private StringBuilder verificationErrors;
        private string baseURL;
        private bool acceptNextAlert = true;

        public void SetupTest()
            driver = new FirefoxDriver();
            baseURL = "";

        public void TeardownTest()
            catch (Exception)
                // Ignore errors if unable to close the browser


        public void TheCaseTest()
            // open | / |
            driver.Navigate().GoToUrl(baseURL + "/");
            // click | link=Invoice |
            // type | id=InvoiceNumber | 19337
            // click | id=btnGenerateInvoice |
            // assertText | css=h2 | Lynne Harder
            Assert.AreEqual("Lynne Harder", driver.FindElement(By.CssSelector("h2")).Text);


Comment actions Permalink

If anybody else has above issue.

We were creating a very small app using Visual Studio 2017, in C# with Selenium web driver Firefox and trying to integrate that into TeamCity. This all worked fine locally but when placing it into TeamCity and via the commands "Visual Studio Tests" => "VSTest" => "VSTest2017" I got the below error. 

The HTTP request to the remote WebDriver server for URL http://localhost:51668/session/e9048f87-2470-4346-b9b0-ebc3f2459f2f/element/fd935377-e7d8-4676-95e2-77419a0e3413/click timed out after 60 seconds

To fix this I found I had to change the current "FireFox" driver to "Chrome" driver and then it worked


Please sign in to leave a comment.