in reply to Re^3: Error “selenium server did not return proper status” when starts PhantomJS
in thread Error “selenium server did not return proper status” when starts PhantomJS

Sorry for slow poke ...

So I stumbled accross this thread because I have the same problem. And an ugly fix/work-around. Can't do any better because I don't know anything about perl.

  1. Open StrawberryPerl\perl\vendor\lib\LWP\Protocol\http.pm
  2. Find sub _new_socket
  3. Set $host = '127.0.0.1' (maybe '::1' works, too?)

How did I find this solution? The debugging helped. The error reported by IO::Socket::INET is "bad address". Originally the host was "localhost". I have no idea why "localhost" is a bad address but "127.0.0.1" works.

For reference:

  • Comment on Re^4: Error “selenium server did not return proper status” when starts PhantomJS

Replies are listed 'Best First'.
Re^5: Error “selenium server did not return proper status” when starts PhantomJS
by Anonymous Monk on Jan 03, 2017 at 16:48 UTC
    I found this fix as well, but it caused other issues as it affected everything. I found a better solution was to add this into ../Selenium/Remote/RemoteConnection.pm

    Around line 103, before

    my $request = HTTP::Request->new($method, $fullurl, $header, $cont +ent);
    Add in this line:
    $fullurl =~ s/localhost/127.0.0.1/;
    It accomplishes the same thing but limits the effect to Selenium only.