Skip to content

Commit

Permalink
If a remote end does not explicitly state JavaScript support we suppo…
Browse files Browse the repository at this point in the history
…se it's a "normal" browser that supports JavaScript
  • Loading branch information
barancev committed Mar 30, 2017
1 parent db0bcb3 commit 70539cd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions java/client/src/org/openqa/selenium/remote/RemoteWebDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,17 @@ protected void startSession(Capabilities desiredCapabilities,
}
returnedCapabilities.setPlatform(platform);

if (rawCapabilities.containsKey(SUPPORTS_JAVASCRIPT)) {
Object raw = rawCapabilities.get(SUPPORTS_JAVASCRIPT);
if (raw instanceof String) {
returnedCapabilities.setCapability(SUPPORTS_JAVASCRIPT, Boolean.parseBoolean((String) raw));
} else if (raw instanceof Boolean) {
returnedCapabilities.setCapability(SUPPORTS_JAVASCRIPT, ((Boolean) raw).booleanValue());
}
} else {
returnedCapabilities.setCapability(SUPPORTS_JAVASCRIPT, true);
}

capabilities = returnedCapabilities;
sessionId = new SessionId(response.getSessionId());
}
Expand Down

0 comments on commit 70539cd

Please sign in to comment.