---
title: invokeTest()
framework: xctest
role: symbol
role_heading: Instance Method
path: xctest/xctestcase/invoketest()
---

# invokeTest()

Invokes the test.

## Declaration

```swift
func invokeTest()
```

## Discussion

Discussion Invoking a test performs its setup, invocation, and teardown. In general this should not be called directly.

## See Also

### Creating Tests Programmatically

- [init(invocation:)](xctest/xctestcase/init(invocation:).md)
- [init(selector:)](xctest/xctestcase/init(selector:).md)
- [testInvocations](xctest/xctestcase/testinvocations.md)
- [invocation](xctest/xctestcase/invocation.md)
- [record(_:)](xctest/xctestcase/record(_:).md)
- [recordFailure(withDescription:inFile:atLine:expected:)](xctest/xctestcase/recordfailure(withdescription:infile:atline:expected:).md)
- [defaultTestSuite](xctest/xctestcase/defaulttestsuite.md)
