0

I get the next error when I try to run my selenide tests againt selenoid. Could you please help to understand what goes wrong?

Caused by: java.lang.IllegalArgumentException: Illegal key values seen in w3c capabilities: [enableVNC]

Here is my docker compose:

version: '3.8'

services:
  selenoid:
    image: aerokube/selenoid:latest-release
    container_name: selenoid
    network_mode: bridge
    ports:
      - "4444:4444"
    volumes:
      - ".:/etc/selenoid"
      - "/var/run/docker.sock:/var/run/docker.sock"
    command: ["-limit=4", "-capture-driver-logs", "-max-timeout=0h5m0s"]

  selenoid-ui:
    image: aerokube/selenoid-ui:latest-release
    container_name: selenoid-ui
    network_mode: bridge
    ports:
      - "8080:8080"
    links:
      - selenoid
    depends_on:
      - selenoid
    command: [ "--selenoid-uri", "http://selenoid:4444" ]

  chrome113:
    image: selenoid/vnc_chrome:113.0

And here is my code to determine browser:

import static com.codeborne.selenide.Configuration.*;

browser = CHROME;
        browserVersion = "113.0";
        browserSize = "1920x1080";     
        capabilities.setCapability("enableVNC", true);
        browserCapabilities = capabilities;

selenide.remote=http://localhost:4444/wd/hub

Help please to understand what can be wrong. Thank you in advance.

RESOLVED:

ChromeOptions options = new ChromeOptions();
    options.setCapability("browserVersion", "113.0");
    options.setCapability("selenoid:options", new HashMap<String, Object>() {{
        /* How to add test badge */
        put("name", scenario.getName());
        /* How to set session timeout */
        put("enableVideo", true);
        put("enableVNC", true);
        put("videoName", scenario.getName());
    }});
    browserCapabilities = options;

1 Answers1

1

Selenoid capabilities in W3C standard should go under vendor prefix. In case of Selenoid this prefix is selenoid:options. So enableVNC and other Selenoid-specific capabilities should live under selenoid:options key. https://aerokube.com/selenoid/latest/#_specifying_capabilities_via_protocol_extensions

vania-pooh
  • 2,933
  • 4
  • 24
  • 42
  • Thank you a lot for your previous answer. One more question from the "selenoid" topic. I am trying to record video and configure place to store it in the following way in docker compose (see next comment please) – Katerina Zharkaya Jun 18 '23 at 17:19
  • `selenoid: image: aerokube/selenoid:latest-release container_name: selenoid network_mode: bridge ports: - "4444:4444" volumes: - ".:/etc/selenoid" - "/var/run/docker.sock:/var/run/docker.sock" ** - "/video:/opt/selenoid/video"** environment: - OVERRIDE_VIDEO_OUTPUT_DIR=/video command: ["-conf", "/etc/selenoid/browsers.json", "-limit", "4", "-video-output-dir", "/opt/selenoid/video"]` – Katerina Zharkaya Jun 18 '23 at 17:20
  • As a result I can see the video inside container in folder /opt/selenoid/video, but can't find /video folder on my host machine. Where is it stored? it is absent in the root (I read that it should be absolute path). If I run test execution on Jenkins what is the better way to configure mapping for video folder on host to have videos not only in container. Thank you in advance! – Katerina Zharkaya Jun 18 '23 at 17:20
  • Make sure you have sufficient permissions on /video directory on the host machine. – vania-pooh Jun 19 '23 at 08:34