Plugin (formatter) for Se-builder that generates javascript from Se-builder scripts to use in New Relic Synthetics Scripted Browser tests.
- Download & install selenium-builder.
- Yes, you'll need FireFox too.
- 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.
- Se-builder will appear as a small icon that looks like a Lego piece in the Firefox add-ons toolbar. Click on that icon to load.
- If Se-builder does not show up, click on the Hamburger menu, click Customise, and drag the Se-builder icon from "Additional Tools and Features" on the left into the toolbar.
- Download the plugin
- Unzip the plugin into the
SeBuilder/plugins
directory on in your Firefox profile.- NOTE: The zip contains a folder called
nr_synthetics_formatter
. Move the FOLDER with enclosed files into the plugins directory, rather than moving the files themselves without the folder. - Can't find the Se-builder plugins directory? Check here
- NOTE: The zip contains a folder called
- Restart the se-builder if you still have it running. You don't have to restart Firefox, just exit and re-open Se-builder.
- 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.
- 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.
- 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.
- 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.
- 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.
Here are some common locations for the plugins directory:
- 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
- Open your Home folder in Finder.
- Right-click in the finder window and click "Show View Options", or open it by pressing ⌘-J.
- Check the box next to Show Library Folder.