Code Monkey home page Code Monkey logo

newrelic-synthetics-sebuilder's Introduction

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.

newrelic-synthetics-sebuilder's People

Contributors

sschwartzman avatar kenahrens avatar savs avatar skrath avatar mtscout6 avatar thande avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.