File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
java/client/src/org/openqa/selenium Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 26
26
27
27
import java .io .File ;
28
28
import java .io .IOException ;
29
+ import java .net .MalformedURLException ;
29
30
30
31
/**
31
32
* Manages the life and death of an GeckoDriver aka 'wires'.
@@ -63,6 +64,11 @@ public static GeckoDriverService createDefaultService() {
63
64
return new Builder ().usingAnyFreePort ().build ();
64
65
}
65
66
67
+ @ Override
68
+ protected void waitUntilAvailable () throws MalformedURLException {
69
+ return ;
70
+ }
71
+
66
72
/**
67
73
* Builder used to configure new {@link GeckoDriverService} instances.
68
74
*/
Original file line number Diff line number Diff line change @@ -163,13 +163,19 @@ public void start() throws IOException {
163
163
process .copyOutputTo (System .err );
164
164
process .executeAsync ();
165
165
166
+ waitUntilAvailable ();
167
+ } finally {
168
+ lock .unlock ();
169
+ }
170
+ }
171
+
172
+ protected void waitUntilAvailable () throws MalformedURLException {
173
+ try {
166
174
URL status = new URL (url .toString () + "/status" );
167
175
new UrlChecker ().waitUntilAvailable (20 , SECONDS , status );
168
176
} catch (UrlChecker .TimeoutException e ) {
169
177
process .checkForError ();
170
178
throw new WebDriverException ("Timed out waiting for driver server to start." , e );
171
- } finally {
172
- lock .unlock ();
173
179
}
174
180
}
175
181
You can’t perform that action at this time.
0 commit comments