Test Result Resources

Retrieve details for API Tests and results in a given bucket.


Test Result List

A list of all results for a given test, including results and those currently in progress.

Request

GET/buckets/<bucket_key>/tests/<test_id>/results

Filter Parameters
count integer Maximum number of test results to return. Defaults to 10 if not specified. Maximum value is 50.
since float Only return test results started after the given Unix timestamp (exclusive).
before float Only return test results started before the given Unix timestamp (exclusive).

Response

Returns a list of test results.

Sample Response Data
{
    "data": [
        {
            "agent": null,
            "assertions_defined": 2,
            "assertions_failed": 0,
            "assertions_passed": 2,
            "bucket_key": "6knqwmwvqpzr",
            "finished_at": 1406061608.506811,
            "region": "us1",
            "requests_executed": 1,
            "result": "pass",
            "scripts_defined": 2,
            "scripts_failed": 0,
            "scripts_passed": 2,
            "started_at": 1406036406.68105,
            "test_run_id": "0aa48464-f89e-4596-8d60-79bc678d313f",
            "test_run_url": "https://api.runscope.com/buckets/6knqwmwvqpzr/tests/db4cc896-2804-4520-ad06-0caf3bf216a8/results/0aa48464-f89e-4596-8d60-79bc678d313f",
            "test_id": "db4cc896-2804-4520-ad06-0caf3bf216a8",
            "variables_defined": 2,
            "variables_failed": 0,
            "variables_passed": 2,
            "environment_id": "abcdc896-2804-4520-ad06-0caf3bf216a8",
            "environment_name": "My Test Environment"
        },
        {
            "agent": null,
            "assertions_defined": 2,
            "assertions_failed": 1,
            "assertions_passed": 1,
            "bucket_key": "6knqwmwvqpzr",
            "finished_at": 1406058767.591204,
            "region": "us1",
            "requests_executed": 1,
            "result": "fail",
            "scripts_defined": 2,
            "scripts_failed": 1,
            "scripts_passed": 1,
            "started_at": 1406033565.139315,
            "test_run_id": "53a99b33-88ac-4890-8e07-112c86cdbf91",
            "test_run_url": "https://api.runscope.com/buckets/6knqwmwvqpzr/tests/db4cc896-2804-4520-ad06-0caf3bf216a8/results/53a99b33-88ac-4890-8e07-112c86cdbf91",
            "test_id": "db4cc896-2804-4520-ad06-0caf3bf216a8",
            "variables_defined": 2,
            "variables_failed": 1,
            "variables_passed": 1,
            "environment_id": "abcdc896-2804-4520-ad06-0caf3bf216a8",
            "environment_name": "My Test Environment"
        }
    ],
    "error": null,
    "meta": {
        "status": "success"
    }
}

Test Result Detail

Retrieve the details of a given test run by ID.

Request

GET/buckets/<bucket_key>/tests/<test_id>/results/<test_run_id>

GET/buckets/<bucket_key>/tests/<test_id>/results/latest

Response

Returns a single test result resource.

