---
title: "Get-CatTestResult"
description: "Get-CatTestResult — the per-test results of the last run."
url: "https://docs.justcat.it/reference/powershell-module/get-cattestresult/"
---
# Get-CatTestResult

## Synopsis

```powershell
Get-CatTestResult
```

## Parameters

None (common parameters only).

## What it does

Writes the per-test results CAT kept from the last `Invoke-CatProject` / `Invoke-CatTest` in this session. Before any run it returns nothing; a new `Open-CatProject` discards the previous results.

## Output

One list object of `ITestOutput` items (assign it to work with the items): `TestResult` (`Passed`, `Failed`, `Error`, `Inconclusive`), `TestFullName`, `TestSuite`, `TestCase`, `TestName`, `Description`, `Message` (the verdict's explanation, including the sample of offending rows), `RawMessage`, `ExceptionMessage`, `FirstDataSource`, `FirstQuery`, `SecondDataSource`, `SecondQuery`, `Expectation`, `NumberOfErrors`, `StartTime`, `EndTime`, `Duration`, `ThreadNumber`, `TestDefinition`, `TestDefinitionGuid`.

## Errors

`There is no CAT session active…` when no session exists.

## Examples

```powershell
Invoke-CatProject -Path 'D:\Testing\DwhTests.cat.yaml' -LoggingLevel None
$results = Get-CatTestResult
$results | Where-Object TestResult -ne 'Passed' | Select-Object TestResult, TestFullName, Message

# the failed tests as a CSV for someone else
$results | Where-Object TestResult -eq 'Failed' |
    Select-Object TestFullName, Message, FirstQuery | Export-Csv failed.csv -NoTypeInformation
```

## Related

- [Introduction](https://docs.justcat.it/reference/powershell-module/introduction/ "Introduction") — session model, logging, errors, sign-in.
- [`Get-CatTestResultSummary`](https://docs.justcat.it/reference/powershell-module/get-cattestresultsummary/ "Get-CatTestResultSummary") — the counts.
- [Outputs](https://docs.justcat.it/reference/outputs/ "Outputs") — the same results as files or tables, written by the run itself.

