Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[🐛 Bug]: Browser version labels (stable, beta, dev, nightly) are not supported in Firefox (java) #12633

Closed
bonigarcia opened this issue Aug 29, 2023 · 4 comments · Fixed by #12639

Comments

@bonigarcia
Copy link
Member

bonigarcia commented Aug 29, 2023

What happened?

Selenium 4.12.0 delivers automated browser management of Firefox through Selenium Manager 0.4.12. Nevertheless, the browser version labels (stable, beta, dev, nightly) are not supported in the Java bindings. I don't know if this problem is Java-specific or also applies to other bindings.

How can we reproduce the issue?

The following test reproduces this issue:

package org.openqa.selenium;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;

class MyBasicTest {

    WebDriver driver;

    @BeforeEach
    void setup() {
        FirefoxOptions options = new FirefoxOptions();
        options.setBrowserVersion("beta");
        driver = new FirefoxDriver(options);
    }

    @AfterEach
    void teardown() {
        driver.quit();
    }


    @Test
    void basicTest() {
        driver.get("https://bonigarcia.dev/selenium-webdriver-java/");
    }

}

Even when Firefox beta is in the cache (it would need #12632), the test fails as follows:

Relevant log output

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Unable to find a matching set of capabilities 
Host info: host: 'slimbook', ip: '127.0.1.1'
Build info: version: '4.12.0-SNAPSHOT', revision: 'Unknown'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.0-79-generic', java.version: '17.0.5'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: beta, moz:debuggerAddress: true, moz:firefoxOptions: {binary: /home/boni/.cache/selenium/...}}]}]
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:140)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:96)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:68)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163)
	at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:196)
	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:171)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:602)
	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:163)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:156)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:151)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:132)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:127)
	at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:112)
	at org.openqa.selenium.MyBasicTest.setup(MyBasicTest.java:34)

Operating System

Reproduced in Windows and Linux

Selenium version

4.12.0-SNAPSHOT

What are the browser(s) and version(s) where you see this issue?

Firefox 117

What are the browser driver(s) and version(s) where you see this issue?

geckodriver 0.33.0

Are you using Selenium Grid?

No

@diemol
Copy link
Member

diemol commented Aug 29, 2023

I think the problem is GeckoDriver. What happens if you post this payload to GeckoDriver?

{
  "capabilities": {
		"alwaysMatch": {
			"browserName": "firefox",
			"browserVersion": "beta",
			"moz:firefoxOptions": {
				"binary": "path/to/binary"
			}
		},
    "firstMatch": [{}]
  }
}

@github-actions
Copy link

@bonigarcia, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@titusfortner
Copy link
Member

Copy link

github-actions bot commented Dec 7, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 7, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants