aerokube / ggr

A lightweight load balancer used to create big Selenium clusters
https://aerokube.com/ggr/latest/
Apache License 2.0
314 stars 74 forks source link

Using W3C protocol extensions Selenoid labels are missing in log files #384

Closed martingrossmann closed 8 months ago

martingrossmann commented 12 months ago

With Selenium 4 I have to use the W3C protocol extensions for custom capabilties like for Selenoid.

Adding labels to selenoid:options they aren't visible any more in GGR logs:

Selenium 3 caps

{
  "browserName": "chrome",
  "enableVNC": true,
  "enableVideo": true,
  "goog:chromeOptions": {
    "args": [
      "--no-sandbox"
    ],
    "extensions": []
  },
  "labels": {
    "foo": "bar"
  },
  "version": "114",
  "videoName": "myvideoname.mp4"
}

results in GGR log 2023/09/15 14:32:36 [2731] [2.19s] [SESSION_CREATED] [test] [10.xx.xx.xx] [chrome-114 foo=bar] [192.168.xx.xx:5001] [129d5982f2c3221dd7faec52cff0e614] [1] [-] --> OK

Selenium 4 caps

{
  "browserName": "chrome",
  "goog:chromeOptions": {
    "args": [
      "--no-sandbox"
    ],
    "extensions": []
  },
  "selenoid:options": {
    "enableVNC": true,
    "videoName": "myvideoname.mp4",
    "enableVideo": true,
    "labels": {
      "foo": "bar"
    }
  },
  "version": "114"
}

results in GGR log 2023/09/15 14:37:44 [3226] [2.01s] [SESSION_CREATED] [test] [10.xx.xx.xx] [chrome-114] [192.168.xx.xx:5002] [14bba25c7a8c47b56aeb2fb0bf1f3cae] [1] [-] --> Not OK. Only browser was added, but no labels

martingrossmann commented 10 months ago

@vania-pooh Hi, can you confirm that? Could there be a workaround?

vania-pooh commented 9 months ago

@martingrossmann sorry for the delay. Checked source code. Currently selenoid:options namespace is not supported in Ggr. Ggr is only able to get keys either from desiredCapabilities or from capabilities > alwaysMatch \ firstMatch on the top level. So it will work like this:

{"capabilities": {"alwaysMatch": {"labels": {...}}}}

But this does not correspond to W3C standard. Probably we may need to add selenoid:options or ggr:options key and support it in Ggr.

gogro commented 8 months ago

please do if you find the time, would be much appreciated.

vania-pooh commented 8 months ago

This was released in https://github.com/aerokube/ggr/releases/tag/1.7.2.