> Markdown version of [Setting up your Own Test Grid](https://vaadin.com/docs/v14/tools/testbench/testbench-own-grid). Section index: [llms.txt](https://vaadin.com/docs/v14/tools/llms.txt)

# <a id="testbench.gridsettings"></a>Setting up your Own Test Grid

## <a id="testbench.grid.selenium-dockersetting"></a>Setting up the Docker Based Selenium Grid

There are ready made Docker images for setting up a Selenium Grid available at <https://github.com/SeleniumHQ/docker-selenium>. To use the images, you first need to install [Docker](https://www.docker.com/). Once you have Docker installed, you can create your own test grid e.g. using `docker-compose`.

First create the following `docker-compose.yaml` in an empty folder:

```yaml
version: '2'
services:
  firefox:
    image: selenium/node-firefox:3.9.1-actinium
    volumes:
      - /dev/shm:/dev/shm
    depends_on:
      - hub
    environment:
      HUB_HOST: hub

  chrome:
    image: selenium/node-chrome:3.9.1-actinium
    volumes:
      - /dev/shm:/dev/shm
    depends_on:
      - hub
    environment:
      HUB_HOST: hub

  hub:
    image: selenium/hub:3.9.1-actinium
    ports:
      - "4444:4444"
```

This defines a grid with one Chrome node and one Firefox node in addition to the hub.

The whole grid can then be started as

```
docker-compose up
```

This will start a grid on <http://localhost:4444>, with the console at <http://localhost:4444/grid/console> so you can run your tests on the hub using `@RunOnHub("localhost")`.

> **Note:** The communication protocol used by the grid is standardized so it should not be critical to match the Selenium version that TestBench is based on with the version of the grid. If you run into some strange issues, try matching the versions. You can check the Selenium version for TestBench [here](https://github.com/vaadin/testbench/blob/master/vaadin-testbench-core/pom.xml)

## <a id="testbench.grid.selenium-docker"></a>Setting up a Custom Selenium Grid

The process for setting up your own custom Selenium grid is described at <https://seleniumhq.github.io/docs/grid.html#rolling_your_own_grid>. All the instructions for Selenium apply also for TestBench.

## <a id="testbench.grid.node.screenshot-settings"></a>Settings for Screenshots

The screenshot comparison feature requires that the user interface of the browser stays constant. The exact features that interfere with testing depend on the browser and the operating system.

In general:

- Disable cursor blinking

- Use the exact same operating system and browser version on every host

- Turn off any software that may suddenly pop up a new window

- Turn off the screen saver

If you are using Windows and Internet Explorer, you should also turn on `Allow active content to run in files on My Computer` in `Security settings`.

## <a id="testbench.grid.mobile"></a>Mobile Testing

Vaadin TestBench includes an iPhone and an Android driver, with which you can test on mobile devices. The tests can be run either in a device or in an emulator/simulator.

The actual testing is just like with any WebDriver, using either the `IPhoneDriver` or the `AndroidDriver`. The Android driver assumes that the hub (`android-server`) is installed in the emulator and forwarded to port 8080 in localhost, while the iPhone driver assumes port 3001. You can also use the `RemoteWebDriver` with either the `iphone()` or the `android()` capability, and specify the hub URI explicitly.

The mobile testing setup is covered in detail in the Selenium documentation for both the [iOS driver](https://ios-driver.github.io/ios-driver/) and the [AndroidDriver](https://selendroid.io/mobileWeb.html).

`84E12224-214F-4FD6-BEAB-7A4DAC9F8201`
