File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
java/server/src/org/openqa/grid/web/servlet/handler Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -63,14 +63,20 @@ public Map<String, Object> extractDesiredCapability() {
63
63
String json = getBody ();
64
64
try {
65
65
JsonObject map = new JsonParser ().parse (json ).getAsJsonObject ();
66
- // Current W3C has required / desired capabilities wrapped in a 'capabilites' object.
66
+ System .out .println ("map = " + map );
67
+ // Current W3C has required / desired capabilities wrapped in a 'capabilities' object.
67
68
// This will need to be updated if/when https://github.com/w3c/webdriver/pull/327 gets merged
68
69
if (map .has ("capabilities" )) {
69
- return new JsonToBeanConverter ().convert (Map .class , map .getAsJsonObject ("capabilities" ).getAsJsonObject ("desiredCapabilities" ));
70
+ JsonObject outerCapabilities = map .getAsJsonObject ("capabilities" );
71
+ if (outerCapabilities .has ("desiredCapabilities" )) {
72
+ JsonObject desiredCapabilities = outerCapabilities .getAsJsonObject ("desiredCapabilities" );
73
+ System .out .println ("desiredCapabilities = " + desiredCapabilities );
74
+ return new JsonToBeanConverter ().convert (Map .class , desiredCapabilities );
75
+ }
70
76
}
71
77
JsonObject dc = map .get ("desiredCapabilities" ).getAsJsonObject ();
78
+ System .out .println ("dc = " + dc );
72
79
return new JsonToBeanConverter ().convert (Map .class , dc );
73
-
74
80
} catch (Exception e ) {
75
81
throw new GridException ("Cannot extract a capabilities from the request: " + json , e );
76
82
}
You can’t perform that action at this time.
0 commit comments