TL;DR:
Check out the Selenium exporter to New Relic Synthetics: Synthetics Formatter for Selenium IDE - Chrome Web Store
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â | - | - |
Click â Products and Pricing â | xpath=(.//*[normalize-space(text()) and normalize-space(.)=âWHY NEW RELICâ])[1]/following::span[1] | css=#nav1 > .title |
Click â New 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;
- Download and install the Selenium IDE from the Chrome web store
- 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
- 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.
- 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.
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.