---
title: "init(filePath:lineNumber:)"
framework: xctest
role: symbol
role_heading: Initializer
path: "xctest/xctsourcecodelocation/init(filepath:linenumber:)-3hzmr"
---

# init(filePath:lineNumber:)

Initializes a new instance with a file path and a line number.

## Declaration

```swift
convenience init(filePath: String, lineNumber: Int)
```

## Parameters

- `filePath`: A string that represents a file path to the source code file.
- `lineNumber`: An integer that represents a line of code in the source code file.

## See Also

### Initializers

- [init(fileURL:lineNumber:)](xctest/xctsourcecodelocation/init(fileurl:linenumber:).md)
- [init(filePath:lineNumber:)](xctest/xctsourcecodelocation/init(filepath:linenumber:)-8qw52.md)
