Selenium + Geckodriver + firefox test throws various errors

0

I'm trying to make some simple selenium tests with firefox and can't make it working correctly. Task is avoid using driver manager and use Geckodriver.

Here is example of my code:

@Test
public void checkDownloadPage(){
    System.setProperty("webdriver.gecko.driver", "drivers/windows/geckodriver.exe");
    FirefoxProfile profile = new ProfilesIni().getProfile("TestAutomation");
    FirefoxOptions ffOptions = new FirefoxOptions();
    ffOptions.setProfile(profile);
    WebDriver driver = new FirefoxDriver(ffOptions);
    driver.navigate().to("https://selenium.dev");
    driver.quit();
}

Here is console output:

1616876616440   geckodriver INFO    Listening on 127.0.0.1:13593
1616876617340   mozrunner::runner   INFO    Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "--remote-debugging-port" "0" "-foreground" "-no-remote" "-profile" "C:\\Users\\Abaddon\\AppData\\Local\\Temp\\rust_mozprofiles624Y0"
DevTools listening on ws://localhost:54709/devtools/browser/c139d218-070e-445b-89fd-6067dbb4b52a
1616876618916   Marionette  INFO    Listening on port 54695
1616876619397   Marionette  WARN    TLS certificate errors will be ignored for this session
Mar 27, 2021 10:23:39 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
1616876620273   Marionette  INFO    Stopped listening on port 54695
!!! error running onStopped callback: TypeError: callback is not a function

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

1616876620574   RemoteAgent ERROR   unable to stop listener: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIWindowMediator.getEnumerator]"  nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "JS frame :: chrome://remote/content/cdp/observers/TargetObserver.jsm :: stop :: line 61"  data: no] Stack trace: stop()@TargetObserver.jsm:61
unwatchForTabs()@TargetList.jsm:71
unwatchForTargets()@TargetList.jsm:38
destructor()@TargetList.jsm:110
close()@RemoteAgent.jsm:124

===============================================
Default Suite
Total tests run: 1, Passes: 1, Failures: 0, Skips: 0
===============================================


Process finished with exit code 0

Versions of stuff I have in dependencies:

<version.testng>7.3.0</version.testng>
<version.selenium>4.0.0-beta-2</version.selenium>
<version.guava>30.1-jre</version.guava>
<version.slf4j.nop>2.0.0-alpha1</version.slf4j.nop>
<version.log4j>2.14.1</version.log4j>    
<version.download-maven-plugin>1.6.1</version.download-maven-plugin>
<version.chromedriver>89.0.4389.23</version.chromedriver>
<md5.chromedriver>0bf4bc39f34cee67f5f95afd8a24c191</md5.chromedriver>
<version.geckodriver>v0.29.0</version.geckodriver>
<md5.geckodriver>8e19f65e730bd5960e87c7e42c88c5a7</md5.geckodriver>
<maven.compiler.source>15</maven.compiler.source>
<maven.compiler.target>15</maven.compiler.target>

tried also with selenium 3.141.59, geckodriver both 32 and 64 bit, Firefox is 87.0 version

Would really like to understand how to get rid of that error messages.

selenium-webdriver
ui-automation
geckodriver
selenium-firefoxdriver
asked on Stack Overflow Mar 27, 2021 by Miamato

2 Answers

0

Best thing is to use wedDriver manager. This will automatically handle all your browser related versions. Instead of system.setProperty() use WebDriverManager.firefoxdriver().setup();

answered on Stack Overflow Mar 29, 2021 by nitish21gupta
0

There is an open bug about this: https://bugzilla.mozilla.org/show_bug.cgi?id=1598832

answered on Stack Overflow Apr 12, 2021 by JohnP2

User contributions licensed under CC BY-SA 3.0