Home | RU | EN

Selenoid and Configuration Access

WARNING! I couldn't get Selenoid running on Windows 10 with certain versions of Docker Desktop (I don't remember which exactly, but below is a link to a working Docker Desktop for Windows 4.49.0 exe, it definitely works) and on MacBook with M1 chip (Apple Silicon), although there's a workaround for Mac (link), but it only works for Chrome version 91. I managed to run it only on Linux (Ubuntu; it will probably work on other Linux distributions too), on Windows 11, and on newer MacBooks. Link to 100% working Docker Desktop for Windows exe installer.

Typical errors when setting up Selenoid and running autotests

  1. Browser images specified in browsers.json are not downloaded.
    • Selenoid does not download browser images automatically, so tests don't start due to missing images. You need to manually download the browser images specified in the browsers.json file.
  2. There are syntax errors in browsers.json.
    • For "chrome" and "opera" browsers the path key in browsers.json must be "/", not "/wd/hub". For "firefox" the key stays "/wd/hub". Be careful with this, otherwise the browser won't start.
    • Typos in the image name or browser version tag in browsers.json (often confusion in the placement of underscores or colons when specifying image version; ChatGPT is guilty of this). For example, instead of selenoid/vnc_chrome:128.0 it's written selenoid/vnc_chrome_128.0.
  3. Path errors in docker-compose.yml (volumes).
    • Due to incorrect paths, Selenoid can't see browsers.json, UI doesn't connect to Selenoid, and videos aren't written. Check directory mounting (paths specified as volumes)—this is a common error.
  4. Video is not recorded because video recording is configured incorrectly.
    • Essentially, in docker-compose.yml you just need to add an environment variable with an absolute path to the video folder:
      environment:
        OVERRIDE_VIDEO_OUTPUT_DIR: /root/selenoid_with_video/video
      You can't use ${PWD} or ./video here—an absolute path is required! You can read more about this in the official documentation: aerokube.com/selenoid … video_recording.
    • Plus, people often forget to pre-download the recorder image (Selenoid won't download it itself and video recording won't work): docker pull selenoid/video-recorder:latest-release. You do not need to add this image to docker-compose.yml; it will start automatically—the main thing is to download it once.
    • You can't use headless mode in tests:
      Configuration.headless = true;
      The value should be removed completely or replaced with
      Configuration.headless = false;
      If there's no screen, there's nothing to record.
  5. Problems on Windows 10 with some versions of Docker Desktop and Mac with M1 chip.
    • Containers start, but the browser starts and immediately crashes. If you use Windows, download Docker Desktop version 4.49.0; for Mac there are workaround options only for Chrome version 91 ( link). Recommendation: use a Linux host or VM/VPS (e.g., Ubuntu Server 22.04, ≥10 GB disk, ≥2 GB RAM), a newer MacBook, or Windows 11.
  6. Common error: Incorrect IP address of the tested application in tests.
    • In a container, you can't use localhost to access an application running outside the container—specify the real host IP address.
      Correct example:
      Configuration.baseUrl = "http://192.168.0.127:3000";
      Incorrect example:
      Configuration.baseUrl = "http://localhost:3000";
      An IP address is required here, not localhost, because this URL is used in the address bar of the browser opened in the Docker container, and if you specify localhost, the container will assume the application is running inside the same container, but it is not.
  7. Manual browser check in UI.
    • In general, after installing Selenoid, Selenoid UI and downloading browser images, you need to make sure that browsers open at least manually, so that later, if something doesn't work, you can tell whether the issue is in the tests or in Selenoid configuration. For this, after starting Selenoid (docker-compose up -d), go to its IP_address:8080; at the top right there should be 2 CONNECTED labels, then go to the CAPABILITIES tab, select a browser from the dropdown list (if there's no list, the problem is with browsers.json or the path to it) and launch it manually. A browser window should appear. If it appears—congratulations, Selenoid is configured; now the main thing is to set everything up correctly in the tests themselves.