---
title: preferredName
framework: testing
role: symbol
role_heading: Instance Property
path: testing/attachment/preferredname
---

# preferredName

A filename to use when saving this attachment.

## Declaration

```swift
var preferredName: String { get }
```

## Discussion

Discussion The value of this property is used as a hint to the testing library. The testing library may substitute a different filename as needed. If the value of this property has not been explicitly set, the testing library will attempt to generate its own value.
