37
37
import static org .openqa .selenium .support .ui .ExpectedConditions .titleIs ;
38
38
import static org .openqa .selenium .testing .Driver .MARIONETTE ;
39
39
40
- import com .google .common .base .Throwables ;
41
-
42
40
import org .junit .After ;
43
41
import org .junit .Test ;
44
42
import org .mockito .Mockito ;
@@ -197,12 +195,12 @@ public void canSetPreferencesAndProfileInFirefoxOptions() {
197
195
198
196
@ Test
199
197
public void shouldGetMeaningfulExceptionOnBrowserDeath () throws Exception {
200
- localDriver = new FirefoxDriver ();
201
- localDriver .get (pages .formPage );
198
+ FirefoxDriver driver2 = new FirefoxDriver ();
199
+ driver2 .get (pages .formPage );
202
200
203
201
// Grab the command executor
204
- CommandExecutor keptExecutor = localDriver .getCommandExecutor ();
205
- SessionId sessionId = localDriver .getSessionId ();
202
+ CommandExecutor keptExecutor = driver2 .getCommandExecutor ();
203
+ SessionId sessionId = driver2 .getSessionId ();
206
204
207
205
try {
208
206
Field field = RemoteWebDriver .class .getDeclaredField ("executor" );
@@ -211,9 +209,9 @@ public void shouldGetMeaningfulExceptionOnBrowserDeath() throws Exception {
211
209
doThrow (new IOException ("The remote server died" ))
212
210
.when (spoof ).execute (Mockito .any ());
213
211
214
- field .set (localDriver , spoof );
212
+ field .set (driver2 , spoof );
215
213
216
- localDriver .get (pages .formPage );
214
+ driver2 .get (pages .formPage );
217
215
fail ("Should have thrown." );
218
216
} catch (UnreachableBrowserException e ) {
219
217
assertThat ("Must contain descriptive error" , e .getMessage (),
@@ -223,7 +221,6 @@ public void shouldGetMeaningfulExceptionOnBrowserDeath() throws Exception {
223
221
}
224
222
}
225
223
226
-
227
224
@ NeedsFreshDriver
228
225
@ NoDriverAfterTest
229
226
@ Test
0 commit comments