Skip to content

Commit 96862eb

Browse files
committed
Fixing platform name conversion in capabilities returned on new session request. Fixes SeleniumHQ#4669
1 parent 2ef07a7 commit 96862eb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

java/client/src/org/openqa/selenium/remote/RemoteWebDriver.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ protected void startSession(Capabilities desiredCapabilities) {
233233
if (platformString == null || "".equals(platformString)) {
234234
platform = Platform.ANY;
235235
} else {
236-
platform = Platform.valueOf(platformString);
236+
platform = Platform.fromString(platformString);
237237
}
238238
} catch (IllegalArgumentException e) {
239239
// The server probably responded with a name matching the os.name

java/client/test/org/openqa/selenium/PlatformTest.java

+5
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ public void testWindows81Detection() {
146146
Platform.WIN8_1, Platform.extractFromSysProperty("windows nt (unknown)", "6.3"));
147147
}
148148

149+
@Test
150+
public void testWindowsIsWindows() {
151+
assertEquals(Platform.fromString("windows"), Platform.WINDOWS);
152+
}
153+
149154
private void assertAllAre(Platform platform, String... osNames) {
150155
for (String osName : osNames) {
151156
Platform seen = Platform.extractFromSysProperty(osName);

0 commit comments

Comments
 (0)