2

I use selenium + opensuse + codeception + php7.3 + firefox91 + geckodriver

My acceptance.suite.yml

class_name: AcceptanceTester
modules:
    enabled:
         - WebDriver:
              url: 'http://suz97.rp.ru/'
              browser: firefox # 'chrome' or 'firefox'
         - Yii2:
              part: [ orm, fixtures ]
              entryScript: index.php

My php test is

<?php
    use yii\helpers\Url as Url;
    class LoginCest
    {
        public function ensureThatLoginWorks(\AcceptanceTester $I)
        {
        
            $I->amOnPage(Url::toRoute('/'));
            $I->see('login');

and selenium answer is

17:17:30.682 INFO [LocalDistributor.newSession] - Session request received by the distributor: 
 [Capabilities {browserName: firefox}]
1638454650685   geckodriver     INFO    Listening on 127.0.0.1:49233
1638454650695   mozrunner::runner       INFO    Running command: "/usr/bin/firefox" "--marionette" "-no-remote" "-profile" "/tmp/rust_mozprofileLUqga9"
1638454650965   Marionette      INFO    Marionette enabled
console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at /tmp/rust_mozprofileLUqga9/search.json.mozlz4", (void 0)))
console.error: Region.jsm: "Error fetching region" (new TypeError("NetworkError when attempting to fetch resource.", ""))
console.error: Region.jsm: "Failed to fetch region" (new Error("NO_RESULT", "resource://gre/modules/Region.jsm", 419))
1638454653723   Marionette      INFO    Listening on port 38273
17:17:33.835 INFO [ProtocolHandshake.createSession] - Detected dialect: W3C
17:17:33.837 INFO [LocalDistributor.newSession] - Session created by the distributor. Id: 750142cf-f983-4263-93c1-6068155dddc5, Caps: Capabilities {acceptInsecureCerts: false, browserName: firefox, browserVersion: 91.3.0, moz:accessibilityChecks: false, moz:buildID: 20211028170545, moz:geckodriverVersion: 0.30.0, moz:headless: false, moz:processID: 23483, moz:profile: /tmp/rust_mozprofileLUqga9, moz:shutdownTimeout: 60000, moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platformName: linux, platformVersion: 5.3.18-lp152.41-default, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
1638454654371   Marionette      INFO    Stopped listening on port 38273
JavaScript error: resource://activity-stream/lib/ActivityStreamPrefs.jsm, line 27: NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIPrefBranch.removeObserver]
JavaScript error: resource:///modules/Interactions.jsm, line 209: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIUserIdleService.removeIdleObserver]
JavaScript error: resource://gre/modules/AsyncShutdown.jsm, line 718: Error: Phase "Sqlite.jsm: wait until all connections are closed" is finished, it is too late to register completion condition "protections.sqlite#0: waiting for shutdown"
JavaScript error: resource://activity-stream/lib/PlacesFeed.jsm, line 173: NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsINavBookmarksService.addObserver]
JavaScript error: resource://gre/modules/ExtensionSettingsStore.jsm, line 122: Error: The ExtensionSettingsStore was accessed before the initialize promise resolved.
console.log: "RemoteSettingsWorker error: Error: Can't import when we've started shutting down."
console.error: "Could not load engine google@search.mozilla.org: [Exception... \"AddonManager is not initialized\"  nsresult: \"0xc1f30001 (NS_ERROR_NOT_INITIALIZED)\"  location: \"JS frame :: resource://gre/modules/AddonManager.jsm :: installBuiltinAddon :: line 2536\"  data: no]"
console.warn: SearchService: "_init: abandoning init due to shutting down"
JavaScript error: , line 0: uncaught exception: 2147500036
JavaScript error: resource://gre/modules/JSONFile.jsm, line 196: Error: Data is not ready.
JavaScript error: , line 0: AbortError: A request was aborted, for example through a call to IDBTransaction.abort.

###!!! [Parent][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost

what could be the problem ?

Error snapshot:

enter image description here

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Роман
  • 31
  • 2

1 Answers1

0

This error message...

console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at /tmp/rust_mozprofileLUqga9/search.json.mozlz4", (void 0)))

...implies that Selenium driven GeckoDriver was unable to initiate Browsing Context.


Possibly you have stepped into the classic case of rust_mozprofile folders are cluttering TEMP.

As @andreastt mentions:

It’s a known bug that geckodriver sometimes leaves the throwaway profile behind, see #299.

Setting the TMPDIR environment variable is the only way to configure where the throwaway profiles are created. You don’t have to set it system-wide: just make sure it is part of the geckodriver process’ environment before it is started:

% TMPDIR=/some/location ./geckodriver

@andreastt further added:

I just discovered that TMPDIR only applies to Unix systems. On Windows the following variables are read, in order:

  • TMP
  • TEMP
  • USERPROFILE

Quick Solution

A quick solution would be to delete the rust_mozprofile sub-directories from the temp directories.


tl; dr

Retrieve the crash data

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352