Mark RemoteWebDriver.{start,stop}Client deprecated
The role that they used to fulfill is now handled by the
various `DriverService` classes.
@@ -112,24 +112,24 @@ protected RemoteWebDriver() {
init(new ImmutableCapabilities());
}
- public RemoteWebDriver(Capabilities desiredCapabilities) {
- this(new HttpCommandExecutor(null), desiredCapabilities);
+ public RemoteWebDriver(Capabilities capabilities) {
+ this(new HttpCommandExecutor(null), capabilities);
}
- public RemoteWebDriver(CommandExecutor executor, Capabilities desiredCapabilities) {
+ public RemoteWebDriver(CommandExecutor executor, Capabilities capabilities) {
this.executor = executor;
- init(desiredCapabilities);
+ init(capabilities);
if (executor instanceof NeedsLocalLogs) {
((NeedsLocalLogs)executor).setLocalLogs(localLogs);
}
try {
- startClient(desiredCapabilities);
+ startClient(capabilities);
} catch (RuntimeException e) {
try {
- stopClient(desiredCapabilities);
+ stopClient(capabilities);
} catch (Exception ignored) {
// Ignore the clean-up exception. We'll propagate the original failure.
}
@@ -138,7 +138,7 @@ public RemoteWebDriver(CommandExecutor executor, Capabilities desiredCapabilitie
}
try {
- startSession(desiredCapabilities);
+ startSession(capabilities);
} catch (RuntimeException e) {
try {
quit();
@@ -150,8 +150,8 @@ public RemoteWebDriver(CommandExecutor executor, Capabilities desiredCapabilitie
}
}
- public RemoteWebDriver(URL remoteAddress, Capabilities desiredCapabilities) {
- this(new HttpCommandExecutor(remoteAddress), desiredCapabilities);
+ public RemoteWebDriver(URL remoteAddress, Capabilities capabilities) {
+ this(new HttpCommandExecutor(remoteAddress), capabilities);
}
private void init(Capabilities capabilities) {
@@ -212,8 +212,8 @@ protected void setSessionId(String opaqueKey) {
sessionId = new SessionId(opaqueKey);
}
- protected void startSession(Capabilities desiredCapabilities) {
- Map<String, ?> parameters = ImmutableMap.of("desiredCapabilities", desiredCapabilities);
+ protected void startSession(Capabilities capabilities) {
+ Map<String, ?> parameters = ImmutableMap.of("desiredCapabilities", capabilities);
Response response = execute(DriverCommand.NEW_SESSION, parameters);
@@ -253,37 +253,49 @@ protected void startSession(Capabilities desiredCapabilities) {
returnedCapabilities.setCapability(SUPPORTS_JAVASCRIPT, true);
}
- capabilities = returnedCapabilities;
+ this.capabilities = returnedCapabilities;
sessionId = new SessionId(response.getSessionId());
}
/**
* Method called before {@link #startSession(Capabilities) starting a new session}. The default
* implementation is a no-op, but subtypes should override this method to define custom behavior.
+ *
+ * @deprecated No longer used, as behaviour is now in {@link CommandExecutor} instances.
*/
+ @Deprecated
protected void startClient() {
}
/**
* Method called before {@link #startSession(Capabilities) starting a new session}. The default
* implementation is a no-op, but subtypes should override this method to define custom behavior.
+ *
+ * @deprecated No longer used, as behaviour is now in {@link CommandExecutor} instances.
*/
- protected void startClient(Capabilities desiredCapabilities) {
+ @Deprecated
+ protected void startClient(Capabilities capabilities) {
startClient();
}
/**
* Method called after executing a {@link #quit()} command. The default implementation is a no-op,
* but subtypes should override this method to define custom behavior.
+ *
+ * @deprecated No longer used, as behaviour is now in {@link CommandExecutor} instances.
*/
+ @Deprecated
protected void stopClient() {
}
/**
* Method called after executing a {@link #quit()} command. The default implementation is a no-op,
* but subtypes should override this method to define custom behavior.
+ *
+ * @deprecated No longer used, as behaviour is now in {@link CommandExecutor} instances.
*/
- protected void stopClient(Capabilities desiredCapbilities) {
+ @Deprecated
+ protected void stopClient(Capabilities capabilities) {
stopClient();
}
