Same here in Xcode 14.2: Xcode starts to show the error "cannot find XCUIApplication in scope" in UI test files, even though the tests can build and succeed.
Clearing build folder (cmd + shift + k), quitting Xcode (cmd + q), restarting Xcode, and finally clearing folder again helps.
Very disturbing to workflow though.
Same here in Xcode 14.2: Xcode starts to show the error "cannot find XCUIApplication in scope" in UI test files, even though the tests can build and succeed.
Clearing build folder (cmd + shift + k), quitting Xcode (cmd + q), restarting Xcode, and finally clearing folder again helps.
Very disturbing to workflow though.