Skip to content

Commit 30efd0c

Browse files
committed
java json converter chooses Long (Number base class). Fixing RemoteNetworkConnection
1 parent 72e85ca commit 30efd0c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

java/client/src/org/openqa/selenium/remote/mobile/RemoteNetworkConnection.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,17 @@ public RemoteNetworkConnection(ExecuteMethod executeMethod) {
3434

3535
@Override
3636
public ConnectionType getNetworkConnection() {
37-
return new ConnectionType(
38-
(Integer) executeMethod.execute(DriverCommand.GET_NETWORK_CONNECTION, null));
37+
return new ConnectionType(((Number) executeMethod.execute(DriverCommand.GET_NETWORK_CONNECTION,
38+
null)).intValue());
3939
}
4040

4141
@Override
4242
public ConnectionType setNetworkConnection(
4343
ConnectionType type) {
4444
Map<String, ConnectionType> mode = ImmutableMap.of("type", type);
45-
return new ConnectionType((Integer) executeMethod
46-
.execute(DriverCommand.SET_NETWORK_CONNECTION, ImmutableMap.of("parameters", mode)));
45+
return new ConnectionType(((Number) executeMethod.execute(DriverCommand.SET_NETWORK_CONNECTION,
46+
ImmutableMap
47+
.of("parameters", mode)))
48+
.intValue());
4749
}
4850
}

0 commit comments

Comments
 (0)