Search within testresults of a run

This API resources allows you to search a testresult within all testresults of a specific run.

Request

URL

/api/v1/default/runs/{runId}/testresults?search={search}&status={status}&sortBy={sortBy}&skip={skip}&take={take}

Example:
The following request returns ten testresults that have the status SUCCESS or FAILED, sorted by status ascending and testId descending. Additionally they should have the string “compare” anywhere within the test name.
/api/v1/default/runs/23/testresults?search=%23compare&status=SUCCESS,FAILED&sortBy=sortBy=asc(status),desc(testId)&skip=0&take=10

Verb

GET

URL-Parameters

Following are the parameters used in the URL or the QueryString showed by a placeholder with curly brackets. Replace the full parameter with the actual value including the curly brackets.

ParameterTypeDescription
runIdInt64The ID of the run whose testresults should be searched.
searchstringThe search-query to use when searching within testresults.
Please ensure that the search-query should be URL-encoded when it contains special characters.
Use the percentage character % as a wildcard placeholder.
statusStringA comma separated list of the testresult status that should be filtered for. Use one or all of the following status.EXECUTING = The test is still running.SUCCESS = The testing condition was met.FAILED = The testing condition was not met.NOTEVALUATED = The test couldn’t be evaluated for any reason.DIFFERENTDIMENSIONALITY = Two or more probes had a different dimensionality whereas the testmethod required them to be of the same shape.CANCELED = The test or the whole run was cancelled.NOTENOUGHPROBES = There were not enough probes to complete the test. The amount of required probes depends on the kind of testmethod. E.g. when comparing data, the test needs at least two probes.EXCEPTION = An exception occured while running the test.
sortByInt64A comma separated list of the attributes that should be used for sorting the result. Use the attributes that are shown in the response for sorting. Enclose these attributes in either asc(…) or desc(…) to sort define the sort-direction. E.g. sortBy=asc(status),desc(testId) means that the response is sorted by the status in ascending order and within the status by the testId in descending order.
skipInt32The amount of testresults that should be skipped in the response.
takeInt32The amount of testresults that should be returned in the response.

Header

ParameterDescription
AuthorizationThe Access-Token as explained in Authentication.

Body

not needed

Response

{
    "items": [
        {
            "testResultId": 11319,
            "testId": 3,
            "testName": "10.4 - KPI Comparison",
            "testDescription": "Queries multiple KPI's (aggregates from the sales-tables) and compares them between the DWH and the ERP.",
            "methodId": "fc008ca3-30d6-4c45-89fd-46a4292de98c",
            "methodUniqueName": "ExactEqual",
            "status": "FAILED",
            "message": "The test failed because the probe values are not equal.",
            "messageId": 103,
            "hasPayloadXml": false,
            "executionSequence": 0,
            "createdAt": "2020-07-06T09:13:26.713308"
        }
    ],
    "skip": 0,
    "take": 100,
    "total": 12,
    "filteredTotal": 2,
    "status": "OK"
}
ElementTypeDescription
statusStringReturns the status of the API request. OK means that the request could be completed successfully.
filteredTotalInt64The total amount of testresults respecting the search-query.
skipInt32The amount of testresults that were skipped to present the response.
takeInt32The amount of testresults that were returned in the result.
totalInt64The total amount of testresults *not* respecting the search-query.


The items-Array contains as many testresult-elements as requested by the take-parameter. Each element has the following attributes.

ElementTypeDescription
testResultIdInt64The ID of the testresult.
testIdInt64The ID of the test.
testNameStringThe name of the test.
testDescriptionStringThe description of the test.
methodIdStringThe ID (=GUID) of the testmethod used within the test.
methodUniqueNameStringThe unique name of the testmethod used within the test.
statusStringThe status of the test. Usually the outcome of the test.
EXECUTING = The test is still running.
SUCCESS = The testing condition was met.
FAILED = The testing condition was not met.
NOTEVALUATED = The test couldn’t be evaluated for any reason.
DIFFERENTDIMENSIONALITY = Two or more probes had a different dimensionality whereas the testmethod required them to be of the same shape.
CANCELED = The test or the whole run was cancelled.
NOTENOUGHPROBES = There were not enough probes to complete the test. The amount of required probes depends on the kind of testmethod. E.g. when comparing data, the test needs at least two probes.
EXCEPTION = An exception occured while running the test.
messageStringDepending on the testmethod, there could be a message attached to the testresult. This is the message itself if available.
messageIdInt64Depending on the testmethod, there could be a message attached to the testresult. This is the ID of the message if available.
exceptionStringWhen an exception occured while running the test, the exception-message is available in this attribute.
commentStringWhen a comment was added to the testresult (see scripting), it appears in this attribute.
hasPayloadXmlBooleanThis attribute is “true” when the testresult has some payload attached. A payload could be a document with additional information.
executionSequenceInt32When a test runs multiple times during the same run, there is a sequence number, that defines the order of the testresults regarding the test.
createdAtDateTimeThe point in time when the testresult was recorded.

Example: PowerShell

The following example shows a way to query testresults of a specific run for a string in the tests names. So all testresults that contain “compar” in their name will be printed to the console.

# The base-url of the BiG EVAL API and instance.
$bigevalUrl = "https://mybigevalserver/"
$baseUrl = $bigevalUrl+"api/v1/default/"

# Note that you need to request the AccessToken first. We do not show that in this example.
$accessToken = "123123123"

# Query all testresults of the run 123123 that contain "compare" in the tests name.
$runResults = Invoke-RestMethod -Uri ($baseUrl + "runs/123123/testresults?search=%23compare&status=SUCCESS,FAILED,EXECUTING,NOTEVALUATED,DIFFERENTDIMENSIONALITY,CANCELED,NOTENOUGHPROBES,EXCEPTION&sortBy=&skip=0&take=10") -Headers @{"Authorization"="Bearer $accessToken"}

# Write all test-results (could be multiple) to the console
$runResults.items | ForEach-Object {
    Write-Host 
    Write-Host ("Test-ID:          " + $_.testId)
    Write-Host ("Test-Name:        " + $_.testName)
    Write-Host ("Test-Status:      " + $_.status)
}
Table of Contents