Unable to install Selenium::WebDriver in perl6 Unable to install Selenium::WebDriver in perl6 selenium selenium

Unable to install Selenium::WebDriver in perl6


Summary

  1. Like all Perl 5 or Perl 6 packages, the Selenium::WebDriver package includes a suite of tests that check that it appears to work properly on your system.1 This test suite gets run at the end of installation, i.e. the installer downloads the package, runs its builder code and only then runs its test suite. If there's an error, then (by default2) the installer displays error information and exits immediately. That's what it's done in your case.

  2. The current Selenium::WebDriver package was successfully installing 2 months ago complete with the message showing success on an Ubuntu for the same test that is a fail on your system. Then again, a search of the #perl6 logs for 'selenium' suggests that there may be an intermittent error with one of the modules that Selenium::WebDriver uses; this may indeed be the root of the problem.

  3. The README of the repo for Selenium::WebDriver begins with a link to a document that says the protocol it describes is "obsolete". The most recent item in the issue queue of the Selenium::WebDriver repo is titled "Add support for Firefox Marionette WebDriver". Please consider adding a comment to that issue pointing to this SO question if you think it's relevant.

  4. If you look at the error messages you'll see a Firefox test failed. One possibility is that there's an error in Firefox, or some related software, beyond official latest arch linux.


Some plausibly simple responses to the Firefox error message:

  1. Try manually loading Firefox before trying to install the Perl 6 package. Does that fix the problem?

  2. I don't know what options you have for making the Selenium::WebDriver package not see your Firefox other than completely uninstalling it, but maybe you can do that? Then try installing again (and the package will presumably then test/use, say, Chrome instead of Firefox).

  3. If that doesn't work, consider posting a new Selenium::WebDriver repo issue (and link to this SO question).


The top level error message is "Cannot obtain a session after 10 attempts". It's generated by line 66 of the package's lib/Selenium/WebDriver/Wire.pm6 file. I don't think that line helps much in this case but imo it's always worth taking at least a quick glance at the source code corresponding to error messages.

Looking at the next level down we see the error comes from "t/05-firefox.t line 45" which is my $driver = Selenium::WebDriver::Firefox.new;. It looks like it's trying to connect to Firefox and failing. Looking further up in that test script one can see that it thinks it found Firefox on your system (because the code block in unless which('firefox') { ... } clearly didn't trigger).

The deepest part of the error information shows that a "Javascript error" has been encountered, something to do with nsIAppStartup.trackStartupCrashEnd.


Often a problem is specific to the versions of software involved. The Selenium::WebDriver package version is clearly 0.0.1 but it would be nice to see the version info from the other main pieces involved including your Perl 6 compiler (perl 6 -V iirc), the installer (zef -V iirc), and your OS and Firefox. In this particular case I'm pretty sure the problem is not in your Perl 6 compiler (Rakudo) nor in the installer (zef) but I might be wrong and I still recommend you always consider including generous version info when you post your first version of a question.


1 The test suite for the Selenium::WebDriver package work as per Perl 6 testing guidelines in general and per the Testing section of the Selenium::WebDriver's repo README in particular.

2 You can usually force Perl installers to continue regardless if you know an error doesn't matter in your case. I think it's -force-test to force zef to continue testing rather than stop after the first error and -force-install to complete the install despite errors.