Architecture

A tester uses a web browser to access the console. The console manages the virtual service. The system under test (applicaiton under test) connects directly to the virtual service on different ports.
screenshot

Typical environments

Manual exploratory testing QA and development working in isolation

If you cannot see a video frame below please download it here
 

Starting with automated testing

If you cannot see a video frame below please download it here
 

Continuous Delivery team sharing stubs or virtual services

If you cannot see a video frame below please download it here
 

Proof of concept with on-premises installation at a large enterprise

Large enterprises with complex test environments often start with a proof of concept project. If you feel like you do not have very complex test environments in your organisation, or would like to just try the software go ahead and jump straight into the Quick start. Otherwise, here is an example of a plan divided into stages on how you can implement a proof of concept project today.

Stage 0: a 1-hour installation plan

After completing this first step, you will have a Traffic Parrot installation ready to virtualize assets. This step is usually combined with Stage 1.

Prerequisites:
  1. Access to the Traffic Parrot installation files
  2. Access to the server where Traffic Parrot will be installed
  3. Correct Java version installed on the server
  4. Access to a user account able to bind ports on the server
  5. Access to a modern web browser
  6. An SSH client
Steps to perform:
  1. Copy the provided trafficparrot-release-x.y.z-bin.zip to the destination directory
  2. Unzip trafficparrot-release-x.y.z-bin.zip
  3. Start Traffic Parrot
  4. Access http://server-address:8080
  5. Stop Traffic Parrot

If you you are a large enterprise with complex environments you will be required to run prerequisite confirmation tests (bash commands, SSH connections, ...) to confirm environment set up readiness before proceeding to installation. This will help avoiding common pitfalls to speed up the proof of concept project.

Stage 1: a one to five day proof of concept

After completing this step you will have a solid proof of the value of service virtualization and Traffic Parrot to your organization. Traffic Parrot will be up and running and deliver value; the whole team will not yet know how to use it.

After completing this step, proceed to Stage 2 to enable the whole team.

Prerequisites:
  1. Completed the 1 hour installation plan
  2. Identified a test plan to virtualize
    1. Only stateless transactions
    2. Causing much pain because of system unavailability, third party transaction costs, etc. Virtualizing these services will help prove value faster and will less effort.
  3. Access from SUT server to the Traffic Parrot server (unblocked firewalls, etc.)
  4. Access from Traffic Parrot server to the virtualized system
  5. Access to the SUT application configuration files
  6. Team
    1. A small 2-5 people team for pilot deployment of Traffic Parrot
    2. A team member able to configure SUT to point to Traffic Parrot available for the day
Potential blockages to successful implementation of Stage 1:
  1. Not able to Download Traffic Parrot binaries inside the organization. Downloads are often blocked.
  2. Test plan/suite issues
    1. No stateless HTTP(S) transactions.
    2. No simple transactions that would demonstrate high ROI after virtualizing.
    3. No small team to lead the pilot project
    4. No team member available to help with SUT configuration.
  3. No access to a modern web browser.
Potential blockages to successful implementation of Stage 1 on the System Under Test server:
  1. No SSH access to the application server. This type of access often requires prior setup.
  2. No user with HDD write and port binding access on the SUT server. This type of access often requires prior setup.
  3. No RAM and HDD space available on the application server. Often servers come with limited resources.
  4. No Java installation on SUT server. Downloads are often blocked.
Potential blockages to successful implementation of Stage 1 on a dedicated server or cloud:
  1. No SSH access to the Traffic Parrot server. This type of access often requires prior setup.
  2. No user with HDD write and port binding access on the Traffic Parrot server. This type of access often requires prior setup.
  3. No RAM and HDD space available on the Traffic Parrot. Often servers come with limited resources.
  4. No Java installation on Traffic Parrot server. Downloads are often blocked.
  5. No firewall routes from SUT server to Traffic Parrot server.

Stage 2: enable the team in 4 weeks

Introducing other team members to Traffic Parrot. After this step, the team should have been able to virtualize one more service on their own for the given system or across a given team.

Next steps

Introducing Traffic Parrot to other teams. Showcasing the successful implementation in the first team. Repeat steps 0-2 for other teams.

Starting and stopping

Linux, Unix and Mac

Start
  1. Open a terminal window
  2. Go to the installation directory cd trafficparrot-release-x.y.z
  3. Run start script ./start.sh
  4. Inspect the main log file and make sure there are no “ERROR”s less +F tp.out
  5. Open the web console in any modern web browser (Chrome, Firefox or MS Edge) http://localhost:8080
