Giter Site home page Giter Site logo

david-dick / firefox-marionette Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 3.0 1.86 MB

This is a client module to automate the Mozilla Firefox browser via the Marionette protocol

Home Page: https://metacpan.org/dist/Firefox-Marionette

License: Other

Perl 97.04% Raku 0.01% HTML 2.28% Shell 0.66% JavaScript 0.01%
aria bookmark-manager bot-detection browser-automation browser-fingerprinting certificate-authorities firefox-browser headless-testing marionette marionette-client mozilla-firefox password-manager perl perl-module perl5 root-certificates shadow-dom ssh waterfox

firefox-marionette's People

Contributors

532910 avatar david-dick avatar dependabot[bot] avatar knowledgejunkie avatar willwillis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

firefox-marionette's Issues

EXE_FILES

Hello.

EXE_FILES => [ 'ssh-auth-cmd-marionette', 'ca-bundle-for-firefox', ],

check-firefox-certificate-authorities and firefox-passwords are not included. Is this intentional?

Thanks,

Unable to find Mozilla firefox in Ubuntu - failed while installation

OS: Ubuntu 18.04
Perl version: 5.26

I have a GitHub workflow setup where I am spawning an ubuntu image and installing Firefox::Marionette which is failing.
Since it was failing there, I tried to do the similar thing locally on my pc and tried to install using both cpan and cpanm(using sudo).
I am getting the below error -

Fetching with LWP:
http://www.cpan.org/authors/id/D/DD/DDICK/Firefox-Marionette-1.00.tar.gz
Fetching with LWP:
http://www.cpan.org/authors/id/D/DD/DDICK/CHECKSUMS
Checksum for /root/.cpan/sources/authors/id/D/DD/DDICK/Firefox-Marionette-1.00.tar.gz ok
'YAML' not installed, will not store persistent state
Configuring D/DD/DDICK/Firefox-Marionette-1.00.tar.gz with Makefile.PL
/usr/share/applications/firefox.desktop:[Desktop Entry]
/usr/share/applications/firefox.desktop:Exec=firefox %u
/usr/share/applications/firefox.desktop:[Desktop Action new-window]
/usr/share/applications/firefox.desktop:Exec=firefox -new-window
/usr/share/applications/firefox.desktop:[Desktop Action new-private-window]
/usr/share/applications/firefox.desktop:Exec=firefox -private-window
Mozilla Firefox cannot be discovered in /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
Warning: No success on command[/usr/bin/perl Makefile.PL INSTALLDIRS=site]
  DDICK/Firefox-Marionette-1.00.tar.gz
  /usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK

It is not able to find firefox in the mentioned location.

I run few more commands as a normal user -

$ which firefox
/usr/bin/firefox

$ firefox -version
Mozilla Firefox 72.0.2

$ ls -lrt /usr/bin/firefox
lrwxrwxrwx 1 root root 25 Jul 13  2020 /usr/bin/firefox -> ../lib/firefox/firefox.sh

$ perl -e 'my $ver = `"firefox" -version 2>/dev/null`; print $ver;'
Mozilla Firefox 72.0.2

I ran the similar command as a root -

$ which firefox
/usr/bin/firefox

$ firefox -version
Running Firefox as root in a regular user's session is not supported.  ($XAUTHORITY is /run/user/1000/gdm/Xauthority which is owned by <username>.)

$ ls -lrt /usr/bin/firefox
lrwxrwxrwx 1 root root 25 Jul 13  2020 /usr/bin/firefox -> ../lib/firefox/firefox.sh

$ perl -e 'my $ver = `"firefox" -version`; print $ver;'
Running Firefox as root in a regular user's session is not supported.  ($XAUTHORITY is /run/user/1000/gdm/Xauthority which is owned by <username>.)

The error is correct as we are not supposed to run firefox as root.
There is one possible solution posted here
Using something like that as root and also as normal user gives the same output-

$ HOME=/tmp XAUTHORITY=/tmp firefox --version
Mozilla Firefox 72.0.2

$ perl -e 'my $ver = `HOME=/tmp XAUTHORITY=/tmp "firefox" -version`; print $ver;'
Mozilla Firefox 72.0.2

Is it possible to add this as a fallback in case we doesn't get version? Something like-

if (( !defined $version_string ) && (defined $binary)) {
    $version_string = `"$binary" -version 2>$dev_null`;
    if ((!defined $version_string) or ($version_string eq "")) {
        $version_string = `HOME=/tmp XAUTHORITY=/tmp "$binary" -version 2>$dev_null`;
    }
 }

Please let me know if you want more info.

selfie does not return a File::Temp object

Contrary to what is written in the documentation, selfie does not return a File::Temp object, but just a filehandle. The difference between both is that for example the filename method is not available for the latter (which would be quite handy for some kind for things like system("display", $selfie->filename) without the need to create another temporary file).

It seems that a real File::Temp may be created using the following (no other code changes needed):

        my $handle = File::Temp->new(
	    TEMPLATE => File::Spec->catfile(
                File::Spec->tmpdir(), 'firefox_marionette_selfie_XXXXXXXXXXX'
            )
          )

(I can create a formal PR if this problem is accepted)

json method fails on documents with non-ASCII characters

The following script tries to fetch and decode a JSON document, but fails:

#!/usr/bin/env perl

use strict;
use warnings;
use v5.10.0;
use Firefox::Marionette;
use Data::Dumper;

my $fm = Firefox::Marionette->new;
$fm->go("https://eprel.ec.europa.eu/api/products/dishwashers2019/543834");
say Dumper($fm->json);
#my $json = $fm->strip; utf8::encode($json); $json = JSON::XS::decode_json($json); say Dumper($json); # workaround for the problem

__END__

Output is:

malformed UTF-8 character in JSON string, at character offset 193 (before "\x{fffd}","postalCod...") at /opt/perl-5.30.3/lib/site_perl/5.30.3/Firefox/Marionette.pm line 6391.

The problem seems to be that the document content is available in characters, but JSON::XS requires that the input is in octets. So it works well unless there are "wide characters" in the input. Explicitly transforming the characters into utf-8 octets, either with utf8::encode or another function (Encode::str2bytes would also work) fixes the problem, and should probably be built into the json() method.

console (in)visible?

I cannot seem to be able to get this to work. The docs say that the console option can make the latter visible, but if I run

my $firefox = Firefox::Marionette->new(
    console => 1,
    visible => 1,
    sleep_time_in_ms => 2000,
    )->go($url);

I see no console. Am I supposed to pass something other than a 1 there? The documentation is a bit unclear on how to actually turn this on..

invalid cookie domain: Document is cookie-averse

If using add_cookie before loading a page, then an exception happens. A sample script:

#!/usr/bin/env perl

use strict;
use warnings;
use v5.10.0;
use Firefox::Marionette;

my $fm = Firefox::Marionette->new;
#$fm->go("http://www.example.org"); # uncomment to make problem go away
say $fm->uri;
my $cookie = Firefox::Marionette::Cookie->new(name=>'testcookie', value=> 'testvalue', domain=>'www.example.org', path=>"/", secure=>0);
$fm->add_cookie($cookie);
$fm->go("http://www.example.org");

