Using Firefox v48+ fails due to POST url api containing windowhandler 'current'

23 views
Skip to first unread message

fpbo...@gmail.com

unread,
Jul 10, 2017, 3:35:37 PM7/10/17
to Selenium Remote Driver
Hi,

Has anyone succeeded using Selenium::Firefox/Selenium::Remote::Driver and marionette enabled (FF>V47)?  I tried several versions of geckodriver and Firefox, but the result is the same. I can start FF and access an url like google.com, but some of the S:R:D function terminate with unknown command.

Is there a way to configure the latest releases of FF, S:R:D, and geckodriver to work?

Thank you,
Fred

Example script:

use Selenium::Remote::Driver;
use Selenium::Firefox;
use Selenium::Remote::Driver::Firefox::Profile;

my $toolsPath='D:\Perforce\vmAutomation\InternalTools\Automation\Tools';

my $extraCaps = {
  #"browser" => "Firefox",
  "browser_version" => "48.0",
  "os" => "Windows",
  "os_version" => "7",
  "resolution" => "1024x768",
  "platform" => 'WINDOW'
};


my $driver = Selenium::Firefox->new( 'marionette_enabled' => 'true',
                                               'binary'             => "$toolsPath\\geckodriver.exe",
                                               'custom_args'         => '--log trace',
                                               'extra_capabilities' => $extraCaps
                                                );

$driver->debug_on();
$driver->get("http://google.com");
$driver->maximize_window();
sleep 10;

S:R:D log:
REQ: POST, http://127.0.0.1:9090/session/761313eb-b0e1-44ef-894b-b4e098b8a9b1/url, {"url":"http://google.com"}
RES: {}

REQ: POST, http://127.0.0.1:9090/session/761313eb-b0e1-44ef-894b-b4e098b8a9b1/window/current/maximize, {}
RES: {"error":"unknown command","message":"POST /session/761313eb-b0e1-44ef-894b-b4e098b8a9b1/window/current/maximize did not match a known command"}

Use of uninitialized value in hash element at C:/Strawberry/perl/site/lib/Selenium/Remote/ErrorHandler.pm line 126.
REQ: DELETE, http://127.0.0.1:9090/session/761313eb-b0e1-44ef-894b-b4e098b8a9b1, {}
RES:
{}


geckodriver log:

499520849015   hyper::server::request  DEBUG   Request Line: Post AbsolutePath("/session/761313eb-b0e1-44ef-894b-b4e098b8a9b1/window/current/maximize") Http11
1499520849015   hyper::server::request  DEBUG   Headers { Connection: TE, close, Host: 127.0.0.1:9090, Content-Type: application/json; charset=utf-8, TE: deflat
e,gzip;q=0.3, Accept: application/json, Content-Length: 2, User-Agent: libwww-perl/6.15, }
1499520849015   hyper::header   TRACE   Headers.set( "Connection", Connection([Close]) )
1499520849015   hyper::http::h1 TRACE   Sized read, remaining=2
1499520849015   hyper::http::h1 TRACE   Sized read: 2
1499520849015   hyper::http::h1 TRACE   Sized read, remaining=0
1499520849015   webdriver::server       DEBUG   Got request POST AbsolutePath("/session/761313eb-b0e1-44ef-894b-b4e098b8a9b1/window/current/maximize")
1499520849016   webdriver::server       DEBUG   Returning status NotFound

1499520849016   webdriver::server       DEBUG   Returning body {"error":"unknown command","message":"POST /session/761313eb-b0e1-44ef-894b-b4e098b8a9b1/window/c
urrent/maximize did not match a known command"}

1
499520849016   hyper::header   TRACE   Headers.set( "Content-Type", ContentType(Mime(Application, Json, [])) )
1499520849016   hyper::header   TRACE   Headers.set( "Content-Length", ContentLength(144) )
1499520849016   hyper::server::response DEBUG   writing head: Http11 NotFound
1499520849016   hyper::header   TRACE   Headers.set( "Date", Date(HttpDate(Tm { tm_sec: 9, tm_min: 34, tm_hour: 13, tm_mday: 8, tm_mon: 6, tm_year: 117, tm_wday
: 6, tm_yday: 188, tm_isdst: 0, tm_utcoff: 0, tm_nsec: 16060300 })) )
1499520849016   hyper::server::response DEBUG   headers [
Headers { Connection: close, Content-Type: application/json, Content-Length: 144, Date: Sat, 08 Jul 2017 13:34:09 GMT, }]
1499520849016   hyper::server::response DEBUG   write 144 bytes
1499520849016   hyper::server::response TRACE   ending
1499520849016   hyper::server   DEBUG   keep_alive = false for 127.0.0.1:31870
1499520849016   hyper::server   DEBUG   keep_alive loop ending for 127.0.0.1:31870

Daniel Gempesaw

unread,
Jul 24, 2017, 4:10:32 PM7/24/17
to Selenium Remote Driver

Erm, it looks like it’s the maximize command that’s failing, not the startup. Which, uh, presumably the maximize command is failing because geckodriver is quickly moving towards full compliance with the W3C webdriver spec, but S::R::D and the standalone server use the JSON Wire Protocol, which isn’t necessarily conformant. Although, I didn’t check to make sure…

fpbo...@gmail.com

unread,
Jul 31, 2017, 8:43:49 AM7/31/17
to Selenium Remote Driver
Is there a plan to comply with W3C?

Daniel Gempesaw

unread,
Jul 31, 2017, 11:20:10 AM7/31/17
to Selenium Remote Driver
Yup! Or, well, usually it comes in the form of bug reports that something doesn't work with geckodriver, and then I'd push out a fix for it piecemeal. Although, I've transferred ownership of the project, so things may be different now...

George Baugh

unread,
Nov 28, 2017, 1:25:23 PM11/28/17
to Selenium Remote Driver
As far as I can tell, things should "just work" when they finish implementing commands.  Last I checked maximize was still not done though.
Reply all
Reply to author
Forward
0 new messages