Skip to content

Commit 209d9b0

Browse files
committed
Fixing a broken test
1 parent 834478e commit 209d9b0

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

java/client/test/org/openqa/selenium/firefox/FirefoxDriverTest.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs;
3838
import static org.openqa.selenium.testing.Driver.MARIONETTE;
3939

40-
import com.google.common.base.Throwables;
41-
4240
import org.junit.After;
4341
import org.junit.Test;
4442
import org.mockito.Mockito;
@@ -197,12 +195,12 @@ public void canSetPreferencesAndProfileInFirefoxOptions() {
197195

198196
@Test
199197
public void shouldGetMeaningfulExceptionOnBrowserDeath() throws Exception {
200-
localDriver = new FirefoxDriver();
201-
localDriver.get(pages.formPage);
198+
FirefoxDriver driver2 = new FirefoxDriver();
199+
driver2.get(pages.formPage);
202200

203201
// Grab the command executor
204-
CommandExecutor keptExecutor = localDriver.getCommandExecutor();
205-
SessionId sessionId = localDriver.getSessionId();
202+
CommandExecutor keptExecutor = driver2.getCommandExecutor();
203+
SessionId sessionId = driver2.getSessionId();
206204

207205
try {
208206
Field field = RemoteWebDriver.class.getDeclaredField("executor");
@@ -211,9 +209,9 @@ public void shouldGetMeaningfulExceptionOnBrowserDeath() throws Exception {
211209
doThrow(new IOException("The remote server died"))
212210
.when(spoof).execute(Mockito.any());
213211

214-
field.set(localDriver, spoof);
212+
field.set(driver2, spoof);
215213

216-
localDriver.get(pages.formPage);
214+
driver2.get(pages.formPage);
217215
fail("Should have thrown.");
218216
} catch (UnreachableBrowserException e) {
219217
assertThat("Must contain descriptive error", e.getMessage(),
@@ -223,7 +221,6 @@ public void shouldGetMeaningfulExceptionOnBrowserDeath() throws Exception {
223221
}
224222
}
225223

226-
227224
@NeedsFreshDriver
228225
@NoDriverAfterTest
229226
@Test

0 commit comments

Comments
 (0)