TestBench is based on Selenium and doesn’t contain any modifications to the grid hub/node part. This means that you can run TestBench tests on any available Selenium grid. Also, setting up a grid is exactly like setting up a Selenium grid.
Once you have Docker installed, you can create your own test grid, for example using
First, create the following
docker-compose.yaml in an empty folder:
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 like this:
|The communication protocol used by the grid is standardized, so it shouldn’t be critical to match the Selenium version on which TestBench is based with the version of the grid. If you run into some odd issues, try matching the versions. You can check the Selenium version for TestBench here|
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 of the instructions for Selenium apply also to TestBench.
The screenshot comparison feature requires that the user interface of the browser should stay constant. The exact features that interfere with testing depend on the browser and the operating system. These are in general the following:
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; and
Turn off the screen saver.
If you’re using Windows and Internet Explorer, you should also turn on
Allow active content to run in files on My Computer in
Vaadin TestBench includes an iPhone and an Android driver, with which you can test on mobile devices. The tests can be run in either a device or an emulator/simulator.
The actual testing is 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.