fIa5h / newrelic-synthetics-sebuilder

Selenium Builder (aka Se-Builder) formatter for New Relic Synthetics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New Relic Synthetics
formatter for Selenium-builder

Plugin (formatter) for Se-builder that generates javascript from Se-builder scripts to use in New Relic Synthetics Scripted Browser tests.

IMPORTANT - Version Compatibility

Selenium Builder 3 Compatibility Update

I have tested the plugin with the new version of se-builder and it works fine! You can use that version if you want, installed from here: https://addons.mozilla.org/en-GB/firefox/addon/selenium-builder/

The only change in the installation is the location of the plugin. It is now placed in SeBuilder3/plugins instead of SeBuilder/plugins. Can't find the plugins directory? Check here!

Limitation of Selenium Builder 3: local playback does not work. If you want to record a script and replay it after tweaking, you'll need to run a Selenium Server somewhere. That's easy enough to do. It can be run locally on your laptop.

Selenium Builder 2 (aka Se-Builder) Compatibility

This formatter plugin is tested and compatible with the old version of Se-Builder, which is an unisgned plugin. The old version of Se-Builder no longer runs in Firefox by default. See https://support.mozilla.org/en-US/kb/add-on-signing-in-firefox for a workaround. NOTE: This workaround may not work for the most recent versions of Firefox. If that's the case, either use an older version of Firefox, or use Selenium Builder 3 (now that the plugin supports it).

Installation

Download the plugin: Download link

Install the prerequisites

  1. Download & install either Se-builder v2 or v3:
  2. Run Se-builder at least once before proceeding. Running it the first time creates the folder where you'll put the plugin. Run it by going to Tools > Web Developer > Launch Selenium Builder.

Install the plugin

  1. If you haven't already, Download the plugin!
  2. Unzip the plugin into the SeBuilder/plugins (v2) or SeBuilder3/plugins (v3) directory on in your Firefox profile. Your folder structure should look like this: Img of folder structure
    • Can't find the Se-builder plugins directory? Check here
  3. Restart the se-builder if you still have it running. You don't have to restart Firefox, just exit and re-open Se-builder.
  4. To verify that the plugin is loaded, click "Manage plugins" in the opening dialog box. You should see "New Relic Synthetics Formatter #.# Installed" in the Plugins list.
    • If the Manage Plugins page throws an error, don't fret! This may be a issue with se-builder that doesn't impact the plugin. If it does happen, try recording a simple script and exporting it. If you see "New Relic Synthetics (WebDriverJS)" in the File -> Export dialog, the plugin is working properly.
    • If it didn't load, try restarting Firefox entirely and then re-running Se-builder.

Using the formatter

  1. Write, record or open a test.
    • Be sure to create in "Selenium 2" format, or convert your existing script to it.
    • Check out the Se-builder Getting Started Guide for more details on creating/recording scripts.
  2. Export your test to Synthetics format
    • Once you have a script ready to export, in the menu bar, click File --> Export...
    • Click "New Relic Synthetics (WebDriverJS)"
    • Save the result to any name and location you want, so long as you can find it!
    • When saving, add ".js" to the end of the file name so that it looks pretty in your text editor of choice.
  3. Create a new Scripted Browser monitor in Synthetics
    • Click "Add New Monitor" in the main screen of Synthetics or visit https://synthetics.newrelic.com/accounts/[your_account_id]/monitors/new
    • Choose "Scripted Browser" as the monitor type, and then set the name, locations & frequency as you like.
    • In the "Script your steps" window, clear the contents there and paste the contents of your exported script.
    • Be sure to click "Validate" below this window pane to ensure that the script works properly.

Having issues?

  • Please submit an issue to this github repo by clicking the "Issues" link on the right-hand menu and then click "New Issue"
  • Please cut-and-paste the following detail into the issue:
    • Your original script created in se-builder - either in HTML or JSON format
    • The exported javascript file you pasted into Synthetics
    • The error messages and logs returned when you ran/validated your script
  • Please be patient! Unfortunately, maintaining this script is not my day job, but I will get to your issue as soon as I can.

Can't find the plugins directory?

Here are some common locations for the plugins directory:

SeBuilder v2

  • Mac: /Users/[you]/Library/Application Support/Firefox/Profiles/[your_profile]/SeBuilder/plugins
  • Win: C:/Users/[you]/Appdata/Roaming/Mozilla/Firefox/Profiles/[your_profile]/SeBuilder/plugins
  • Linux/Unix: ~/.mozilla/firefox/[your_profile]/SeBuilder/plugins

Selenium Builder 3

  • Mac: /Users/[you]/Library/Application Support/Firefox/Profiles/[your_profile]/SeBuilder3/plugins
  • Win: C:/Users/[you]/Appdata/Roaming/Mozilla/Firefox/Profiles/[your_profile]/SeBuilder3/plugins
  • Linux/Unix: ~/.mozilla/firefox/[your_profile]/SeBuilder3/plugins

Can't find the "Library" folder on your Mac?

It may be hidden from view in your Finder. Here's how to unhide it:

  1. Open your Home folder in Finder.
  2. Right-click in the finder window and click "Show View Options", or open it by pressing ⌘-J.
  3. Check the box next to Show Library Folder.

About

Selenium Builder (aka Se-Builder) formatter for New Relic Synthetics


Languages

Language:JavaScript 99.3%Language:Shell 0.7%