Stop
  1. Open a terminal window
  2. Go to the installation directory cd trafficparrot-release-x.y.z
  3. Run stop script ./stop.sh

Windows

Start
  1. Open a Command Prompt. Click Start, type cmd in the "Search programs and files" box or type cmd in Cortana prompt.
  2. Go to the installation directory cd trafficparrot-release-x.y.z
  3. Run start script start.cmd
  4. Inspect the console output and make sure there are no “ERROR”s
  5. Open the web console in any modern web browser (Chrome, Firefox or MS Edge) http://localhost:8080
Stop
  1. Press Ctrl+C in the Command Prompt
  2. Close the Command Prompt

Recording

Usage

In order to record traffic to a URL, simply enter the Recording URL and click Start recording.

All traffic received by the Traffic Parrot virtual service will be proxied to the host in the Recording URL and recorded as Mappings.

Filter by URL path

If the Recording URL includes a path, only traffic to this path will be recorded, however all traffic will still be proxied.

For example, if the Recording URL is set to http://example.com/aSampleResource then only traffic to paths staring with /aSampleResource will be recorded and all other traffic will be proxied to http://example.com.

Filter by Content-Type

In order to record only specified content types go to trafficparrot.properties file and change the value of the property:
trafficparrot.virtualservice.recordOnlyContentTypesContaining=TP_RECORD_ALL_CONTENT_TYPES
to include content types you would like to record, for example:
trafficparrot.virtualservice.recordOnlyContentTypesContaining=application/javascript,application/xml

Scenarios

In order to edit the list of elements on the scenarios dropdown on the Add/Edit page please open and edit file trafficparrot-x.y.z/scenarios.js and using the samples provided in the file add your new entries and remove the existing ones.

Valid values of request-url-matcher:
  1. urlEqualTo
  2. urlMatching
  3. urlPathEqualTo
  4. urlPathMatching
Valid values of request-url: any valid URL.
Valid values of request-method:
  1. ANY
  2. GET
  3. POST
  4. PUT
  5. HEAD
  6. OPTIONS
  7. DELETE
  8. CONNECT
  9. TRACE
Valid values of request-headers: new line separated list of header keys and values, for example 'Accept-Encoding: gzip, deflate, sdch, br\nUpgrade-Insecure-Requests: 1'.
Valid values of request-body-matcher:
  1. any
  2. equalTo
  3. contains
  4. matches
  5. doesNotMatch
  6. equalToJson
  7. matchesJsonPath
  8. equalToXml
  9. matchesXPath
Valid values of request-body: any request body.
Valid values of response-status-code: any valid HTTP status code integer value.
Valid values of response-delay: any positive integer value.
Valid values of response-fault:
  1. CLOSE_CONNECTION_AFTER_HALF_RESPONSE
  2. DRIP_BYTE_EVERY_100ms
  3. DRIP_BYTE_EVERY_1s
  4. DRIP_BYTE_EVERY_10s
Valid values of response-headers: new line separated list of header keys and values, for example 'Content-Type:text/javascript; charset=UTF-8\nEtag: "234762534726"'.
Valid values of response-body: any response body.
If you cannot see a video frame below please download it here
 

Configuration

Properties

You configure Traffic Parrot web console and virtual service by editing properties in trafficparrot.properties file.
Frequently changed properties
  1. Web console port number trafficparrot.gui.http.port=8080
  2. Virtual service HTTP and HTTPS ports trafficparrot.virtualservice.http.port=8081 and trafficparrot.virtualservice.https.port=8082
For the full list of available configuration options please see trafficparrot.properties file located in the traffic parrot firectory.

HTTPS certificates

The default pre-generated certificates are located in the certificates directory. You can change the virtual service HTTPS certificate by modifying the following properties in trafficparrot.properties file:
  1. trafficparrot.virtualservice.keystoreAndTruststore.jks.resource=certificates/trafficparrot-keystore-and-truststore.jks
  2. trafficparrot.virtualservice.keystoreAndTruststore.jks.password=trafficparrot

Logging

In order to change the logging level, see configuration files trafficparrotserver.log4j.properties and virtualservice.log4j.properties.

Old version warning!

This documentation is for an old version of Traffic Parrot. There is a more recent Traffic Parrot version available for download at trafficparrot.com

Browse documentation for recent version