tompurl / selenoid_presentation

A quick and dirty demo of Selenoid with a loose outline

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

README

Setup

Client

This codebase makes the following assumptions:

  1. You are using MacOS or a Linux distribution. If you’re using Windows you need to run this code from WSL.
  2. 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)

  1. Make sure you have Docker installed
  2. Follow these instructions to install and start Selenoid
  3. Also start selenoid-ui
  4. Visit http://your-server-or-computer-ip:8080

Selenium Grid (For comparison)

  1. Install Podman and podman-compose
  2. Run sudo docker-compose up in this directory from the command line
  3. Visit the management ui here: a. http://your-server-or-computer-ip:4444
  4. 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

  1. Install and configure Selenoid
  2. Run some manual tests using the VNC-based web interface
  3. Run some automated tests and view the recorded sessions
  4. 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

Step through simple-test.py

  • Make sure pepole know that it doesn’t use best practices

Run simple-test.py

  • 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

Run multi.sh

  • Show how Selenoid and Selenium Grid (SG) can simultaneously handle multiple requests, browsers, and versions

Run multimulti.sh

  • 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

About

A quick and dirty demo of Selenoid with a loose outline


Languages

Language:HTML 77.8%Language:Python 10.5%Language:Shell 10.5%Language:Nix 1.2%