Data Attributes
agent The ID of the agent used to execute this request. If a Runscope location was used, null.
assertions_defined The total number of simple assertions (non-script) defined for all requests in this test run.
assertions_failed The total number of simple assertions that failed for all requests in this test run.
assertions_passed The total number of simple assertions that passed for all requests in this test run.
bucket_key The key for the bucket that contains the test that caused this test run.
finished_at The Unix timestamp representing when the test run completed.
region The region code for the Runscope location used to execute the test run. If an agent was used, null.
requests An array of requests that were executed for the test run.
requests.uuid The unique ID for the individual test step. Can be used with the Test Step Detail resource to retrieve full HTTP request and response details for request and incoming request steps.
requests.result The aggregate result of variables, assertions, and scripts processed for this test run. Either pass (all passed) or fail (any failed).
requests.url The URL that was used for this request.
requests.method The HTTP method used for this request.
requests.assertions_defined The number of simple assertions (non-script) defined for this request.
requests.assertions_failed The number of simple assertions (non-script) that failed for this request.
requests.assertions_passed The number of simple assertions (non-script) that passed for this request.
requests.scripts_defined The number of scripts defined for this request.
requests.scripts_failed The number of scripts that failed for this request.
requests.scripts_passed The number of scripts that passed for this request.
requests.variables_defined The number of simple variables (non-script) defined for this request.
requests.variables_failed The number of simple variables (non-script) that failed for this request.
requests.variables_passed The number of simple variables (non-script) that passed for this request.
requests.assertions An array of simple assertions that were processed for this request.
requests.assertions.result The pass/fail result for this assertion.
requests.assertions.source The data source for the assertion. Possible values are json, xml, response_headers, response_size_bytes, response_time_ms or status_code.
requests.assertions.property The target property within the data source used to locate the actual value.
requests.assertions.comparison The comparison used to compare the target and expected values. Possible values are equals, does_not_equal, is_empty, is_not_empty, greater_than_or_equal, greater_than, less_than_or_equal, less_than, equals_number, contains, does_not_contain, has_key or has_value.
requests.assertions.target_value The value to compare against.
requests.assertions.actual_value The actual value extracted during the test run.
requests.assertions.error If the assertion failed, a description of the failure. If the assertion passed, null.
requests.scripts An array of scripts processed for this request.
requests.scripts.result The pass/fail result of the script.
requests.scripts.output Any log output from the script execution
requests.scripts.error Additional information if a script fails.
requests.timings.dial_ms Total time connecting to server in milliseconds.
requests.timings.dns_lookup_ms Total time for DNS lookup in milliseconds.
requests.timings.receive_response_ms Total time to receive response in milliseconds.
requests.timings.send_body_ms Total time to send request body in milliseconds.
requests.timings.send_headers_ms Total time to send headers in milliseconds.
requests.timings.wait_for_response_ms Total time waiting for response in milliseconds.
requests.variables An array of simple variables that were processed for this request.
requests.variables.result The pass/fail result for this variable.
requests.variables.source The data source for the variable. Possible values are json, xml, response_headers, response_size_bytes, response_time_ms or status_code.
requests.variables.property The target property within the data source used to locate the data to extract.
requests_executed The number of requests executed in this test run.
result The overall result of the test run. Possible values are: pass, fail, working, canceled, or queued.
scripts_defined The number of scripts defined across all requests in this test run.
scripts_failed The number of scripts that didn't complete in this test run.
scripts_passed The number of scripts that were successfully processed in this test run.
started_at The Unix timestamp representing the time the test run was initiated.
test_run_id The unique ID for this test run.
test_id The unique ID for this test.
variables_defined The number of variables defined across all requests in this test run.
variables_failed The number of variables that failed across all requests in this test run.
variables_passed The number of variables that passed across all requests in this test run.
Sample Response Data
{
    "data": {
        "agent": null,
        "assertions_defined": 2,
        "assertions_failed": 1,
        "assertions_passed": 1,
        "bucket_key": "6knqwmwvqpzr",
        "finished_at": 1406061608.969942,
        "region": "us1",
        "requests": [
            {
                "uuid": "570e2a5b-15c0-4b6c-8c30-f807b520396e",
                "result": "fail",
                "url": "https://yourapihere.com/",
                "method": "GET",
                "assertions_defined": 2,
                "assertions_failed": 1,
                "assertions_passed": 1,
                "scripts_defined": 2,
                "scripts_failed": 1,
                "scripts_passed": 1,
                "variables_defined": 2,
                "variables_failed": 1,
                "variables_passed": 1,
                "assertions": [
                    {
                        "result": "pass",
                        "source": "json",
                        "property": "id",
                        "comparison": "equals_number",
                        "target_value": "123",
                        "actual_value": "123",
                        "error": null
                    },
                    {
                        "result": "fail",
                        "source": "response_time_ms",
                        "property": null,
                        "comparison": "less_than",
                        "target_value": "500",
                        "actual_value": "725",
                        "error": null
                    }
                ],
                "scripts": [
                    {
                        "result": "pass",
                        "output": "script output",
                        "error": null
                    },
                    {
                        "result": "fail",
                        "output": "script output",
                        "error": "Variable undefined."
                    }
                ],
                "timings": {
                    "dns_lookup_ms": 0.4811286926269531,
                    "dial_ms": 0.7872581481933594,
                    "send_headers_ms": 7.442474365234375,
                    "send_body_ms": 0.0016689300537109375,
                    "wait_for_response_ms": 107.25116729736328,
                    "receive_response_ms": 0.034332275390625
                },
                "variables": [
                    {
                        "result": "pass",
                        "source": "json",
                        "property": "id",
                        "name": "customer_id",
                        "value": 123,
                        "error": null
                    },
                    {
                        "result": "fail",
                        "source": "json",
                        "property": "name",
                        "name": "name",
                        "value": null,
                        "error": "Attribute not found."
                    }
                ]
            }
        ],
        "requests_executed": 1,
        "result": "fail",
        "scripts_defined": 2,
        "scripts_failed": 1,
        "scripts_passed": 1,
        "started_at": 1406036406.531371,
        "test_run_id": "0aa48464-f89e-4596-8d60-79bc678d313f",
        "test_id": "db4cc896-2804-4520-ad06-0caf3bf216a8",
        "variables_defined": 2,
        "variables_failed": 1,
        "variables_passed": 1
    },
    "error": null,
    "meta": {
        "status": "success"
    }
}