__END__

Output:

about:blank
invalid cookie domain: Document is cookie-averse in /tmp/firefox-marionette-script-3.pl at line 12

The first output line probably gives the answer: cookies can probably be only set for "real" pages. A workaround could be: preload the URL. (Using another domain wouldn't work, this would lead to the error invalid cookie domain: Cookies may only be set for the current domain (...))

Is there a possibility to set the cookie before loading the (possibly heavy) page? If not, then maybe this restriction should be documented?

Firefox::Marionette via ssh with profile parameter fails

Hello.

I tried Firefox::Marionette via ssh with specifying profile but it fails. The script is something like this.

use strict;
use warnings;
use utf8;
use Encode;
use Firefox::Marionette();
use File::Copy;

my $firefox = Firefox::Marionette->new( host => '192.168.3.2', user => 'foxy', port => 22, debug => 1, 'profile_name' => 'marionette' );

The debug output is

** ssh -2 -p 22 -q -o ServerAliveInterval=15 -o BatchMode=yes -o ExitOnForwardFailure=yes -o SendEnv=TMPDIR -o StrictHostKeyChecking=accept-new -o ControlPath=/tmp/perl_ff_m_NGa7Lsq8MzB/control.sock -o ControlMaster=yes -o ControlPersist=30 [email protected] uname || ver
** ssh -2 -p 22 -q -o ServerAliveInterval=15 -o BatchMode=yes -o ExitOnForwardFailure=yes -o StrictHostKeyChecking=yes -o ControlPath=/tmp/perl_ff_m_NGa7Lsq8MzB/control.sock -o ControlMaster=no [email protected] which firefox
** ssh -2 -p 22 -q -o ServerAliveInterval=15 -o BatchMode=yes -o ExitOnForwardFailure=yes -o StrictHostKeyChecking=yes -o ControlPath=/tmp/perl_ff_m_NGa7Lsq8MzB/control.sock -o ControlMaster=no [email protected] "firefox" --version
Use of uninitialized value in subroutine entry at /usr/local/lib/perl5/site_perl/Firefox/Marionette.pm line 2537.
** ssh -2 -p 22 -q -o ServerAliveInterval=15 -o BatchMode=yes -o ExitOnForwardFailure=yes -o SendEnv=TMPDIR -o StrictHostKeyChecking=yes -o ControlPath=/tmp/perl_ff_m_NGa7Lsq8MzB/control.sock -o ControlMaster=no [email protected] "firefox" -marionette -safe-mode -headless -P marionette
** ssh -2 -p 22 -q -o ServerAliveInterval=15 -o BatchMode=yes -o ExitOnForwardFailure=yes -o StrictHostKeyChecking=yes -o ControlPath=/tmp/perl_ff_m_NGa7Lsq8MzB/control.sock -o ControlMaster=no [email protected] grep -e marionette\.port -e security\.sandbox\.content\.tempDirSuffix -e security\.sandbox\.plugin\.tempDirSuffix /prefs.js
Command 'ssh -2 -p 22 -q -o ServerAliveInterval=15 -o BatchMode=yes -o ExitOnForwardFailure=yes -o StrictHostKeyChecking=yes -o ControlPath=/tmp/perl_ff_m_NGa7Lsq8MzB/control.sock -o ControlMaster=no [email protected] grep -e marionette\.port -e security\.sandbox\.content\.tempDirSuffix -e security\.sandbox\.plugin\.tempDirSuffix /prefs.js did not complete successfully:ssh exited with a 1

It looks that $self->{_profile_directory} is undef.

ssh-auth-cmd-marionette refuses the command by "Unrecognisable command" on FreeBSD

Hello.

I haven't updated Firefox::Marionette for a while and I tried 1.37 today. I used ssh with profile name to set it up as before and encountered the problem.

May 27 10:46:18 foxy ssh-auth-cmd-marionette[78502]: Unrecognisable command "ls -1 "/usr/local/lib/firefox"" with a quoted TMPDIR of "/tmp" and a root directory regex of "(?^msx:(?^msx:(?:/var)?/tmp)/firefox_marionette_remote\w+)"

I dug out this issue and found that the content of @allowed_binary_directories for freebsd was changed in this update.

ec55db3

Should %os_allowed_binary_directories should something like this?
my %os_allowed_binary_directories = (
freebsd => '/usr/local/lib/firefox',

Version 1.35 fails on macOS 13.2.1, Perl 5.36.0, Firefox 112.0.1

This is the list of unique fail messages:

Failed test '$firefox->capabilities()->timeouts()->implicit() correctly reflects the implicit shortcut timeout'
Failed test '$firefox->capabilities()->timeouts()->implicit() correctly reflects the timeouts shortcut timeout'
Failed test '$firefox->capabilities()->timeouts()->page_load() correctly reflects the page_load shortcut timeout'
Failed test '$firefox->capabilities()->timeouts()->page_load() correctly reflects the timeouts shortcut timeout'
Failed test '$firefox->capabilities()->timeouts()->script() correctly reflects the scripts shortcut timeout:'
Failed test '$firefox->capabilities()->timeouts()->script() correctly reflects the timeouts shortcut timeout'
Failed test '$firefox->chrome_window_handle() is an integer:6c0765b5-7d4d-4691-b23b-82abcf1fc43e'
Failed test '$firefox->chrome_window_handles() returns a list of integers:3e6a571a-39b7-493d-91d3-697505fcfa43'
Failed test '$firefox->chrome_window_handles() returns a list of integers:6c0765b5-7d4d-4691-b23b-82abcf1fc43e'
Failed test '$firefox->window_handle() is an integer:d75066a1-6399-4b2d-9858-b65ed173da51'
Failed test '$firefox->window_handles() returns a list of integers:ad68d928-6d01-4592-baed-a9285de0d0e0'
Failed test '$firefox->window_handles() returns a list of integers:d75066a1-6399-4b2d-9858-b65ed173da51'

See this gist for the full output of the make process.

JSON serialization error when providing DOM elements to script()

It is not possible to provide previously found DOM elements as arguments to a script() method call:

$ perl -MFirefox::Marionette -E '$fm = Firefox::Marionette->new->go(shift); $body = $fm->find("//body"); say $fm->script(q{ return arguments[0].outerHTML;}, args => [$body]);' http://www.example.org 
encountered object 'Firefox::Marionette::Element=HASH(0x5612655ec8a8)', but neither allow_blessed, convert_blessed nor allow_tags settings are enabled (or TO_JSON/FREEZE method missing) at /opt/perl-5.30.3/lib/site_perl/5.30.3/Firefox/Marionette.pm line 6842.

After some experiments and research I found a working solution:

$ perl -MFirefox::Marionette -E '$fm = Firefox::Marionette->new->go(shift); $body = $fm->find("//body"); say $fm->script(q{ return arguments[0].outerHTML;}, args => [{"element-6066-11e4-a52e-4f735466cecf" => $body->uuid}]);' http://www.example.org
<body>
<div>
...

(The magic key I got from https://www.w3.org/TR/webdriver/#dfn-web-element-identifier)

Maybe the JSON serialization needs to be adapted here?

cannot drive existing profile

I am running the following, after having created a throwaway new profile called throw:

#!/usr/bin/env perl
use warnings;
use v5.12;

use Firefox::Marionette;

my $url='https://www.google.com';
my $firefox = Firefox::Marionette->new(
    profile_name => 'throw',
    visible => 1,
    )->go($url);
sleep;

This opens up a browser window on the default startup page Firefox gives new profiles (screenshot here), but hangs there.

It never reaches google.com, and pegs one of my CPUs to 100%.

Edit

Actually, it hangs even without the sleep; directive at the end. Removing that last line makes no difference.

Nor does setting my profile's homepage to blank. If I do that, then running that script results in a window hung on that initial blank page (again with a 100%-spinning CPU).

how to get http status code?

I'd like to make pdf, but only if 200 was returned.
If server returns 404 or 503 for example, pdf just prints page with "404" or "503" text.

Warnings and incomplete message in StaleElement exception

A StaleElement exception generates warnings and the error message looks incomplete. Here's a script which forces such an exception:

#!/usr/bin/env perl

use strict;
use warnings;
use Firefox::Marionette;

my $fm = Firefox::Marionette->new;
$fm->go("http://www.example.org");
my $a = $fm->find('//a');
$fm->script(q{arguments[0].parentNode.removeChild(arguments[0]);}, args => [{"element-6066-11e4-a52e-4f735466cecf" => $a->uuid}]); # hack to make $a stale
warn $a->attribute("href");

__END__

Output:

Use of uninitialized value in concatenation (.) or string at /opt/perl-5.30.3/lib/site_perl/5.30.3/Firefox/Marionette/Exception/StaleElement.pm line 15.
Use of uninitialized value in concatenation (.) or string at /opt/perl-5.30.3/lib/site_perl/5.30.3/Firefox/Marionette/Exception/StaleElement.pm line 15.
Failed to find  of " in /tmp/firefox-marionette-script-2.pl at line 11

It seems that using and value is undefined in this situation.

Installation of version 1.34 fails on macOS w/Firefox 108.0.1

Running make test for DDICK/Firefox-Marionette-1.34.tar.gz
PERL_DL_NONLAZY=1 "/usr/local/Cellar/perl/5.36.0/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00.load.t ........ 1/1 # Testing Firefox::Marionette 1.34
t/00.load.t ........ ok   
t/01-marionette.t .. # Version is Mozilla Firefox 108.0.1
t/01-marionette.t .. 1/? # This firefox installation has 2 existing profiles
'/usr/local/Cellar/perl/5.36.0/bin/perl --version' did not produce output that could be parsed.  Assuming modern Marionette is available at t/01-marionette.t line 605.
'/usr/local/Cellar/perl/5.36.0/bin/perl --version' did not produce output that could be parsed.  Assuming modern Marionette is available at t/01-marionette.t line 605.
'/usr/local/Cellar/perl/5.36.0/bin/perl --version' did not produce output that could be parsed.  Assuming modern Marionette is available at t/01-marionette.t line 605.
'/usr/local/Cellar/perl/5.36.0/bin/perl --version' did not produce output that could be parsed.  Assuming modern Marionette is available at t/01-marionette.t line 605.
t/01-marionette.t .. 6/? # Initial tests
# Testing has been running for 1 seconds at t/01-marionette.t line 714
** /Applications/Firefox.app/Contents/MacOS/firefox -marionette -safe-mode -headless -profile /var/folders/fg/9_qz5v5j3zz26b89h228s4qr0000gn/T/firefox_marionette_local_o8qmbVyXudq/profile --no-remote --new-instance
*** You are running in headless mode.
2023-01-07 07:29:01.140 plugin-container[12897:98823036] nil host used in call to allowsSpecificHTTPSCertificateForHost
2023-01-07 07:29:01.140 plugin-container[12897:98823036] nil host used in call to allowsAnyHTTPSCertificateForHost:
2023-01-07 07:29:01.160 plugin-container[12897:98823036] nil host used in call to allowsSpecificHTTPSCertificateForHost
2023-01-07 07:29:01.160 plugin-container[12897:98823036] nil host used in call to allowsAnyHTTPSCertificateForHost:
2023-01-07 07:29:01.160 plugin-container[12897:98823058] nil host used in call to allowsSpecificHTTPSCertificateForHost
2023-01-07 07:29:01.160 plugin-container[12897:98823058] nil host used in call to allowsAnyHTTPSCertificateForHost:
<< 50:{"applicationType":"gecko","marionetteProtocol":3}
>> 73:[0,1,"WebDriver:NewSession",{"capabilities":{"requiredCapabilities":{}}}]
<< 748:[1,1,null,{"sessionId":"b5543222-a1e7-48c0-87cd-f5dd0e173bcf","capabilities":{"browserName":"firefox","browserVersion":"108.0.1","platformName":"mac","acceptInsecureCerts":false,"pageLoadStrategy":"normal","setWindowRect":true,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"strictFileInteractability":false,"unhandledPromptBehavior":"dismiss and notify","moz:accessibilityChecks":false,"moz:buildID":"20221215175817","moz:headless":true,"moz:platformVersion":"21.6.0","moz:processID":12894,"moz:profile":"/var/folders/fg/9_qz5v5j3zz26b89h228s4qr0000gn/T/firefox_marionette_local_o8qmbVyXudq/profile","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"moz:windowless":false,"proxy":{}}}]
t/01-marionette.t .. 18/? >> 33:[0,2,"WebDriver:GetCapabilities"]
<< 697:[1,2,null,{"capabilities":{"browserName":"firefox","browserVersion":"108.0.1","platformName":"mac","acceptInsecureCerts":false,"pageLoadStrategy":"normal","setWindowRect":true,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"strictFileInteractability":false,"unhandledPromptBehavior":"dismiss and notify","moz:accessibilityChecks":false,"moz:buildID":"20221215175817","moz:headless":true,"moz:platformVersion":"21.6.0","moz:processID":12894,"moz:profile":"/var/folders/fg/9_qz5v5j3zz26b89h228s4qr0000gn/T/firefox_marionette_local_o8qmbVyXudq/profile","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"moz:windowless":false,"proxy":{}}}]
# Browser version is 108.0.1
# Operating System is mac 21.6.0
# Profile Directory is /var/folders/fg/9_qz5v5j3zz26b89h228s4qr0000gn/T/firefox_marionette_local_o8qmbVyXudq/profile
# Mozilla PID is 12894
# Firefox BuildID is 20221215175817
# Addons are disabled
# No update checks for darwin
>> 32:[0,3,"Marionette:GetWindowType"]
<< 40:[1,3,null,{"value":"navigator:browser"}]
>> 31:[0,4,"WebDriver:GetWindowRect"]
<< 50:[1,4,null,{"x":4,"y":4,"width":1366,"height":768}]
>> 71:[0,5,"WebDriver:SetWindowRect",{"height":452,"width":326,"x":3,"y":23}]
<< 50:[1,5,null,{"x":3,"y":23,"width":450,"height":452}]
t/01-marionette.t .. 31/? >> 31:[0,6,"WebDriver:GetWindowRect"]
<< 50:[1,6,null,{"x":3,"y":23,"width":450,"height":452}]
>> 31:[0,7,"WebDriver:GetWindowRect"]
<< 50:[1,7,null,{"x":3,"y":23,"width":450,"height":452}]
>> 29:[0,8,"WebDriver:GetTimeouts"]
<< 58:[1,8,null,{"implicit":0,"pageLoad":300000,"script":30000}]
>> 80:[0,9,"WebDriver:SetTimeouts",{"implicit":41001,"pageLoad":45043,"script":48021}]
<< 25:[1,9,null,{"value":null}]
>> 30:[0,10,"WebDriver:GetTimeouts"]
<< 62:[1,10,null,{"implicit":41001,"pageLoad":45043,"script":48021}]
>> 30:[0,11,"WebDriver:GetTimeouts"]
<< 62:[1,11,null,{"implicit":41001,"pageLoad":45043,"script":48021}]
>> 81:[0,12,"WebDriver:SetTimeouts",{"implicit":41001,"pageLoad":45043,"script":48021}]
<< 26:[1,12,null,{"value":null}]
>> 87:[0,13,"WebDriver:ExecuteScript",{"script":"window.open(\"about:blank\", \"_blank\");"}]
<< 26:[1,13,null,{"value":null}]
>> 30:[0,14,"WebDriver:CloseWindow"]
<< 52:[1,14,null,["7c747e8f-83f0-4e37-99d6-a360f4763038"]]
>> 32:[0,15,"WebDriver:DeleteSession"]
<< 26:[1,15,null,{"value":null}]
>> 74:[0,16,"WebDriver:NewSession",{"capabilities":{"requiredCapabilities":{}}}]
<< 749:[1,16,null,{"sessionId":"5bde13dc-842a-4c60-b103-837e8098f627","capabilities":{"browserName":"firefox","browserVersion":"108.0.1","platformName":"mac","acceptInsecureCerts":false,"pageLoadStrategy":"normal","setWindowRect":true,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"strictFileInteractability":false,"unhandledPromptBehavior":"dismiss and notify","moz:accessibilityChecks":false,"moz:buildID":"20221215175817","moz:headless":true,"moz:platformVersion":"21.6.0","moz:processID":12894,"moz:profile":"/var/folders/fg/9_qz5v5j3zz26b89h228s4qr0000gn/T/firefox_marionette_local_o8qmbVyXudq/profile","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"moz:windowless":false,"proxy":{}}}]
>> 51:[0,17,"Marionette:Quit",{"flags":["eAttemptQuit"]}]
<< 61:[1,17,null,{"cause":"shutdown","forced":false,"in_app":true}]
t/01-marionette.t .. 57/? # Starting new firefox for testing capabilities and accessing proxies
# Using proxy port TCP/60338
# Using SOCKS port TCP/60339
# Testing has been running for 5 seconds at t/01-marionette.t line 1093
t/01-marionette.t .. 68/? # Testing has been running for 7 seconds at t/01-marionette.t line 1171
# Testing has been running for 7 seconds at t/01-marionette.t line 1201
t/01-marionette.t .. 92/? # Starting new firefox for testing proxies with proxy port TCP/60359
# Testing has been running for 10 seconds at t/01-marionette.t line 1294
** /Applications/Firefox.app/Contents/MacOS/firefox -marionette -MOZ_LOG=timestamp,cookie:2 -safe-mode -headless -profile /var/folders/fg/9_qz5v5j3zz26b89h228s4qr0000gn/T/firefox_marionette_local_JzQlkMGRYaZ/profile --no-remote --new-instance --devtools
*** You are running in headless mode.
2023-01-07 07:29:09.429 plugin-container[12916:98823602] nil host used in call to allowsSpecificHTTPSCertificateForHost
2023-01-07 07:29:09.429 plugin-container[12916:98823602] nil host used in call to allowsAnyHTTPSCertificateForHost:
2023-01-07 07:29:09.432 plugin-container[12916:98823602] nil host used in call to allowsSpecificHTTPSCertificateForHost
2023-01-07 07:29:09.432 plugin-container[12916:98823602] nil host used in call to allowsAnyHTTPSCertificateForHost:
2023-01-07 07:29:09.432 plugin-container[12916:98823600] nil host used in call to allowsSpecificHTTPSCertificateForHost
2023-01-07 07:29:09.432 plugin-container[12916:98823600] nil host used in call to allowsAnyHTTPSCertificateForHost:
<< 50:{"applicationType":"gecko","marionetteProtocol":3}
>> 220:[0,1,"WebDriver:NewSession",{"capabilities":{"requiredCapabilities":{"proxy":{"proxyAutoconfigUrl":"http://localhost:60359","proxyType":"pac"}}},"proxy":{"proxyAutoconfigUrl":"http://localhost:60359","proxyType":"pac"}}]
2023-01-07 06:29:10.329583 UTC - [Parent 12915: Main Thread]: W/cookie ===== COOKIE NOT SENT =====
2023-01-07 06:29:10.329599 UTC - [Parent 12915: Main Thread]: W/cookie request URL: http://localhost:60359/
2023-01-07 06:29:10.329630 UTC - [Parent 12915: Main Thread]: W/cookie current time: Sat Jan 07 06:29:10 2023 GMT
2023-01-07 06:29:10.329633 UTC - [Parent 12915: Main Thread]: W/cookie rejected because cookies are disabled
2023-01-07 06:29:10.329634 UTC - [Parent 12915: Main Thread]: W/cookie 
<< 927:[1,1,null,{"sessionId":"4888a234-9702-485e-add4-af2c6ada7c35","capabilities":{"browserName":"firefox","browserVersion":"108.0.1","platformName":"mac","acceptInsecureCerts":false,"pageLoadStrategy":"normal","proxy":{"proxyType":"pac","proxyAutoconfigUrl":"http://localhost:60359"},"setWindowRect":true,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"strictFileInteractability":false,"unhandledPromptBehavior":"dismiss and notify","moz:accessibilityChecks":false,"moz:buildID":"20221215175817","moz:headless":true,"moz:platformVersion":"21.6.0","moz:processID":12915,"moz:profile":"/var/folders/fg/9_qz5v5j3zz26b89h228s4qr0000gn/T/firefox_marionette_local_JzQlkMGRYaZ/profile","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"moz:windowless":false,"capabilities":{"requiredCapabilities":{"proxy":{"proxyAutoconfigUrl":"http://localhost:60359","proxyType":"pac"}}}}}]
>> 29:[0,2,"WebDriver:GetTimeouts"]
<< 58:[1,2,null,{"implicit":0,"pageLoad":300000,"script":30000}]
>> 76:[0,3,"WebDriver:SetTimeouts",{"implicit":0,"pageLoad":65432,"script":30000}]
<< 25:[1,3,null,{"value":null}]
t/01-marionette.t .. 93/? >> 33:[0,4,"WebDriver:GetCapabilities"]
<< 875:[1,4,null,{"capabilities":{"browserName":"firefox","browserVersion":"108.0.1","platformName":"mac","acceptInsecureCerts":false,"pageLoadStrategy":"normal","proxy":{"proxyType":"pac","proxyAutoconfigUrl":"http://localhost:60359"},"setWindowRect":true,"timeouts":{"implicit":0,"pageLoad":65432,"script":30000},"strictFileInteractability":false,"unhandledPromptBehavior":"dismiss and notify","moz:accessibilityChecks":false,"moz:buildID":"20221215175817","moz:headless":true,"moz:platformVersion":"21.6.0","moz:processID":12915,"moz:profile":"/var/folders/fg/9_qz5v5j3zz26b89h228s4qr0000gn/T/firefox_marionette_local_JzQlkMGRYaZ/profile","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"moz:windowless":false,"capabilities":{"requiredCapabilities":{"proxy":{"proxyAutoconfigUrl":"http://localhost:60359","proxyType":"pac"}}}}}]
>> 50:[0,5,"Marionette:Quit",{"flags":["eAttemptQuit"]}]
<< 60:[1,5,null,{"cause":"shutdown","forced":false,"in_app":true}]
t/01-marionette.t .. 98/? # Starting new firefox for testing proxies again using proxy port TCP/60371
# Testing has been running for 14 seconds at t/01-marionette.t line 1323
** /Applications/Firefox.app/Contents/MacOS/firefox -marionette -safe-mode -profile /var/folders/fg/9_qz5v5j3zz26b89h228s4qr0000gn/T/firefox_marionette_local_48bZCosv_9L/profile --no-remote --new-instance
2023-01-07 07:29:13.488 plugin-container[12926:98823885] nil host used in call to allowsSpecificHTTPSCertificateForHost
2023-01-07 07:29:13.489 plugin-container[12926:98823885] nil host used in call to allowsAnyHTTPSCertificateForHost:
2023-01-07 07:29:13.491 plugin-container[12926:98823885] nil host used in call to allowsSpecificHTTPSCertificateForHost
2023-01-07 07:29:13.491 plugin-container[12926:98823885] nil host used in call to allowsAnyHTTPSCertificateForHost:
2023-01-07 07:29:13.491 plugin-container[12926:98823890] nil host used in call to allowsSpecificHTTPSCertificateForHost
2023-01-07 07:29:13.491 plugin-container[12926:98823890] nil host used in call to allowsAnyHTTPSCertificateForHost:
<< 50:{"applicationType":"gecko","marionetteProtocol":3}
>> 252:[0,1,"WebDriver:NewSession",{"capabilities":{"requiredCapabilities":{"proxy":{"httpProxy":"localhost:60371","proxyType":"manual","sslProxy":"localhost:60371"}}},"proxy":{"httpProxy":"localhost:60371","proxyType":"manual","sslProxy":"localhost:60371"}}]
<< 960:[1,1,null,{"sessionId":"c7234137-3d7f-44a0-9550-73c6b22d7320","capabilities":{"browserName":"firefox","browserVersion":"108.0.1","platformName":"mac","acceptInsecureCerts":false,"pageLoadStrategy":"normal","proxy":{"proxyType":"manual","httpProxy":"localhost:60371","sslProxy":"localhost:60371"},"setWindowRect":true,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"strictFileInteractability":false,"unhandledPromptBehavior":"dismiss and notify","moz:accessibilityChecks":false,"moz:buildID":"20221215175817","moz:headless":false,"moz:platformVersion":"21.6.0","moz:processID":12925,"moz:profile":"/var/folders/fg/9_qz5v5j3zz26b89h228s4qr0000gn/T/firefox_marionette_local_48bZCosv_9L/profile","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"moz:windowless":false,"capabilities":{"requiredCapabilities":{"proxy":{"httpProxy":"localhost:60371","proxyType":"manual","sslProxy":"localhost:60371"}}}}}]
t/01-marionette.t .. 99/? >> 33:[0,2,"WebDriver:GetCapabilities"]
<< 909:[1,2,null,{"capabilities":{"browserName":"firefox","browserVersion":"108.0.1","platformName":"mac","acceptInsecureCerts":false,"pageLoadStrategy":"normal","proxy":{"proxyType":"manual","httpProxy":"localhost:60371","sslProxy":"localhost:60371"},"setWindowRect":true,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"strictFileInteractability":false,"unhandledPromptBehavior":"dismiss and notify","moz:accessibilityChecks":false,"moz:buildID":"20221215175817","moz:headless":false,"moz:platformVersion":"21.6.0","moz:processID":12925,"moz:profile":"/var/folders/fg/9_qz5v5j3zz26b89h228s4qr0000gn/T/firefox_marionette_local_48bZCosv_9L/profile","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"moz:windowless":false,"capabilities":{"requiredCapabilities":{"proxy":{"httpProxy":"localhost:60371","proxyType":"manual","sslProxy":"localhost:60371"}}}}}]
>> 50:[0,3,"Marionette:Quit",{"flags":["eAttemptQuit"]}]
<< 60:[1,3,null,{"cause":"shutdown","forced":false,"in_app":true}]
t/01-marionette.t .. 104/? # Starting new firefox for testing PDFs and script elements
# Testing has been running for 18 seconds at t/01-marionette.t line 1369
t/01-marionette.t .. 105/? # WebGL is disabled by default when visible and addons are turned off
# Starting new firefox for testing logins
# Testing has been running for 19 seconds at t/01-marionette.t line 1586
t/01-marionette.t .. 130/? # WebGL appears to be enabled in headless mode (with addons => 1)
# Testing has been running for 22 seconds at t/01-marionette.t line 1638
# Starting new firefox for testing custom headers
# Testing has been running for 22 seconds at t/01-marionette.t line 1971
t/01-marionette.t .. 155/? # Starting new firefox for testing metacpan and iframe, with find, downloads, extensions and actions
# Testing has been running for 25 seconds at t/01-marionette.t line 2083
t/01-marionette.t .. 160/? **** DEPRECATED METHOD - using chrome_window_handle() HAS BEEN REPLACED BY window_handle() wrapped with appropriate context() calls **** at t/01-marionette.t line 2093.
t/01-marionette.t .. 161/? # Testing has been running for 28 seconds at t/01-marionette.t line 2109
**** DEPRECATED METHOD - using chrome_window_handle() HAS BEEN REPLACED BY window_handle() wrapped with appropriate context() calls **** at t/01-marionette.t line 2138.
**** DEPRECATED METHOD - using current_chrome_window_handle() HAS BEEN REPLACED BY window_handle() wrapped with appropriate context() calls **** at t/01-marionette.t line 2138.
**** DEPRECATED METHOD - using chrome_window_handles() HAS BEEN REPLACED BY window_handles() wrapped with appropriate context() calls **** at t/01-marionette.t line 2140.
**** DEPRECATED METHOD - using chrome_window_handles() HAS BEEN REPLACED BY window_handles() wrapped with appropriate context() calls **** at t/01-marionette.t line 2149.
**** DEPRECATED METHOD - using chrome_window_handles() HAS BEEN REPLACED BY window_handles() wrapped with appropriate context() calls **** at t/01-marionette.t line 2150.
**** DEPRECATED METHOD - using chrome_window_handles() HAS BEEN REPLACED BY window_handles() wrapped with appropriate context() calls **** at t/01-marionette.t line 2174.
**** DEPRECATED METHOD - using chrome_window_handles() HAS BEEN REPLACED BY window_handles() wrapped with appropriate context() calls **** at t/01-marionette.t line 2175.
# Switch to shadow root is broken:unknown command: WebDriver:SwitchToShadowRoot
**** DEPRECATED METHOD - list HAS BEEN REPLACED BY find **** at t/01-marionette.t line 2234.
# $firefox->active_frame is not supported for 108.0.1:unknown command: WebDriver:GetActiveFrame
# Starting new firefox for testing JSON from localhost and alerts
# Testing has been running for 28 seconds at t/01-marionette.t line 3336
** /Applications/Firefox.app/Contents/MacOS/firefox -marionette -safe-mode -headless -profile /var/folders/fg/9_qz5v5j3zz26b89h228s4qr0000gn/T/firefox_marionette_local_yVrsom6ru3r/profile --no-remote --new-instance
*** You are running in headless mode.
2023-01-07 07:29:27.589 plugin-container[12976:98825368] nil host used in call to allowsSpecificHTTPSCertificateForHost
2023-01-07 07:29:27.589 plugin-container[12976:98825368] nil host used in call to allowsAnyHTTPSCertificateForHost:
2023-01-07 07:29:27.592 plugin-container[12976:98825368] nil host used in call to allowsSpecificHTTPSCertificateForHost
2023-01-07 07:29:27.592 plugin-container[12976:98825368] nil host used in call to allowsAnyHTTPSCertificateForHost:
2023-01-07 07:29:27.592 plugin-container[12976:98825390] nil host used in call to allowsSpecificHTTPSCertificateForHost
2023-01-07 07:29:27.592 plugin-container[12976:98825390] nil host used in call to allowsAnyHTTPSCertificateForHost:
<< 50:{"applicationType":"gecko","marionetteProtocol":3}
>> 73:[0,1,"WebDriver:NewSession",{"capabilities":{"requiredCapabilities":{}}}]
<< 748:[1,1,null,{"sessionId":"5fe5242c-0ab5-45e2-bc2c-bceead891ed3","capabilities":{"browserName":"firefox","browserVersion":"108.0.1","platformName":"mac","acceptInsecureCerts":false,"pageLoadStrategy":"normal","setWindowRect":true,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"strictFileInteractability":false,"unhandledPromptBehavior":"dismiss and notify","moz:accessibilityChecks":false,"moz:buildID":"20221215175817","moz:headless":true,"moz:platformVersion":"21.6.0","moz:processID":12975,"moz:profile":"/var/folders/fg/9_qz5v5j3zz26b89h228s4qr0000gn/T/firefox_marionette_local_yVrsom6ru3r/profile","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"moz:windowless":false,"proxy":{}}}]
>> 29:[0,2,"WebDriver:GetTimeouts"]
<< 58:[1,2,null,{"implicit":0,"pageLoad":300000,"script":30000}]
>> 82:[0,3,"WebDriver:SetTimeouts",{"implicit":987654,"pageLoad":300000,"script":30000}]
<< 25:[1,3,null,{"value":null}]
t/01-marionette.t .. 412/? >> 33:[0,4,"WebDriver:GetCapabilities"]
<< 702:[1,4,null,{"capabilities":{"browserName":"firefox","browserVersion":"108.0.1","platformName":"mac","acceptInsecureCerts":false,"pageLoadStrategy":"normal","setWindowRect":true,"timeouts":{"implicit":987654,"pageLoad":300000,"script":30000},"strictFileInteractability":false,"unhandledPromptBehavior":"dismiss and notify","moz:accessibilityChecks":false,"moz:buildID":"20221215175817","moz:headless":true,"moz:platformVersion":"21.6.0","moz:processID":12975,"moz:profile":"/var/folders/fg/9_qz5v5j3zz26b89h228s4qr0000gn/T/firefox_marionette_local_yVrsom6ru3r/profile","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"moz:windowless":false,"proxy":{}}}]
>> 119:[0,5,"WebDriver:Navigate",{"sessionId":"5fe5242c-0ab5-45e2-bc2c-bceead891ed3","url":"http://[::1]:60491/?format=JSON"}]
# Accepted connection
# Got request for /?format=JSON
<< 25:[1,5,null,{"value":null}]
>> 84:[0,6,"WebDriver:GetPageSource",{"sessionId":"5fe5242c-0ab5-45e2-bc2c-bceead891ed3"}]
<< 195:[1,6,null,{"value":"<html><head><link rel=\"stylesheet\" href=\"resource://content-accessible/plaintext.css\"></head><body><pre>{ \"id\": \"5\", \"value\": \"sömething\"}</pre></body></html>"}]
>> 84:[0,7,"WebDriver:GetPageSource",{"sessionId":"5fe5242c-0ab5-45e2-bc2c-bceead891ed3"}]
<< 195:[1,7,null,{"value":"<html><head><link rel=\"stylesheet\" href=\"resource://content-accessible/plaintext.css\"></head><body><pre>{ \"id\": \"5\", \"value\": \"sömething\"}</pre></body></html>"}]
# { "id": "5", "value": "sömething"}
>> 84:[0,8,"WebDriver:GetPageSource",{"sessionId":"5fe5242c-0ab5-45e2-bc2c-bceead891ed3"}]
<< 195:[1,8,null,{"value":"<html><head><link rel=\"stylesheet\" href=\"resource://content-accessible/plaintext.css\"></head><body><pre>{ \"id\": \"5\", \"value\": \"sömething\"}</pre></body></html>"}]
>> 84:[0,9,"WebDriver:GetPageSource",{"sessionId":"5fe5242c-0ab5-45e2-bc2c-bceead891ed3"}]
<< 195:[1,9,null,{"value":"<html><head><link rel=\"stylesheet\" href=\"resource://content-accessible/plaintext.css\"></head><body><pre>{ \"id\": \"5\", \"value\": \"sömething\"}</pre></body></html>"}]
>> 119:[0,10,"WebDriver:Navigate",{"sessionId":"5fe5242c-0ab5-45e2-bc2c-bceead891ed3","url":"http://[::1]:60491/?format=txt"}]
# Accepted connection
# Got request for /?format=txt
<< 26:[1,10,null,{"value":null}]
>> 85:[0,11,"WebDriver:GetPageSource",{"sessionId":"5fe5242c-0ab5-45e2-bc2c-bceead891ed3"}]
<< 173:[1,11,null,{"value":"<html><head><link rel=\"stylesheet\" href=\"resource://content-accessible/plaintext.css\"></head><body><pre>This is ordinary text</pre></body></html>"}]
>> 85:[0,12,"WebDriver:GetPageSource",{"sessionId":"5fe5242c-0ab5-45e2-bc2c-bceead891ed3"}]
<< 173:[1,12,null,{"value":"<html><head><link rel=\"stylesheet\" href=\"resource://content-accessible/plaintext.css\"></head><body><pre>This is ordinary text</pre></body></html>"}]
# This is ordinary text
# Caught exception in content server:Caught a TERM signal at t/01-marionette.t line 94.
>> 68:[0,13,"WebDriver:ExecuteScript",{"script":"alert('testing alert')"}]
<< 26:[1,13,null,{"value":null}]
>> 31:[0,14,"WebDriver:GetAlertText"]
<< 37:[1,14,null,{"value":"testing alert"}]
t/01-marionette.t .. 420/? >> 31:[0,15,"WebDriver:DismissAlert"]
<< 26:[1,15,null,{"value":null}]
>> 101:[0,16,"WebDriver:ExecuteAsyncScript",{"script":"prompt(\"Please enter your name\", \"John Cole\");"}]
>> 60:[0,17,"WebDriver:SendAlertText",{"text":"Roland Grelewicz"}]
<< 843:[1,17,{"error":"no such alert","message":"","stacktrace":"RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8\nWebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:182:5\nNoSuchAlertError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:383:5\nGeckoDriver.prototype._checkIfAlertIsPresent@chrome://remote/content/marionette/driver.sys.mjs:2666:11\nGeckoDriver.prototype.sendKeysToDialog@chrome://remote/content/marionette/driver.sys.mjs:2642:8\ndespatch@chrome://remote/content/marionette/server.sys.mjs:303:40\nexecute@chrome://remote/content/marionette/server.sys.mjs:276:16\nonPacket/<@chrome://remote/content/marionette/server.sys.mjs:249:20\nonPacket@chrome://remote/content/marionette/server.sys.mjs:250:9\n_onJSONObjectReady/<@chrome://remote/content/marionette/transport.sys.mjs:496:20\n"},null]
>> 60:[0,18,"WebDriver:SendAlertText",{"text":"Roland Grelewicz"}]
<< 843:[1,18,{"error":"no such alert","message":"","stacktrace":"RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8\nWebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:182:5\nNoSuchAlertError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:383:5\nGeckoDriver.prototype._checkIfAlertIsPresent@chrome://remote/content/marionette/driver.sys.mjs:2666:11\nGeckoDriver.prototype.sendKeysToDialog@chrome://remote/content/marionette/driver.sys.mjs:2642:8\ndespatch@chrome://remote/content/marionette/server.sys.mjs:303:40\nexecute@chrome://remote/content/marionette/server.sys.mjs:276:16\nonPacket/<@chrome://remote/content/marionette/server.sys.mjs:249:20\nonPacket@chrome://remote/content/marionette/server.sys.mjs:250:9\n_onJSONObjectReady/<@chrome://remote/content/marionette/transport.sys.mjs:496:20\n"},null]
>> 60:[0,19,"WebDriver:SendAlertText",{"text":"Roland Grelewicz"}]
<< 843:[1,19,{"error":"no such alert","message":"","stacktrace":"RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8\nWebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:182:5\nNoSuchAlertError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:383:5\nGeckoDriver.prototype._checkIfAlertIsPresent@chrome://remote/content/marionette/driver.sys.mjs:2666:11\nGeckoDriver.prototype.sendKeysToDialog@chrome://remote/content/marionette/driver.sys.mjs:2642:8\ndespatch@chrome://remote/content/marionette/server.sys.mjs:303:40\nexecute@chrome://remote/content/marionette/server.sys.mjs:276:16\nonPacket/<@chrome://remote/content/marionette/server.sys.mjs:249:20\nonPacket@chrome://remote/content/marionette/server.sys.mjs:250:9\n_onJSONObjectReady/<@chrome://remote/content/marionette/transport.sys.mjs:496:20\n"},null]
>> 60:[0,20,"WebDriver:SendAlertText",{"text":"Roland Grelewicz"}]
<< 26:[1,16,null,{"value":null}]
<< 26:[1,20,null,{"value":null}]
**** DEPRECATED METHOD - using accept_dialog() HAS BEEN REPLACED BY accept_alert **** at t/01-marionette.t line 3461.
>> 31:[0,21,"WebDriver:AcceptDialog"]
<< 26:[1,21,null,{"value":null}]
>> 51:[0,22,"Marionette:Quit",{"flags":["eAttemptQuit"]}]
<< 61:[1,22,null,{"cause":"shutdown","forced":false,"in_app":true}]
t/01-marionette.t .. 425/? # Starting new firefox for testing proxy by argument, capabilities, window switching and certificates using proxy port TCP/60494
# Testing has been running for 33 seconds at t/01-marionette.t line 3623
t/01-marionette.t .. 659/? # Starting new firefox for testing %ENV proxy, min/maxing and killing firefox
# Testing has been running for 37 seconds at t/01-marionette.t line 3890
t/01-marionette.t .. 660/? # Final Browser version is 108.0.1
# WebGL (webgl2) is working correctly for 108.0.1 on darwin
t/01-marionette.t .. 1067/? 
#   Failed test 'Percentage visible is 100% for the username field:95.4545454545455'
#   at t/01-marionette.t line 4072.
# Killing PID 13002 with a signal 15
t/01-marionette.t .. 1080/? # Error Message was Firefox killed by a TERM signal (15)
# Total runtime is 46 seconds
# Looks like you failed 1 test of 1088.
t/01-marionette.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1088 subtests 
	(less 248 skipped subtests: 839 okay)
	(7 TODO tests unexpectedly succeeded)
t/02-taint.t ....... # Unable to exec firefox with PATH set to /usr/bin:/bin:/usr/local/bin.  No taint checks to be run
t/02-taint.t ....... ok   
t/manifest.t ....... skipped: Author tests not required for installation
t/pod-coverage.t ... ok     
t/pod.t ............ ok     

Test Summary Report
-------------------
t/01-marionette.t (Wstat: 256 (exited 1) Tests: 1088 Failed: 1)
  Failed test:  1079
  TODO passed:   37, 651, 661-662, 669-671
  Non-zero exit status: 1
Files=6, Tests=1151, 47 wallclock secs ( 0.09 usr  0.02 sys + 34.60 cusr  8.93 csys = 43.64 CPU)
Result: FAIL
Failed 1/6 test programs. 1/1151 subtests failed.
make: *** [test_dynamic] Error 255
  DDICK/Firefox-Marionette-1.34.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports DDICK/Firefox-Marionette-1.34.tar.gz

cpanm Firefox::Marionette

On Debian 11, standard installation. Firefox::Marionette installation fails, but /usr/bin/firefox exists.

cpanm (App::cpanminus) 1.7044 on perl 5.032001 built for x86_64-linux-gnu-thread-multi
Work directory is /root/.cpanm/work/1703291658.32257
You have make /bin/make
You have LWP 6.52
You have /bin/tar: tar (GNU tar) 1.34
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /bin/unzip
Searching Firefox::Marionette () on cpanmetadb ...
--> Working on Firefox::Marionette
Fetching http://www.cpan.org/authors/id/D/DD/DDICK/Firefox-Marionette-1.49.tar.gz
-> OK
Unpacking Firefox-Marionette-1.49.tar.gz
Entering Firefox-Marionette-1.49
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.44)
Configuring Firefox-Marionette-1.49
Running Makefile.PL
Running as root. Deleting the XAUTHORITY environment variable
/usr/share/applications/firefox-esr.desktop:[Desktop Entry]
/usr/share/applications/firefox-esr.desktop:Exec=/usr/lib/firefox-esr/firefox-esr %u
Mozilla Firefox cannot be discovered in /sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
-> N/A
-> FAIL Configure failed for Firefox-Marionette-1.49. See /root/.cpanm/work/1703291658.32257/build.log for details.

send special keys?

This is a follow-up on an earlier discussion, where it was suggested it would make for a good feature request.

It would be convenient to be able to send special-key combos to the window (or other elements), like say Ctrl+Shift+k to open the web console.

The reference implementation of the Marionette driver (a Python module) illustrates how to do this: the special keys are assigned codepoints in the Unicode Private Use Area, all of the form U+EXXX (rendered in Python as "\uexxx").

Other sources seem to agree on the encoding used by Firefox for these special keys.

current_chrome_window_handle and chrome_window_handle fail on FreeBSD 13.0

Hi.

I tried Firefox::Marionette on FreeBSD 13.0-p4 and I encountered the problem when calling current_chrome_window_handle and chrome_window_handle. It said "unknown command: WebDriver:GetCurrentChromeWindowHandle" and stopped.

This is the script I tried.

use strict;
use warnings;

use Firefox::Marionette;

my $firefox = Firefox::Marionette->new (
'visible' => 1,
'survive' => 1
);

sleep (3);

my $cu_handle = eval { $firefox->current_chrome_window_handle() };
if ($@)
{
print "current_chrome_window_handle failed $@\n";
}
my $ch_handle = eval { $firefox->chrome_window_handle() };
if ($@)
{
print "chrome_window_handle failed $@\n";
}

Firefox version on FreeBSD 13 is 94.0.

Lazy-loading doesn't work

I have this simple test script, but lazy-loading doesn't work:

#!/usr/bin/env perl
#
use strict;
use warnings;
use Data::Dumper;
use feature 'say';

use Firefox::Marionette;
use Firefox::Marionette::Keys qw( PAGE_DOWN );

my $url = 'https://www.komplett.no/category/10412/datautstyr/pc-komponenter/skjermkort';

my $firefox = Firefox::Marionette->new(
    'width'   => 1920,
    'height'  => 1080,
    'visible' => 1,
);

$firefox->go( $url );
sleep( 2 );

my $cookie_consent = $firefox->find_class( 'btn-large primary' );
if ( $cookie_consent ) {
    $cookie_consent->click;
}

my $html = $firefox->html;

while ( 1 ) {
    $firefox->chrome->perform(
        $firefox->key_down( PAGE_DOWN ),
        $firefox->pause( 1_500 ),
    )->release->content;

    if ( $firefox->html eq $html ) {
        last;
    }

    $html = $firefox->html;
}

$firefox->quit;

Cleanup of temporary marionette directory sometimes fails

In some situations the temporary directory /tmp/firefox_marionette_local_.......... is not removed after the using script terminated. This can be reproduced with a simple oneliner like

perl5.34.0 -MFirefox::Marionette -E '$fm=Firefox::Marionette->new;$fm->go("http://www.cpan.org");'

Adding $fm->quit seems to help in this situation. However, I see that a DESTROY method exists and it looks like it tries to cleanup this directory, but for some reason it fails.

File downloads always timeout

Hi, when downloading a file that is not directly opened by firefox, even the download finishes in a few seconds, the script does not return until it timeouts., and the exception breaks my loop.

This is a minimal example:

$firefox->go("https://github.com/david-dick/firefox-marionette/archive/refs/heads/master.zip")

does not return immediately.

moz:headless has not been determined correctly

moz:headless has not been determined correctly

The module was unable to correctly determine whether Firefox is running in "headless" or not. This is probably a bug in this module's logic. Please report as described in the BUGS AND LIMITATIONS section below.

Adding

    Carp::carp( '1 ' . $parameters->{'moz:headless'} );
    Carp::carp( '2 ' . JSON::is_bool( $parameters->{'moz:headless'} ) );
    Carp::carp( '3 ' . Dumper( $parameters->{'moz:headless'} ) );

before if ( defined $parameters->{'moz:headless'} ) { in the _create_capabilities quite often gives:

1 0 at ... line 37.
2 1 at ... line 37.
3 $VAR1 = bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' );
 at ... line 37.

though other times it gives: two ones in the first two positions.

But this happens only from mason application: I can't reproduce this calling Firefox::Marionette->new manually.

Seems to hang under some 32 bit Strawberry Perl versions

Hello,

For recently shipped Firefox-Marionettes, It seems to me that the test hangs under some 32 bit Strawberry Perl versions on Windows 7 32 bit as follows.
(I know Windows 7 is old OS.)

Strawberry Perl 5.26.1 32 bit

C:\home\bath1>cpan DDICK/Firefox-Marionette-1.48.tar.gz

(snip)

Running make test for DDICK/Firefox-Marionette-1.48.tar.gz
"C:\Strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harn
ess(0, 'blib\lib', 'blib\arch')" t/*.t
# Testing Firefox::Marionette 1.48
t/00.load.t ........ ok
# Version is Mozilla Firefox 115.4.0esr
# This firefox installation has 1 existing profiles
(hangs)

Strawberry Perl 5.24.0 32 bit

C:\home\west>cpan DDICK/Firefox-Marionette-1.48.tar.gz

(snip)

Running make test for DDICK/Firefox-Marionette-1.48.tar.gz
C:\"Strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test
_harness(0, 'blib\lib', 'blib\arch')" t/*.t
# Testing Firefox::Marionette 1.48
t/00.load.t ........ ok
# Version is Mozilla Firefox 115.4.0esr
# This firefox installation has 1 existing profiles
(hangs)

Strawberry Perl 5.18.4 32 bit

C:\home\journey>cpan DDICK/Firefox-Marionette-1.48.tar.gz

Running make test for DDICK/Firefox-Marionette-1.48.tar.gz
C:\"Strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test
(snip)

_harness(0, 'blib\lib', 'blib\arch')" t/*.t
# Testing Firefox::Marionette 1.48
t/00.load.t ........ ok
# Version is Mozilla Firefox 115.4.0esr
# This firefox installation has 1 existing profiles
(hangs)

The tests pass under Strawberry Perl 5.16.3 32 bit.
http://www.cpantesters.org/cpan/report/a6d7eafd-7058-1014-a358-b2c1e3396204

Thank you,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.