-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_ok always fails against 2.42 #135
Comments
This is because the server returns content for get command with null value since selenium server version 2.42. I'm trying to fix some how but no idea for now :) |
Yeah, looks like they changed the API return value for GETing /session/:sessionId/url in 2.42. Hm. |
Yes that's what I wanted to say :) Wonder if *_ok methods can check $resp->{cmd_status} eq 'OK' some how. |
hmm. It doesn't work. cmd_status always set to OK. |
Could we combine this with my proposal in issue #130 ? |
Hi. olivierBlanc. I'm not pretty sure for now your proposal has to do something with this but please take over it :) By the way I've got another workaround for getting success out of _execute_command just in case wantarray solution is not acceptable. |
@peroumal1 Hey, do you have any input here? The |
I will try to have a look as soon as I have some time ;) On Wed, Jun 25, 2014 at 5:08 PM, Daniel Gempesaw notifications@github.com
Peroumalnaik Emmanuel |
So... 0 HTTP::Response=HASH(0x4189670)
'_content' => '{"status":0,"sessionId":"66884be3-8aae-4a1d-a8db-96e6e9daace1","value":null,"state":"success","class":"org.openqa.selenium.re
mote.Response","hCode":813457600}'
'_headers' => HTTP::Headers=HASH(0x4189658)
'cache-control' => ARRAY(0x41897d8)
0 'no-cache'
1 'no-cache'
'client-date' => 'Wed, 25 Jun 2014 15:31:59 GMT'
'client-peer' => '127.0.0.1:4444'
'client-response-num' => 1
'connection' => 'close'
'content-length' => 158
'content-type' => 'application/json; charset=utf-8'
'date' => 'Wed, 25 Jun 2014 15:31:58 GMT'
'expires' => ARRAY(0x4189778)
0 'Thu, 01 Jan 1970 00:00:00 GMT'
1 'Thu, 01 Jan 1970 00:00:00 GMT'
'server' => 'Jetty/5.1.x (Linux/3.8.0-42-generic amd64 java/1.6.0_31'
'_msg' => 'OK'
'_protocol' => 'HTTP/1.1'
'_rc' => 200
'_request' => HTTP::Request=HASH(0x4184fc8)
'_content' => '{"url":"http://.a.b"}'
'_headers' => HTTP::Headers=HASH(0x4184ce0)
'accept' => 'application/json'
'content-type' => 'application/json; charset=utf-8'
'user-agent' => 'libwww-perl/6.04'
'_method' => 'POST'
'_uri' => URI::http=SCALAR(0x413e908)
-> 'http://localhost:4444/wd/hub/session/66884be3-8aae-4a1d-a8db-96e6e9daace1/url'
'_uri_canonical' => URI::http=SCALAR(0x413e908)
-> REUSED_ADDRESS 2.41 response : 0 HTTP::Response=HASH(0x29b8e80)
'_content' => ''
'_headers' => HTTP::Headers=HASH(0x29b8da8)
'cache-control' => 'no-cache'
'client-date' => 'Wed, 25 Jun 2014 15:39:47 GMT'
'client-peer' => '127.0.0.1:4444'
'client-response-num' => 1
'connection' => 'close'
'date' => 'Wed, 25 Jun 2014 15:39:47 GMT'
'expires' => 'Thu, 01 Jan 1970 00:00:00 GMT'
'server' => 'Jetty/5.1.x (Linux/3.8.0-42-generic amd64 java/1.6.0_31'
'_msg' => 'No Content'
'_protocol' => 'HTTP/1.1'
'_rc' => 204
'_request' => HTTP::Request=HASH(0x29b4848)
'_content' => '{"url":"http://.a.b"}'
'_headers' => HTTP::Headers=HASH(0x29b43b0)
'accept' => 'application/json'
'content-type' => 'application/json; charset=utf-8'
'user-agent' => 'libwww-perl/6.04'
'_method' => 'POST'
'_uri' => URI::http=SCALAR(0x296ded8)
-> 'http://localhost:4444/wd/hub/session/2ac50f3d-125e-40de-b450-405e61474096/url'
'_uri_canonical' => URI::http=SCALAR(0x296ded8)
-> REUSED_ADDRESS So the main change is that they used to return '204 No Content' on older versions, which was caught correctly by our code (_process_response in Selenium::Remote::Connection). $data->{'cmd_return'} = $decoded_json->{'value'} // 'No Content'; That's for the quick and dirty solution, but it should work. |
@gempesaw I just noticed that I actually did not answer precisely enough. |
This seems plenty reasonable, and it should keep the behavior consistent for <2.42 versions with that |
Fix #135 : catch the new responses from Selenium 2.42
@peroumal1 Thanks so much for the investigation and the insightful PR, if (defined $decoded_json && $decoded_json->{'value'}) {
$data->{'cmd_return'} = $decoded_json->{'value'};
} This also would fit nicely #136 since the return value for those subs is set based off of that response code string. |
This reverts f22f548 and 5d11c36. As discussed in #145, this solution does not work as it interferes with some endpoints that expect to be able to return false by indicating "" as their return value. These fixes would catch that "" and return a non-empty string, which would in turn evaluate to true. Conflicts: lib/Selenium/Remote/RemoteConnection.pm
This reverts f22f548 and 5d11c36. As discussed in #145, this solution does not work as it interferes with some endpoints that expect to be able to return false by indicating "" as their return value. These fixes would catch that "" and return a non-empty string, which would in turn evaluate to true. Conflicts: lib/Selenium/Remote/RemoteConnection.pm
get_ok always fails in real world test case and the use case in t directory also fails.
The browser successfully shows the site and no error found in selenium server log.
Is this my environmental problem?
The text was updated successfully, but these errors were encountered: