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

CapabilitiesHandler only accepts String capability values #409

Closed
cwensel opened this issue Sep 12, 2023 · 2 comments
Closed

CapabilitiesHandler only accepts String capability values #409

cwensel opened this issue Sep 12, 2023 · 2 comments

Comments

@cwensel
Copy link

cwensel commented Sep 12, 2023

Description of the problem:

when writing a template test, and browsers.json has a capability, it must be of type String. But when the capability is passed down, creating the remote driver fails as the value is expected to be a Boolean.

      {
        "type": "chrome",
        "capabilities": {
          "acceptInsecureCerts": "true"
        }
      }

if you change the type to boolean, the reflection invocation fails.

Method setCapabilityMethod = optionsClass
.getMethod("setCapability", String.class, String.class);

Note, support for both boolean and map value arguments would be welcome.

      {
        "type": "chrome",
        "capabilities": {
          "acceptInsecureCerts": true,
          "selenoid:options": {
            "enableVideo": true,
            "enableLog": true,
            "hostsEntries": "host.docker.internal:host-gateway"
          }
        }
      }

Browser and version:

All browsers.

Selenium-Jupiter version:

io.github.bonigarcia:selenium-jupiter:4.3.6

Selenium-Jupiter traces:

2023-09-12 14:44:30 [main] TRACE i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(86) -- Requesting http://localhost:56814/wd/hub (the response code is 200)
2023-09-12 14:44:31 [main] TRACE i.g.b.wdm.webdriver.WebDriverCreator.createRemoteWebDriver(96) -- SessionNotCreatedException creating WebDriver object (Could not start a new session. Response code 400. Message: invalid argument: entry 0 of 'firstMatch' is invalid
from invalid argument: cannot parse capability: acceptInsecureCerts
from invalid argument: must be a boolean 

Error trace:

@bonigarcia
Copy link
Owner

Thanks for reporting. I'll look into it as soon as I find some time.

@bonigarcia
Copy link
Owner

This should be fixed in Selenium-Jupiter 5.0.0, just released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants