Solve API problems fast with Runscope. Learn More →

Hypermedia, Past, Present and Future

By Darrel Miller on .

Hypermedia APIs are beginning to enter the mainstream of API development.  For developers trying to get up to speed on hypermedia there are a dizzying array of terminology and choices. This blog post gives an overview of the hypermedia space, giving some perspective on where we have come from, what has been tried, what has worked, what has not, where the industry is headed and what questions remain unresolved.  Read more here...

Categories: api, hypermedia

2014 Year in Review: Thank You

By John Sheehan on .

As we complete another lap around the sun, I thought it would be fun to look back at the past year and recap some of the highlights. This was a big year for our little company. The team tripled in size, we raised another round of funding, and usage of Runscope Radar took off faster than any of us thought possible.

The only word that really sums up how I feel about 2014 is grateful. I'm grateful to the team that I get to work with everyday for all the hard work they put in, and how much they make me laugh. Most importantly though, I'm grateful to our customers who inspire and push us to build better tools so they can focus on what they do best: bringing value to their organizations through code. On behalf of our entire team, thank you for making us a part of your toolset.

To round out this recap, here are a few of our favorite posts and announcements from the past year.

Company Milestones

Our Favorite Product Updates

Community Projects

How Tos

Conference Fun

Looking Ahead to 2015 - Join Us!

The roadmap is full of exciting things for the upcoming year. Runscope is growing fast and we need you to help us achieve our big goals. If you love building tools and enabling developers to build better applications, we'd love for you to join us


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 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.


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}}.


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.


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

Everything is going to be 200 OK

Sign Up — Free!