mozilla / geckodriver

WebDriver for Firefox
https://firefox-source-docs.mozilla.org/testing/geckodriver/
Mozilla Public License 2.0
7.14k stars 1.52k forks source link

Non W3C Cap `platformVersion` is returned when a session is created #2023

Closed diemol closed 2 years ago

diemol commented 2 years ago

System

When a session is created, GeckoDriver is adding to the response the cap platformVersion, which is not a W3C WebDriver capability. It should be prefixed with moz: or removed.

Testcase

    FirefoxOptions options = new FirefoxOptions();
    options.setCapability(CapabilityType.PLATFORM_NAME, Platform.ANY);
    options.setHeadless(false);
    options.addArguments("--start-maximized");
    options.setUnhandledPromptBehaviour(UnexpectedAlertBehaviour.ACCEPT_AND_NOTIFY);
    options.setCapability(CapabilityType.ACCEPT_INSECURE_CERTS, true);
    options.setPageLoadStrategy(PageLoadStrategy.NORMAL); // https://www.skptricks.com/2018/08/timed-out-receiving-message-from-renderer-selenium.html
    options.setPageLoadTimeout(Duration.ofSeconds(30000));
    options.setScriptTimeout(Duration.ofSeconds(30000));
    return new FirefoxDriver(options);

Stacktrace

There is no stacktrace, but here is the response payload

{
  "value": {
    "sessionId": "e7f0db55-68d5-4f16-8f48-e8a568467579",
    "capabilities": {
      "acceptInsecureCerts": true,
      "browserName": "firefox",
      "browserVersion": "100.0.2",
      "moz:accessibilityChecks": false,
      "moz:buildID": "20220519220738",
      "moz:debuggerAddress": "localhost:55101",
      "moz:geckodriverVersion": "0.31.0",
      "moz:headless": false,
      "moz:processID": 30608,
      "moz:profile": "/var/folders/85/m0jdxw2j3yn9mrn_2dpnbsmm0000gn/T/rust_mozprofilejzNzai",
      "moz:shutdownTimeout": 60000,
      "moz:useNonSpecCompliantPointerOrigin": false,
      "moz:webdriverClick": true,
      "pageLoadStrategy": "normal",
      "platformName": "mac",
      "platformVersion": "21.5.0",
      "proxy": {},
      "setWindowRect": true,
      "strictFileInteractability": false,
      "timeouts": {
        "implicit": 0,
        "pageLoad": 30000000,
        "script": 30000000
      },
      "unhandledPromptBehavior": "accept and notify"
    }
  }

Trace-level log

whimboo commented 2 years ago

Thanks for this report! I filed as https://bugzilla.mozilla.org/show_bug.cgi?id=1771760.

whimboo commented 2 years ago

This will be fixed in the Firefox Nightly from today.

diemol commented 2 years ago

Thank you!