Преглед на файлове

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 години
родител
ревизия
4fba1442f5
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  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 {