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 SeleniumHQ#13937
  • Loading branch information
diemol authored and sandeepsuryaprasad committed Oct 29, 2024
1 parent b84f33f commit 7112742
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 7112742

Please sign in to comment.