Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

FluentConfiguration capabilities fails to set capabilities for multiple browsers #1214

Open
davidje13 opened this issue Mar 6, 2021 · 1 comment
Labels
Milestone

Comments

@davidje13
Copy link

The following configuration results in only Chrome being headless:

@FluentConfiguration(
        webDriver = "chrome",
        capabilities = ("{" +
                "\"moz:firefoxOptions\": {\"args\": [\"-headless\"]}," +
                "\"goog:chromeOptions\": {\"args\": [\"headless\", \"disable-gpu\"]}" +
                "}")
)

(when switching to firefox using -Dfluentlenium.webDriver=firefox at invocation, it does not run in headless mode).

However, if we rename the goog:chromeOptions entry, it works in FireFox (obviously fails in Chrome):

@FluentConfiguration(
        webDriver = "chrome",
        capabilities = ("{" +
                "\"moz:firefoxOptions\": {\"args\": [\"-headless\"]}," +
                "\"nope:chromeOptions\": {\"args\": [\"headless\", \"disable-gpu\"]}" +
                "}")
)

And if we build the configuration manually instead of via the JSON parsing, it works for both Chrome and FireFox:

    @Override
    public Capabilities getCapabilities() {
        MutableCapabilities capabilities = new MutableCapabilities();
        capabilities.setCapability(FirefoxOptions.FIREFOX_OPTIONS, new FirefoxOptions().addArguments("-headless"));
        capabilities.setCapability(ChromeOptions.CAPABILITY, new ChromeOptions().addArguments("headless", "disable-gpu"));
        return capabilities;
    }

I don't understand the difference between specifying the config as a string in the annotation and building it programmatically. I would like to be able to configure it without code (i.e. without a compile-time dependency on FirefoxOptions / ChromeOptions) with support for multiple browsers (switchable via the fluentlenium.webDriver flag).


  • Fluentlenium 4.5.1
  • Selenium 3.141.59
  • macOS 10.14.6
  • Firefox 86.0 / geckodriver 0.29.0
  • Chrome 89.0.4389.82 / chromedriver 89.0.4389.23
@filipcynarski
Copy link
Member

It looks like a defect, we should be able to handle it

@filipcynarski filipcynarski added this to the 6.1.0 milestone Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants