Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Relic Solution: Selenium IDE exporter for New Relic Synthetics

levelup

#1

TL;DR:

Check out the Selenium exporter to New Relic Synthetics: https://chrome.google.com/webstore/detail/synthetics-formatter-for/agedeoibceidbaeajbehgiejlekicbfd

What is the Selenium IDE Exporter?

Similar to the Katalon script exporter, Selenium IDE allows you to record the steps you want to monitor in Synthetics, by simply following those steps in your site.

The exporter allows you to take your Selenium script and format it in a way that can work in New Relic Synthetics.

In most cases, the Selenium IDE generates simple and easy to understand CSS selectors and XPath when compared to Katalon recorder. In a sample recording of navigating to the New Relic site and clicking a drop down item, the table below shows the different selector choices generated by each recorders:

Step Katalon Recorder Selenium IDE
Open www.newrelic.com - -
ClickProducts and Pricing xpath=(.//*[normalize-space(text()) and normalize-space(.)=‘WHY NEW RELIC’])[1]/following::span[1] css=#nav1 > .title
ClickNew Relic APM: Detailed performance metrics. For every app. In any environment. xpath=(.//*[normalize-space(text()) and normalize-space(.)=‘New Relic One’])[1]/following::img[1] linkText=Detailed performance metrics. For every app. In any environment.

Selenium IDE is a lot easier to read, right?

Selenium IDE also allows you to include the original Selenium code as comments when you export in a different format, as you will for Synthetics.

How do I use it?

There are a few setup steps, listed below;

  1. Download and install the Selenium IDE from the Chrome web store
  2. Download and install the New Relic Selenium IDE plugin from the Chrome web store.
    Start recording, when done export as New Relic Synthetics script by selecting New Relic Synthetics from the list of supported languages . For details on how to use the Selenium IDE code export functionality please go here.

Tasty Extras

  1. Enhanced “Step logging”.

Logging has been enhanced to generates custom Insights events for each “logged step”, for example calling logger.log() would generate an Insights event:

logger.log(1, “Open URL https://www.newrelic.com/”, “Open page”);

This makes it possible to inspect each steps and render the data in a chart like a funnel to show test completion.

Note : enhanced logging is DISABLED by default.


  1. Exporting a test suite would generate a single Synthetics script with multiple test cases.

As you can see below, there are two tests in the Test suite, coming through in one Synthetics script.

image


Support

Please note that this is offered for use as-is without warranty. You are free to use and modify as needed. It has been created for use with New Relic, but is not a supported product of New Relic.

If you do have any questions or enhancement requests, please add these to the Github Issues page. Feel free to add in your own pull requests too.


Inconsistent error when validating my script