🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
Testing
This page was created by Edgar on 2024-08-22. Last edited by Wikiadmin on 2026-07-29.

Testing

Testing Turnkey applications with Selenium

Testing Turnkey applications with Selenium

Selenium can be used for scripted web testing of a Turnkey application. It can be used for application testing and for load testing with a small number of clients. Running parallel browser sessions requires substantial CPU and memory on the test server.

Create and run a browser test

  1. Install the Selenium IDE browser extension. For Chrome, open the Chrome Web Store, search for Selenium IDE, install the extension, and open it from the browser extensions menu.
  2. Create, edit, and run a test script in Selenium IDE on a local development machine.
  3. Save test projects in a local folder. Test files use the .side extension.

For the complete setup and execution guidance, see Selenium Testing.

Run saved tests from the command line

Use the Selenium command-line runner to run saved .side scripts separately from the browser used for development.

  1. Install Node.js with the Windows installer from nodejs.org.
  2. Install the Selenium command-line runner:
npm install -g selenium-side-runner
  1. In the folder containing the .side files, create a file named .side.yml. Unless overridden on the command line, the runner uses this file for all .side files in that folder.

If .side.yml does not contain a server: instruction, the runner uses a locally installed browser. With a server: instruction, the runner calls a Grid server for execution.

Run tests on Selenium Grid

Selenium Grid can run copies of a test sequentially or in parallel. The documented Windows setup uses WSL2, Docker Desktop, and SeleniumHQ Docker images.

  1. Install Windows Subsystem for Linux 2 (WSL2).
  2. Ensure that vCPU is enabled in the computer BIOS.
  3. Install Docker Desktop.
  4. Follow the SeleniumHQ docker-selenium instructions to run a Grid setup.
  5. Configure .side.yml with a server: instruction to execute tests on the Grid.

The documented setup and tests were performed on Windows 11.

See also

Testing and QA

Selenium can be used to test a Turnkey web application through its web interface. For application logic, a ViewModel can help keep transformations testable separately from the UI.

Selenium testing

Selenium tests websites and can be used for scripted web tests. It can support application testing and load testing. Browser-based load testing is suitable for a small number of clients because running parallel web browsers requires substantial CPU and memory on the test server.

Keep logic testable outside the UI

A ViewModel transforms part of the model for a specific purpose. Its purpose is often to prepare model information for a user interaction or UI, but it can also prepare data-transfer objects or reporting data.

Logic that is not unique to a UI should go in the model so it can be reused. Keeping transformations in a ViewModel allows the logic to be tested separately from the UI, rather than testing through screens and reading results back from the UI.

ViewModels can also support reuse when the same use case has different UIs, such as beginner and advanced interfaces.

Create and run a Selenium test locally

The simplest local workflow is to use the Selenium IDE browser plug-in. The available setup instructions were tested on Windows 11.

  1. Open the Chrome Web Store.
  2. Search for Selenium IDE.
  3. Add the extension to Chrome.
  4. Select the browser extension to open Selenium IDE.
  5. Create, edit, and run a script in Selenium IDE.
  6. Save test projects to a local folder of your choice.

Saved test files use the .side extension.

Run saved tests with the command-line runner

The Selenium command-line runner can run tests separately from the desktop browser and can use a Selenium Grid. The runner uses Node.js.

  1. Install Node.js from nodejs.org by using the Windows installer.
  2. After Node.js is installed, install the runner:
npm install -g selenium-side-runner

See Selenium Testing for command-line runner and Grid configuration details.

Choose local or Grid execution

In the folder containing the .side files, create a file named .side.yml. The command-line runner uses this file for all .side files unless command-line options override it.

Configuration Execution result
No server: instruction in .side.yml The runner uses the locally installed browser, as when running from Selenium IDE.
A server: instruction in .side.yml The runner calls the Grid server for execution.

Prepare a Selenium Grid

After a script does what is needed, Selenium Grid can run multiple copies of the test sequentially or in parallel.

  1. Install WSL2 on Windows.
  2. Ensure that vCPU is turned on in the BIOS.
  3. Install Docker Desktop.
  4. Use the SeleniumHQ Docker Selenium images and containers for the Grid setup.
  5. Read the SeleniumHQ Docker Selenium documentation when selecting a Grid setup.

Checklist

  • Save Selenium IDE projects in a known local folder.
  • Use the command-line runner when tests must run separately from the desktop browser or through a Grid.
  • Use .side.yml to choose local-browser or Grid-server execution.
  • Account for the CPU and memory required when parallel browser sessions are used.
  • Keep reusable transformations outside the UI so they can be tested separately.

See also