Solve API problems fast with Runscope. Learn More →

Ghost Inspector Joins Runscope on Quest for Better Software

By John Sheehan on .

Just over a year ago we launched Runscope Radar, bringing automated integration testing of APIs to the cloud. Radar has resonated with individual developers and enterprise QA teams alike, helping tens of thousands of developers ship better APIs, and ultimately better app experiences.

Meanwhile in Brooklyn, a developer named Justin Klemm was unhappy with the complicated state of automated browser testing products and decided to build a better one. The result was Ghost Inspector, the easiest way to automatically run cloud-based UI tests for your websites, without having to write any code. Hundreds of companies like Anthropologie, Hint Health and Binary.com have been using Ghost Inspector to do automated regression and integration testing for their web sites.

After spending some time with Justin and Ghost Inspector, it became apparent that we shared a vision for helping developers build better applications and that the best way to achieve that vision was to work together.

Runscope and Ghost Inspector: Joining Forces

Today we're excited to announce that Runscope has acquired Ghost Inspector! Justin joined the Runscope team a few weeks ago and will be focusing his efforts on making Ghost Inspector a best-in-class tool. We've got a lot to build, but just like with all our other tools, the direction is heavily influenced by your feedback.

Ghost Inspector will continue to run as a standalone service, but tightly-integrated with Runscope. The first integration is available today and allows you to run your Ghost Inspector UI tests as part of a Runscope Radar API test. One scenario this enables is end-to-end testing of APIs that use OAuth. Ghost Inspector takes care of the web-based authorization flow, and Runscope Radar takes care of exercising the API with the dynamically generated access token. A detailed overview of the integration can be found here.

Special Ghost Inspector Offer for Runscope Customers

We want to help our existing customers get up and running with Ghost Inspector as quickly as possible. Runscope customers on a paid plan will receive a special Ghost Inspector plan that allows for 5000 test runs per month, absolutely free. Runscope customers on a free plan will receive a plan that allows for 1000 test runs per month. Head over to the redemption page to claim this offer.

Extra Special Offer: Pre-pay and Save

Have some budget left and want to get a jump on equipping your team with the best testing tools for next year? Pre-pay for 12 months of any plan for either Runscope or Ghost Inspector and save 10%. Pre-pay for both and save 25%. Contact our sales team to take advantage of this offer by December 31st, 2014.

Categories:

API Tests Level Up: Automated Browser Test Steps with Ghost Inspector

By Neil Mansilla on .

Today we announced that Runscope has acquired Ghost Inspector, a cloud-based browser testing service. In addition to letting you quickly create UI tests for your websites without writing any code, Ghost Inspector is also integrated with Runscope Radar so you can add UI test steps to your automated API tests.

Browser Test, Meet API Test

So, what are some use cases that intersect UI and API testing? For an API that integrates into web applications, there are a multitude. Combining Runscope with Ghost Inspector can help create end-to-end test coverage, from the backend to the front end, and all of the interactions in between.

A great example at this intersection is OAuth. Runscope is already capable of testing OAuth protected services by fetching access tokens programmatically; however, for 3-legged flows, where the end-user is directed to the OAuth provider for credentials and scope/permission, a browser testing tool is best suited because that authorization interface is designed for humans, not machines.

Walkthrough: Testing an OAuth API From End-to-End

By combining the capabilities of Runscope and Ghost Inspector, we are now able to perform comprehensive end-to-end application and API integration testing and monitoring. Lets go ahead and create a sample test that will perform the following tasks:

1.  Test the UI of an OAuth sign in process using Ghost Inspector

2.  Using the authorization code from the previous step, test the OAuth API by exchanging the auth code for an access token using Runscope

3.  Using the access token from the previous step, test the actual API by fetching protected user resource information using Runscope

We’re going to use the GitHub API for this example. Many of you are familiar with GitHub, and their API is well documented. 

Creating a Ghost Inspector Test

Ghost Inspector supports two ways for creating tests:

  • Manually - you provide the starting URL and define each test step by hand
  • Automatically - using a Chrome extension, a live web session is recorded and all test steps are automatically imported into Ghost Inspector

For this example, we’ll build our UI test manually, which is much easier than it sounds. Our test will cover signing in to a web application using GitHub credentials. We’ve stood up a simple web application that handles the OAuth sign in process. Lets begin with the steps for creating our Ghost Inspector UI test:

1.  Sign up for Ghost Inspector. Create a free account and sign in.

2.  Create a Test Suite, which is similar to a Runscope bucket.

3.  Create a new test. We’ll name the test, “BabyUnicornMagic Sign In with GitHub”, set the start URL to the front page of the web app, and use a blank test template, because we’ll be adding our own steps. 

4.  Add the steps. After the test is created, click on the Add Steps button. We’re going to add five steps to our Ghost Inspector test. These steps will take care of singing into the web app with our GitHub credentials.

Ghost Inspector uses CSS selectors to identify elements to interact with on a page. Recent versions of Chrome or Firefox can help to extract the unique CSS selector values from the DOM. Simply right-click on the element and choose “Inspect Element”. From within the inspector, right mouse-click again on the highlighted element, and choose “Copy CSS Path” in Chrome, or “Copy Unique Selector” in Firefox.

