Scripted Browser

A local runner for the New Relic Synthetics Scripted Browser

In a recent project we wanted to use a new feature offered by New Relic; development would be pretty much impossible using the remote dashboard alone, so I created a local runner that enables the New-Relic-specific Selenium syntax so you can run their examples out of the box and develop against their platform with ease.


New Relic came up with a solution for running Selenium on a scheduled frequency. It also features a performance dashboard and a data-driven SLA. This is a new feature offered under their Synthecits monitoring suite is called Scripting Monitors. The Selenium runner monitor type is called a “Scripted Browser.”

Scripted Browser uses a syntax for the runner that is unique to New Relic.

// Visit https://docs.newrelic.com
$browser.get("https://docs.newrelic.com");

Since Selenium testing is difficult locally, it’s 100X that as a website. I needed a local runner for their syntax, so it could be a copy-paste implementation.

Usage

npm install scripted-browser

This project has a detailed example in ./example. To run the example, cd into that directory, npm_install, and run commands from there.

Run

To run a test out of the ./spec folder

node node_modules/scripted-browser --run=search-a-website

I added the scriptedbrowser tag on Stack Overflow and was able to answer my own question in hopes that it helps the community.