Skip to content

Instantly share code, notes, and snippets.

@jsteckel
jsteckel / gist:3742281
Created September 18, 2012 09:41
WebDriver script that avoids UnreachableBrowserException
import org.junit.Before;
import org.junit.Test;
import org.junit.After;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.By;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.JavascriptExecutor;
@jsteckel
jsteckel / gist:2883407
Created June 6, 2012 17:23
Stack trace of UnreachableBrowserException
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '2.22.0', revision: '17049', time: '2012-05-29 13:32:05'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_23'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:453)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:226)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByCssSelector(RemoteWebDriver.java:303)
at org.openqa.selenium.By$ByCssSelector.findElement(By.java:406)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:218)
at IframeTest$1.apply(IframeTest.java:42)
@jsteckel
jsteckel / gist:2883391
Created June 6, 2012 17:19
Script to reproduce UnreachableBrowserException with FirefoxDriver
import org.junit.Before;
import org.junit.After;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.By;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.support.ui.ExpectedCondition;