Skip to content

Commit

Permalink
[grid] Using MutableCapabilities to get rid of browserVersion
Browse files Browse the repository at this point in the history
And later returning them as PersistentCapabilities
Also, restoring the null check in PersistentCapabilities.java

Fixes #13937
  • Loading branch information
diemol committed May 15, 2024
1 parent 3b42a89 commit 9f650fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions java/src/org/openqa/selenium/PersistentCapabilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ private PersistentCapabilities(Capabilities previousValues, Capabilities newValu

public PersistentCapabilities setCapability(String name, Object value) {
Require.nonNull("Name", name);
Require.nonNull("Value", value);

return new PersistentCapabilities(this, new ImmutableCapabilities(name, value));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,10 @@ private Capabilities setBrowserBinary(Capabilities options, String browserPath)
Map<String, Object> vendorOptions =
(Map<String, Object>) options.getCapability(vendorOptionsCapability);
vendorOptions.put("binary", browserPath);
return new PersistentCapabilities(options)
.setCapability(vendorOptionsCapability, vendorOptions)
.setCapability("browserVersion", null);
MutableCapabilities toReturn = new MutableCapabilities(options);
toReturn.setCapability(vendorOptionsCapability, vendorOptions);
toReturn.setCapability("browserVersion", (String) null);
return new PersistentCapabilities(toReturn);
} catch (Exception e) {
LOG.log(
Level.WARNING,
Expand Down

0 comments on commit 9f650fd

Please sign in to comment.