Test Step Detail

Retrieve the HTTP request and response details of a given test step within a test run by ID. Supported step types are request and incoming request (pauses, Ghost Inspector and conditional steps are not supported).

Request

GET/buckets/<bucket_key>/tests/<test_id>/results/<test_run_id>/steps/<step_id>

Response

Returns the request/response pair details for the request step.

Data Attributes
uuid The unique identifier (UUID) for this request/response pair.
bucket_key The bucket where this request step is stored.
request The HTTP request data.
request.headers Thre HTTP request headers as an object. The keys of this object are header names and the value is an array of values.
request.host The destination hostname of the HTTP request.
request.method The HTTP method of the request.
request.params Any querystring parameters in the request as an object. The keys of this object are parameter names, and the value is an array of values.
request.path The path portion of the HTTP request
request.scheme The scheme of the request. (http or https)
request.timestamp A unix timestamp representing the time the request was made. This is a floating point number that with microsecond granularity.
request.body A plain-text or base64-encoded string of data. For binary content (like images), we have base64 encoded the content so it can be returned in a JSON object. The key "body_encoding" will be set accordingly for base64 encoded bodies.
request.body_encoding The encoding of the request.body. Either 'plaintext' or 'base64'.
response The HTTP response data.
response.headers Thre HTTP response headers as an object. The keys of this object are header names and the value is an array of values.
response.status Integer status code for the HTTP response.
response.reason Text status reason that corresponds to response.status. e.g. - 'OK', 'Not Found', etc.
response.size_bytes The size of the response body in bytes.
response.timestamp A unix timestamp representing the time the response was received. This is a floating point number that with microsecond granularity.
response.body A plain-text or base64-encoded string of data. For binary content (like images), we have base64 encoded the content so it can be returned in a JSON object. The key "body_encoding" will be set accordingly for base64 encoded bodies.
response.body_encoding The encoding of the response.body. Either 'plaintext' or 'base64'.
Sample Response Data
{
    "data": {
        "bucket_key": "vnms9d3tgg4u",
        "uuid": "7a8daf40-60ea-44d8-9b4c-4695b76f3a1d",
        "request": {
            "body": "",
            "body_encoding": "plaintext",
            "headers": {
                "Accept": [
                    "*/*"
                ],
                "Accept-Encoding": [
                    "gzip, deflate, compress"
                ],
                "Host": [
                    "api-twilio-com-vnms9d3tgg4u.runscope.net"
                ],
                "User-Agent": [
                    "runscope/1.0"
                ]
            },
            "host": "api.twilio.com",
            "method": "GET",
            "params": {},
            "path": "/",
            "scheme": "https",
            "timestamp": 1368828807.918586
        },
        "response": {
            "body": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<TwilioResponse><Versions page=\"0\" numpages=\"1\" pagesize=\"50\" total=\"2\" start=\"0\" end=\"1\" uri=\"/\" firstpageuri=\"\" previouspageuri=\"\" nextpageuri=\"\" lastpageuri=\"\"><Version><Name>2008-08-01</Name><Uri>/2008-08-01</Uri><SubresourceUris><Accounts>/2008-08-01/Accounts</Accounts></SubresourceUris></Version><Version><Name>2010-04-01</Name><Uri>/2010-04-01</Uri><SubresourceUris><Accounts>/2010-04-01/Accounts</Accounts></SubresourceUris></Version></Versions></TwilioResponse>\n",
            "body_encoding": 'plaintext',
            "headers": {
                "Content-Length": [
                    "511"
                ],
                "Content-Type": [
                    "application/xml"
                ]
            },
            "reason": "OK",
            "size_bytes": 511,
            "status": 200,
            "timestamp": 1368828808.555258
        }
    },
    "meta": {
        "status": "success"
    }
}
    

Need help? We have you covered.

View the docs or contact our support team and we'll get back to you as soon as we're able to respond.