The same Test Suite is passed on IDEA, but fails when running on Teamcity
<p>Need a help. I have the same test suite. I have run this test suite in IDEA on my local machine. And the tests are passed. Then I run this test suite in TeamCity. The tests are failed with the next stack trace:</p>

<pre><code>======= Failed test run #1 ==========
org.openqa.selenium.ElementNotVisibleException: element not visible
(Session info: chrome=54.0.2840.71)
(Driver info: chromedriver=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 18 milliseconds
Build info: version: 'unknown', revision: '31c43c8', time: '2016-08-02 21:57:56 -0700'
System info: host: 'build', ip: '175.35.15.235', os.name: 'Windows Server 2012 R2', os.arch: 'x86', os.version: '6.3', java.version: '1.8.0_66'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf), userDataDir=C:\TeamCity\buildAgent\temp\buildTmp\scoped_dir948_4499}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=54.0.2840.71, platform=WIN8_1, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: e69e7517d0cc60ff138519603c9efe99
org.openqa.selenium.ElementNotVisibleException: 
element not visible
(Session info: chrome=54.0.2840.71)
(Driver info: chromedriver=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 18 milliseconds
Build info: version: 'unknown', revision: '31c43c8', time: '2016-08-02 21:57:56 -0700'
System info: host: 'build', ip: '175.35.15.235', os.name: 'Windows Server 2012 R2', os.arch: 'x86', os.version: '6.3', java.version: '1.8.0_66'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf), userDataDir=C:\TeamCity\buildAgent\temp\buildTmp\scoped_dir948_4499}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=54.0.2840.71, platform=WIN8_1, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: e69e7517d0cc60ff138519603c9efe99
at com.automation.webdriver.testStoryReportsNavigation.policiesWithPremium(testStoryReportsNavigation.java:122)
</code></pre>

<p>122 line of code like this:
driver.findElement (By.xpath ( "// * [@ id = \" 0 \ "]")) click (); 
(No matter for xpath looking for, or id - in TeamCity the same result)</p>

<p>In what may be the cause of this error?
Tests are run with agent on the same machine that serves TeamCity.</p>

<p>There is a code:</p>

<pre><code>package com.automation.webdriver;
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.remote.server.handler.CaptureScreenshot;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.Select;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.ITestResult;
import org.testng.annotations.*;
import pageObjects.homePage;
import utility.Constant;
import utility.ExcelUtils;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;


public class testStoryReportsNavigation {

public WebDriver driver;
private int storyNumber;
private String storyDescription;


@Factory(dataProvider = "dataMethod", dataProviderClass = dataProvider.class)
public testStoryReportsNavigation(int storyNumber, String storyDescription) {
    this.storyNumber = storyNumber;
    this.storyDescription = storyDescription;
}

@BeforeMethod
public void beforeClass() throws Exception {
    System.setProperty(Constant.chromeDriver,Constant.chromeDriverPath);
    driver = new ChromeDriver();

    ExcelUtils.setExcelFile(Constant.File_userData,"Users");

    driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
    driver.manage().window().maximize();

    driver.get(Constant.devUrl + Constant.loginPage);

    WebDriverWait waitLoginPage = new WebDriverWait(driver, 10);
    waitLoginPage.until(ExpectedConditions.titleIs("Log in Milliman"));

    if (driver.findElements(By.className("glimpse-icon")).size()!=0) {
        driver.get(Constant.devUrl + Constant.glimpseSettings);
        driver.findElement(By.id("buttonTurnGlimpseOff")).click();
        driver.getPageSource().contains("Glimpse cookie set 'Off'");
        driver.get(Constant.devUrl + Constant.loginPage);
    } else {
        System.out.println("Glimpse disabled");
    }

    WebDriverWait waitLoginPageAgain = new WebDriverWait(driver, 10);
    waitLoginPageAgain.until(ExpectedConditions.titleIs("Log in Milliman"));

    WebElement eMail = driver.findElement(By.id("Email"));
    eMail.sendKeys(ExcelUtils.getCellData(1, 1));

    WebElement password = driver.findElement(By.id("Password"));
    password.sendKeys(ExcelUtils.getCellData(1, 2));
    password.submit();

    //Check that Grid View appears after user login:
    WebDriverWait wait = new WebDriverWait(driver, 3);
    wait.until(ExpectedConditions.urlContains(Constant.gridView));

    System.out.println("Login Successful");

    //Navigate to Story
    System.out.println("Navigating to " + Constant.devUrl + Constant.storyPage + storyNumber + "(" + storyDescription + ")");
    driver.get(Constant.devUrl + Constant.storyPage + storyNumber);
    WebDriverWait waitLogout = new WebDriverWait(driver, 20);
    waitLogout.until(ExpectedConditions.elementToBeClickable(By.className("FiltersShortSummaryBlock")));
    //Check that story loaded
    driver.findElement(By.className("FiltersShortSummaryBlock")).click();
    WebDriverWait waitUrButton = new WebDriverWait(driver, 20);
    waitUrButton.until(ExpectedConditions.elementToBeClickable(By.id("UpdateResults")));
    //Select Data Source value
    driver.findElement(By.xpath("//*[@id=\"PanelGeneral\"]/table/tbody/tr[2]/td[1]/table/tbody/tr[1]/td[2]/button")).click();
    WebDriverWait waitDataSource = new WebDriverWait(driver, 10);
    waitDataSource.until(ExpectedConditions.elementToBeClickable(By.xpath("//span[contains(text(), 'Market Basket')]")));
    driver.findElement(By.xpath("//span[contains(text(), 'Market Basket')]")).click();
    //Select Primary Carrier value
    driver.findElement(By.xpath("//*[@id=\"PanelGeneral\"]/table/tbody/tr[2]/td[1]/table/tbody/tr[3]/td[2]/button")).click();
    driver.findElement(By.xpath("/html/body/div[60]/ul/li[2]/label")).click();

    //Select Secondary Carriers value
    driver.findElement(By.xpath("//*[@id=\"PanelGeneral\"]/table/tbody/tr[2]/td[1]/table/tbody/tr[4]/td[2]/button")).click();
    driver.findElement(By.xpath("/html/body/div[14]/div/ul/li[1]/a/span[2]")).click();

    //Click Update Results button
    WebDriverWait waitButton = new WebDriverWait(driver, 30);
    waitButton.until(ExpectedConditions.elementToBeClickable(By.id("UpdateResults")));
    WebElement updateResults = driver.findElement(By.id("UpdateResults"));
    updateResults.click();
    //Check that Results were updated
    WebDriverWait waitUpdateResults = new WebDriverWait(driver, 30);
    waitUpdateResults.until(ExpectedConditions.elementToBeClickable(By.id("storyUnsaved")));
}

@Test (priority = 11)
public void policiesWithPremium() throws Exception {
    //Generate report #0 and check that it was generated
    driver.findElement(By.xpath("//*[@id=\"0\"]")).click();
    //Check that report #0 was generated
    WebDriverWait waitReportZero = new WebDriverWait(driver, 120);
    waitReportZero.until(ExpectedConditions.visibilityOfElementLocated(By.id("RiskWithPremiumForm")));
}
</code></pre>