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

For newSession, we need to return back the whole response value hash as it contains the sessionId information we need. For remaining commands, we can just send back the value hash alone

Aditya Ivaturi преди 15 години
родител
ревизия
f6860c8457
променени са 1 файла, в които са добавени 8 реда и са изтрити 1 реда
  1. 8 1
      lib/Selenium/Remote/RemoteConnection.pm

+ 8 - 1
lib/Selenium/Remote/RemoteConnection.pm

@@ -106,7 +106,14 @@ sub _get_command_result {
                 return $error_handler->process_error($resp);
             }
             else {
-                return $resp;
+                # For new session we need to grab the session id.
+                if ((ref $resp->{'value'} eq 'HASH') &&
+                    ($resp->{'value'}->{'class'} eq 'org.openqa.selenium.remote.DesiredCapabilities')) {
+                        return $resp;
+                }
+                else {
+                    return $resp->{'value'};
+                }
             }
         }
         else