Ver código fonte

Look for session id where geckodriver puts it

When creating a new session, the standalone server responds with

    { sessionId => ..., }

Looks like the geckodriver server's response is like

    { value => { sessionId => ... } }

So...it seems like we have to put the sessionId there manually in the
geckodriver case. Curiously, the w3c spec does indicate that sessionId
should be a top level property in the json response, but...whatever.
Daniel Gempesaw 8 anos atrás
pai
commit
4fba1442f5
1 arquivos alterados com 4 adições e 0 exclusões
  1. 4 0
      lib/Selenium/Remote/RemoteConnection.pm

+ 4 - 0
lib/Selenium/Remote/RemoteConnection.pm

@@ -152,6 +152,10 @@ sub _process_response {
                 }
                 else {
                     $data->{'cmd_return'} = $decoded_json->{'value'};
+                    if (ref($data->{cmd_return}) eq 'HASH'
+                        && exists $data->{cmd_return}->{sessionId}) {
+                        $data->{sessionId} = $data->{cmd_return}->{sessionId};
+                    }
                 }
             }
             else {