File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
java/src/org/openqa/selenium/remote Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 1818package org .openqa .selenium .remote ;
1919
2020import java .io .Serializable ;
21+ import java .util .Map ;
2122import java .util .UUID ;
2223import org .jspecify .annotations .NullMarked ;
2324import org .jspecify .annotations .Nullable ;
@@ -52,7 +53,7 @@ public boolean equals(@Nullable Object obj) {
5253 return obj instanceof SessionId && opaqueKey .equals (((SessionId ) obj ).opaqueKey );
5354 }
5455
55- private Object toJson () {
56+ private String toJson () {
5657 return opaqueKey ;
5758 }
5859
@@ -61,6 +62,13 @@ private static SessionId fromJson(Object raw) {
6162 return new SessionId (String .valueOf (raw ));
6263 }
6364
65+ if (raw instanceof Map ) {
66+ Map <?, ?> map = (Map <?, ?>) raw ;
67+ if (map .get ("value" ) instanceof String ) {
68+ return new SessionId (String .valueOf (map .get ("value" )));
69+ }
70+ }
71+
6472 throw new JsonException ("Unable to coerce session id from " + raw );
6573 }
6674}
You can’t perform that action at this time.
0 commit comments