Test Runners

Selenium

Because Replay Browser lets you record anything that happens inside it, you can simply just point your test script to the Replay Browser binary and you are all set up.


1

Install Replay package

To start, you need to install @replayio/replay package to your project.

Terminal
npm i replayio
2

Set up the browser binary

In order to use Replay Browser in your Selenium scripts, you need to point your configuration to the Replay Browser binary. The getBrowserPath function will take care of locating the binary on your machine.

spec.js
1const { Builder, Browser, By, until } = require('selenium-webdriver');
2const chrome = require('selenium-webdriver/chrome');
3import { getBrowserPath } from "replayio";
4
5const chromiumPath = getBrowserPath();
6
7(async function test() {
8 let options = new chrome.Options();
9 options.setChromeBinaryPath(chromiumPath);
10
11 let driver = await new Builder()
12 .forBrowser(Browser.CHROME)
13 .setChromeOptions(options)
14 .build();
15
16 try {
17 await driver.get('http://localhost:3000');
18 await driver.findElement(By.xpath("//*[text()='Add to Cart']")).click();
19 await driver.wait(until.elementLocated(By.xpath("//*[text()='Product added to cart!']")), 5000);
20 } finally {
21 await driver.quit();
22 }
23})();
3

Run your tests

With configration set up, you can run your tests the same way as before. After your run finishes, your recordings will be stored locally.

4

Upload your replays

Upload your replays with the following command:

Terminal
replayio upload --all

To learn more see the docs on Replay CLI.

After you upload your recordings, you can view them in Test Suite Dashboard.

Read more

Learn how to manage your recordings, debug your app using Replay DevTools and more

Manage your recordings

Learn how to upload, remove and view your recordings using CLI

Replay DevTools

Learn how to use Replay DevTools to debug your tests.

Setting up a team

Learn how to create a team in the Replay App

Test Suite Management

Test Suite Dashboard helps you stay on top of your test suite health.

Previous
FAQ