---
title: XCUITest Knowledge Check | TestingBot
description: Nine questions across the course. Pick an answer for each, then check
  them together. The answers are in the page source, so this is a self-check; the…
source_url:
  html: https://testingbot.com/resources/courses/xcuitest/knowledge-check
  md: https://testingbot.com/resources/courses/xcuitest/knowledge-check.md
---

Course

[XCUITest Tutorial: iOS UI Testing in Swift](https://testingbot.com/resources/courses/xcuitest)

Chapter 11 of 11

1. [1 XCUITest Tutorial: iOS UI Test Automation in Swift](https://testingbot.com/resources/courses/xcuitest)
2. [2 Add a UI Test Target and Run Your First Test](https://testingbot.com/resources/courses/xcuitest/add-a-ui-test-target)
3. [3 Element Queries and Accessibility Identifiers](https://testingbot.com/resources/courses/xcuitest/queries-and-accessibility-identifiers)
4. [4 Interactions and Assertions](https://testingbot.com/resources/courses/xcuitest/interactions-and-assertions)
5. [5 Waiting Without sleep(): waitForExistence and Predicates](https://testingbot.com/resources/courses/xcuitest/waiting-without-sleep)
6. [6 Screen Objects in Swift](https://testingbot.com/resources/courses/xcuitest/screen-objects)
7. [7 Launch Arguments and Environment: Control App State](https://testingbot.com/resources/courses/xcuitest/launch-arguments-and-environment)
8. [8 Build for Testing: The App and the Test Runner](https://testingbot.com/resources/courses/xcuitest/build-for-testing)
9. [9 Run XCUITest on Real iPhones with TestingBot](https://testingbot.com/resources/courses/xcuitest/run-on-testingbot)
10. [10 XCUITest in CI with GitHub Actions](https://testingbot.com/resources/courses/xcuitest/ci-github-actions)
11. [11 XCUITest Knowledge Check](https://testingbot.com/resources/courses/xcuitest/knowledge-check)

[Exit course](https://testingbot.com/resources/courses)

 Chapter 11 of 11 Intermediate 5 min read Updated Nov 2026 

# XCUITest Knowledge Check

Nine questions across the course. Pick an answer for each, then check them together. The answers are in the page source, so this is a self-check; the [certification exam](https://testingbot.com/resources/courses/xcuitest/certification) uses a separate question bank.

1. Your team writes the iOS app in Swift, wants UI tests on every pull request next to the unit tests, and has no Android app. Which tool fits best?

 Appium, because it is the only tool that runs on real devices Selenium WebDriver with Safari XCUITest, in a UI test target of the app's own project A manual test checklist

XCUITest lives in the app's project, runs with `xcodebuild test` next to unit tests and is written in the team's language. Appium is not the only real-device option (XCUITest runs on real devices too), and Selenium does not drive native apps.

2. A new UI test file compiles but none of its tests run with Cmd+U. Its methods are named `checkLogin()` and `checkLogout()`. What is wrong?

 XCTest only runs methods whose names start with `test` The methods need the `@objc` attribute UI tests must be in a file called `UITests.swift` The simulator must be booted manually first

XCTest discovers tests by name: no-argument methods starting with `test`. File names do not matter and Xcode boots the simulator itself.

3. `app.textFields["login.password"].tap()` fails with "No matches found", although `print(app.debugDescription)` lists an element with identifier `login.password`. What is the most likely reason?

 The identifier must be prefixed with `#` The query needs `firstMatch` The app has not finished launching The element is a `SecureTextField`, so it has to be queried with `app.secureTextFields`

Queries filter by element type first. A password field is a secure text field, so a `textFields` query never sees it. The tree printout shows the type at the start of each line.

4. Which assertion gives the most useful failure message when the counter shows the wrong number?

 `XCTAssertTrue(count.label == "2 open")` `XCTAssertEqual(count.label, "2 open")` `XCTAssert(count.exists)` `XCTAssertNotNil(count.label)`

`XCTAssertEqual` prints both the actual and the expected value. The boolean version only reports that the expression was false, and the other two do not check the number at all.

5. After tapping Save, a toast appears for two seconds and disappears. The test should check that the toast went away before continuing. What do you use?

 An `XCTNSPredicateExpectation` with `exists == false` on the toast, waited for with a timeout `sleep(2)` `XCTAssertFalse(toast.exists)` right after the tap `toast.waitForExistence(timeout: 2)`

The predicate wait returns as soon as the toast is gone and fails only if it never goes. A sleep is slow and racy, a one-shot `exists` check can pass before the toast appeared, and `waitForExistence` waits for the opposite.

6. In a screen object, `signIn(email:password:)` returns a `TaskListScreen`. What does that buy you?

 Faster test execution Automatic retries when sign-in fails Tests read as a journey, and the compiler only offers actions of the screen the user is on The sign-in no longer needs accessibility identifiers

Returning the next screen models navigation in types. It does not change speed, retries or how elements are found.

7. Which pair of settings starts the Tasks app signed in with two tasks and nothing from earlier runs?

 `launchEnvironment = ["UITEST_SEED_TASKS": "A,B"]` only `launchArguments = ["-resetState"]` and `launchEnvironment = ["UITEST_SKIP_LOGIN": "1", "UITEST_SEED_TASKS": "A,B"]` `launchArguments = ["UITEST_SKIP_LOGIN"]` Setting the values on `XCUIApplication` after `launch()`

The app reads the reset flag from its arguments and the login and seed values from its environment, all at start-up. Values set after `launch()` only apply to the next launch.

8. The upload to a device cloud is rejected because the tests "cannot be installed". The zip's first entry is `Debug-iphonesimulator/`. What should you change?

 Rename the zip to `.ipa` Add the `.xctestrun` file to the zip Zip the project folder instead Build for testing with `-destination 'generic/platform=iOS'` and zip `TasksUITests-Runner.app` itself from `Debug-iphoneos`

Two mistakes at once: a simulator build, and the parent folder instead of the runner app. Real devices need iphoneos products, and the archive should start with the `-Runner.app`.

9. A CI run on TestingBot passed, but the certification page does not count it. The command was `testingbot xcuitest Tasks.ipa TasksUITests.zip --device "iPhone 16" --real-device --name certificate-xcuitest`. What is missing?

 The `--report junit` flag A second device in the same command `--build certificate-xcuitest`: the build name groups runs, `--name` only labels the run The `--async` flag

For XCUITest runs the build comes from the `build` capability, which the CLI sets with `--build`. Without it the run lands in a default "XCUITest Project N" build.

Check answers

[Previous · Chapter 10 XCUITest in CI with GitHub Actions](https://testingbot.com/resources/courses/xcuitest/ci-github-actions)
## You finished XCUITest Tutorial: iOS UI Testing in Swift

Put what you learned into practice. Run your tests on 6100+ real browsers and physical iOS and Android devices.

[Start free trial](https://testingbot.com/users/sign_up) [See pricing](https://testingbot.com/pricing) [Browse other courses](https://testingbot.com/resources/courses)

## TestingBot XCUITest Certification

Turn this course into a free, resume-worthy credential: pass the exam, run the course suite on TestingBot, and get a verifiable certificate for your LinkedIn profile.

[How it works](https://testingbot.com/resources/courses/xcuitest/certification)
