* If something goes wrong
*/
protected void setupDriver() throws Exception {
DesiredCapabilities capabilities;
Browser runLocallyBrowser = getRunLocallyBrowser();
if (runLocallyBrowser != null) {
if (System.getenv().containsKey("TEAMCITY_VERSION")) {
throw new RuntimeException(
"@RunLocally is not supported for tests run on the build server");
}
capabilities = runLocallyBrowser.getDesiredCapabilities();
setupLocalDriver(capabilities);
} else {
capabilities = getDesiredCapabilities();
for (int i = 1; i <= BROWSER_INIT_ATTEMPTS; i++) {