Sample Projects

ReadyAPI includes several samples that show how you can work with ReadyAPI.

Downloadable sample projects

Project

Description

XML and JSON data sources sample

Download

How to open

This example shows how to use data sources of XML and JSON types. Such data sources are convenient when you need to iterate through an array of values from an API's XML/JSON response and use these values in subsequent test steps.

Nested data source sample

Download

How to open

This sample project demonstrates how to use the nested data source loop.

Working with headers sample

Download

How to open

This sample project shows how to work with headers: remove, add, and save their values to test case properties using Groovy scripts.

Set property value sample

Download

How to open

This sample shows how to set values of properties at the project, test suite, and test case levels through a Groovy script.

REST VirtResponse sample

Download

How to open

You use a REST VirtResponse test step to return some predefined response to a REST request. This sample project demonstrates how you can use this step in your API tests.

Rerun failed the test steps sample

Download

How to open

This sample shows how to rerun failed test cases using a test suite teardown script.

Clear property values sample

Download

How to open

This project shows how to clear all custom property values at the test case, test suite, and project levels in a project teardown script using Groovy. This is useful for clearing any custom property values that should be blank when the project is finished running.

Iterate through the results sample

Download

How to open

This sample illustrates how to iterate through test step results using Groovy to write the results of test steps to a file. It is done in a test case teardown Groovy script.

Report scripting sample

Download

How to open

This example shows how to add basic Report Scripts and Subreports using Groovy at the test case and project levels.

ReadyAPI Virtualization scripting sample

Download

How to open

This project shows how to use ReadyAPI Virtualization scripts for various tasks: reading request content to select a response, reading file content to send it in response, and clearing virtual service properties when that virtual service starts.

Bundled sample projects

Functional testing

Project

Description

SOAP Sample Project

How to open

Contains a large variety of tests that send requests to the included SOAP virtual API.

Some tests are created to test the service behavior in case of incorrect requests or to show how to create complex scenarios in ReadyAPI.

REST Sample Project

How to open

Simulates a user looking at the authorization form and logging into the attached REST virtual service.

Data-Driven Sample Project

How to open

Takes data from a Grid data source and sends multiple requests to the Google Maps API.

Find the link to this project on the Dashboard.

Authentication Sample Project

How to open

Contains the test cases that show how you can authenticate to a service in ReadyAPI:

  • Basic Auth – Logs in to the browserspy.dk web service by using Basic authentication.

  • OAuth2 - Browser client – Simulates a browser and authenticates to the Google API. It uses the Implicit Grant method.

  • OAuth2 - Desktop client – Simulates a desktop client and authenticates to the Google API. It uses the Authorization Code Grant method.

  • OAuth2 - Automation – Demonstrates how you can automate OAuth 2.0 token retrieval in your tests.

Kafka Sample Project

How to open

Contains a test case that simulates a publisher and a subscriber that interacts with a topic.

Important

This sample project uses a Kafka broker running in Docker. You can find the docker-compose.yml file used to start the Docker image in the <ReadyAPI>/tutorials/ folder:

  • Windows:

    <Program Files>/SmartBear/ReadyAPI‑.0/tutorials

  • Linux:

    /home/<user‑name>/SmartBear/ReadyAPI‑.0/tutorials

  • MacOS:

    /Applications/ReadyAPI‑.0.app/Contents/java/app/tutorials

To run the image, use the following command:

docker-compose -f docker-compose.yml up

Tip

The broker is configured to run on port 9092. If this port is occupied on your machine, change it in the docker-compose.yml file and restart the image. You will also need to change the endpoint in the test.

To learn more about Docker Compose, see Docker documentation.

gRPC Sample Project

How to open

Contains a gRPC service with a Unary operation and a test case simulating a gRPC request.

Important

This sample project uses a gRPC service running in Docker. You can run it by using the following commands:

docker run -p <host-port>:50051 smartbear/readyapi-grpc-service-sample:1.0.0

Replace <host-port> with any available port at the machine where you run docker.

To learn more about the run command, see Docker documentation.

Load testing

Project

Description

Baseline Load Sample

How to open

Tests the attached virtual service with a constant load of 3 virtual users.

Fixed Load Sample

How to open

Simulates 5 virtual users arriving at the attached virtual service every second.

Variable Load Sample

How to open

Simulates a load against the target service varying from 0 to 10 virtual users in the sine-wave pattern.

Virtualization

Project

Description

Virtualization Sample Project

How to open

Demonstrates how to use ReadyAPI to test both REST and SOAP services in the same project. Contains two test cases working with SOAP and REST virtual APIs.

Data-Driven Virtual Service Sample Project

How to open

This project contains a REST virtual service that inserts data from a Grid data source into responses.

Sample APIs

Project

Description

Facebook Sample

How to open

User-feed-related requests to Facebook API.

Learn more.

Flickr Sample

How to open

Search requests to Flickr API.

Learn more.

YouTube Sample

How to open

Requests for videos and playlists from YouTube API.

Learn more.

How to open

Find the project you need in the Sample Projects section:

Functional Testing: ReadyAPI Test Sample Projects

Tip

By default, this section displays sample projects of all applications in the ReadyAPI application suite. Click more.pngand clear all the check boxes in the popup list except for ReadyAPI Test Projects to limit the options to ReadyAPI Test and API examples only.

Select File > Import Project from the main menu, and then choose a sample project file in the subsequent dialog:

Web service testing with ReadyAPI: Open sample project

Location

ReadyAPI project files have the .xml extension. You can find ReadyAPI sample projects in the <ReadyAPI>/tutorials/ folder:

• Windows:

<Program Files>/SmartBear/ReadyAPI-.0/tutorials

Program Files or Program Files (x86)

Important

You will be able to rewrite the original sample file in this directory only if you run ReadyAPI with administrator permissions. Otherwise, save the modified project to another location.

• Linux:

/home/<user-name>/SmartBear/ReadyAPI-.0/tutorials

• MacOS:

/Applications/ReadyAPI-.0.app/Contents/java/app/tutorials

See Also

Publication date: