---
title: "init(selector:)"
framework: xctest
role: symbol
role_heading: Initializer
path: "xctest/xctestcase/init(selector:)"
---

# init(selector:)

Initializes a test case with a selector.

## Declaration

```swift
init(selector: Selector)
```

## Parameters

- `selector`: A selector to use when running this test.

## See Also

### Creating Tests Programmatically

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