Each test step in the screenshot above contains a CSS selector. Step #1 clicks on a sign in link, which initiates the authorization flow. By the time we reach Step #2, the Ghost Inspector browser will be on the GitHub login page -- this step, and Step #3 instruct the Ghost Inspector to populate the login form with our GitHub username and password. Step #4 submits the form. Step #5, our last step, will click on the “Authorize” button that is displayed the first time our GitHub account approves this app. On subsequent test runs, GitHub will skip this step -- thus, we’ll make this step optional.

5.  Save the authorization code by stopping the Ghost Inspector test. We’re going to add a Network Filter to our test, instructing the Ghost Inspector browser not to follow the auth code redirect URL. This will preserve the code for later use.

At the bottom of the Ghost Inspector test editor, click the Add Filter button. We paste the app’s OAuth redirect URL in this field.

Run the Ghost Inspector Test, Watch the Video

And that completes our first Ghost Inspector UI test! After it's saved, we run the test by clicking Execute Test. The test will take 5 to 10 seconds to complete. Every Ghost Inspector test run is video recorded, revealing every test step, from text inputs, mouse clicks to page transitions. Below is an actual video of our test run:

Integrate Ghost Inspector With Runscope

Now we’re going to set up the Runscope Radar API test that will integrate the Ghost Inspector test we just finished creating above:

1.  Connect Ghost Inspector to Runscope with an Integration. Adding the Ghost Inspector integration is simple -- just click on Integrations from the Radar menu, then click Connect Ghost Inspector from the list of services.

2.  Create a new Radar test; add the Ghost Inspector test. Now that we've connected Ghost Inspector to Runscope, a new button is available in our Runscope Radar test editor: Add a Ghost Inspector Test. When we click that button, our Ghost Inspector test suites and respective tests appear. Lets select the new UI test we've just created.

3.  Extract the authorization token from the Ghost Inspector test. Recall earlier that in Ghost Inspector, we configured the test to stop right before the auth token exchange. We use JavaScript to extract the authorization code and store it in the variable {{auth_code}}.

4.  Test the OAuth API access token generator. The next step in our test plan will exchange the authorization token for an access token. Below we configure the request to the GitHub OAuth API. Both {{client_id}} and {{client_secret}} are defined as Initial Variables. We also extract the access token into the variable {{access_token}}.

babyunicorn_access_token.png

5.  Test a protected resource API method. With the newly minted access token, we'll test the API method to fetch the email addresses associated with the authenticated GitHub user account. Lets also set up an assertion that validates the account's email address.

babyunicorn_testemail.png

Runscope + Ghost Inspector = Better Software

That's just one example of how Runscope and Ghost Inspector can help to build more comprehensive tests that span the API as well as the application that integrates with the API. On their own, both Runscope and Ghost Inspector are very poweful tools for automatically monitoring, testing and debugging APIs and web applications, respectively. However, these tools combined provide you with a new dimension of holistic test coverage, resulting in better software for your users.

If you have any questions or need any help, drop us a line. Our support team is always ready to help.

Categories: announcements, code samples

Get a Snapshot of Recent Test Performance with the New Runscope Radar Overview

By Neil Mansilla on .

A new feature that we recently launched is the Runscope Radar Overview -- a high-level overview page with a series of reports on individual test performance. The overview includes:

  • Success ratio (tests passed/performed) over last day, week and month
  • Results graph for the most recent tests performed
  • Request performance (latency)
  • HTTP response code graph
radar_overview.png

The default view for every Radar test includes these reports. Simply click on any of your test names from the Runscope Radar page. This report highlights data for individual tests only. To take a deeper dive into performance and usage statistics across all account data (all buckets, tests and captures), use Runscope Metrics.

Runscope Radar Overview and Metrics are available to all customers. If you need help understanding these reports, drop us a line. Our support team is always ready to help.

Categories:

On Thanksgiving, We “Pause” to Give Thanks and Introduce Runscope Radar Support for Pauses Between Steps

By Neil Mansilla on .

Today, in the US, we are celebrating Thanksgiving. On this day, it is customary for people to express what they are grateful for, such as good health, great friends, certain members of the family, on-call support team members, etc. The Runscope team would like to give thanks to our wonderful community of developers, ops engineers and testers for your use and support of Runscope.

We'd also like to announce that as of today, pauses are supported in Runscope Radar tests. Pauses are a new test step that allow you to insert delays between steps in your test plan. You can add as many pauses as you need, with each ranging from 1 to 180 seconds.

A typical scenario for inserting a pause between requests is when request A executes asynchronous tasks with a predictable completion time (e.g. generating a very large report), and request B depends on the completion of request A’s background tasks (e.g. retrieving newly generated report and making assertions). Above, we inserted a 15 second pause between the two requests. Actual pause times may not be exact, but they are guaranteed to be at least the amount of time specified.

For more information, see the Test Steps Editor documentation, or just head over to your Runscope Radar test editor where you’ll find the new Add Pause button. If you need help with pauses, send us a note. Happy Thanksgiving!

Categories: announcements

Everything is going to be 200 OK

Sign Up — Free!