# Common Issues

Quick fixes for common test issues.

***

## Element Not Found

If an element isn't being found:

1. **Add more context** – Describe position or appearance
2. **Scroll first** – Element may be off-screen
3. **Check exact text** – Quoted text must match exactly
4. **Wait for load** – Add a wait step before locating

**Example fix:**

```
❌ Tap "Submit"

✅ Swipe up to view the submit button
✅ Tap the "Submit" button at the bottom of the form
```

***

## Action Not Registering

If an action doesn't work:

1. **Add a wait** – UI may not be ready
2. **Check for overlays** – Dialogs, popups may block the element
3. **Be more specific** – Add color, position, or other context

**Example fix:**

```
❌ Tap "Login"

✅ Wait for 2 seconds
✅ Tap the blue "Login" button at the bottom
```

***

## Timing Issues

If tests fail inconsistently:

1. **Increase wait** – Slow operations need more time
2. **Add waits after animations** – UI transitions take time
3. **Wait before verification** – Content must load first

**Example fix:**

```
❌ Tap "Submit"
❌ Verify success message displays

✅ Tap "Submit"
✅ Wait for 3 seconds
✅ Verify the success message displays
```

***

## Cross-App Issues

If switching between apps fails:

1. **Use explicit launch** – Always use `Launch [app name]`
2. **Add waits after launch** – Apps need time to open
3. **Return explicitly** – Launch your app again after interacting with another

**Example fix:**

```
❌ Tap "Import Photo"
❌ Tap the first photo
❌ Verify photo is imported

✅ Tap "Import Photo"
✅ Launch the Gallery app
✅ Wait for 2 seconds
✅ Tap the first photo
✅ Tap "Select"
✅ Launch MyApp
✅ Wait for 2 seconds
✅ Verify the photo is displayed
```
