README
Setup
Client
This codebase makes the following assumptions:
- You are using MacOS or a Linux distribution. If you’re using Windows you need to run this code from WSL.
- You have installed the Nix Package Manager.
Run the following commands to install the dependencies:
nix-shell
poetry lock
poetry intall
# "Drop" into a shell instance with all dependencies
poetry shell
# Running this command without arguments will show you a usage statement
./simple-test.py
If you are familiar with the Python ecosystem you can also simply use whichever Python 3 runtime you prefer and install the =selenium= library using =pip=.
Now you can execute the scripts below.
Server (which can be the same ast the Client)
Selenoid (Simplest by far, default)
- Make sure you have Docker installed
- Follow these instructions to install and start Selenoid
- Also start
selenoid-ui
- Visit http://your-server-or-computer-ip:8080
Selenium Grid (For comparison)
- Install Podman and
podman-compose
- Run
sudo docker-compose up
in this directory from the command line - Visit the management ui here: a. http://your-server-or-computer-ip:4444
- If you want to interact with the MicrosoftEdge instance visit this url: a. http://your-server-or-computer-ip:7900
Selenoid Presentation
Abstract
Have you ever wanted to test something using a browser that wasn’t installed on your machine Maybe the browser is installed but you need multiple versions?
Automated browser tests can save a lot of time, but watching those tests run for failures can be a huge drain on your productivity. Wouldn’t it be nice if you could record your test sessions in the background so you can watch a replay later?
You can do all of this easily using hosted services like Browserstack, but they can be fairly expensive. Also, many such services try to lock you into proprietary testing frameworks. Wouldn’t it be nice to find an open source alternative that was easy to setup?
Selenoid is the tool that can do all of this. It’s a free server that implements the Selenium Grid API plus a lot more. And because it uses Docker you can set it up on practically any machine in less than 10 minutes.
My presentation will consist of a live demo where I will
- Install and configure Selenoid
- Run some manual tests using the VNC-based web interface
- Run some automated tests and view the recorded sessions
- Time permitting I will also discuss the advantages of Selenoid over Selenium Grid.
Outline
Install and configure Selenoid
Download binary
Discuss prerequisites
Start selenoid with a new config
Start selenoid-ui
Visit web interface
Run some manual tests using the VNC-based web interface
Launch latest Chrome
Perform a search using Wikipedia
Run some automated tests and view the recorded sessions
simple-test.py
Step through - Make sure pepole know that it doesn’t use best practices
simple-test.py
Run - Show the VNC web interaface
- Show the recorded video
- Mention:
- This setup it much, much easier than the default way requiring a local web driver exe
- You don’t need to worry about “avoiding the test browser window”. Everything’s in the background
- You can do other things while the test is running and then watch the video only if the test fails at your convenience
multi.sh
Run - Show how Selenoid and Selenium Grid (SG) can simultaneously handle multiple requests, browsers, and versions
multimulti.sh
Run - Show how Selenoid and SG can queue up requests
Time permitting I will also discuss the advantages of Selenoid over Selenium Grid.
Advantages of Selenium Grid
- Free and FOSS
- Works in Kubernetes very easily (again, for free)
- Moon works on Kubernetes, but it’s not FOSS
- HUGE community
Advantages of Selenoid
- UI
- Web VNC
- Simpler Setup on a desktop
- Very simple video recordings
- Web video organizer and viewer
What’s Missing?
- Mobile testing
- It’s possible with both frameworks but requires extra lifting
- Comparisons with hosted providers