Questions tagged [xcuitest]

Apple's XCUITest framework for UI Testing on iOS and Mac OS.

638 questions
50
votes
9 answers

Strong password autofill appears in iOS simulator

Our UI test suites are showing some unexpected behaviour where our Create Password screen intermittently auto-completes both the username and password - this results in the test being failed. The process is something like: Tap in the first create…
Estel
  • 2,154
  • 2
  • 18
  • 25
33
votes
7 answers

Xcode 11 XCUITest Failed to get matching snapshots: Error getting main window kAXErrorServerNotFound

After building my app in Xcode 11 and running my suite of XCUITests I am getting many random failures with the following. Failed to get matching snapshots: Error getting main window kAXErrorServerNotFound No matter how long I increase timeouts the…
Luke Street
  • 441
  • 1
  • 4
  • 8
20
votes
2 answers

Xcode 11 simulators thrown a warning message each time a test is run

Running any XCTest with Xcode 11 and iOS 13/12 simulators throws the below warning message: xcodebuild[95489:2342933] [MT] DVTAssertions: Warning in …
mark w.
  • 1,047
  • 9
  • 16
17
votes
0 answers

XCUITest - Test runner never began executing tests after launching

Whenever I'm trying to run any of my iOS automation tests, only the runner app gets installed and none of the tests actually get executed because the executable is not installed. This issue occurs regardless if installing the app on an iOS Simulator…
17
votes
4 answers

XCUITest recording fails with "Please select a scheme where "XCUITodo" is the executable"

I'm using Xcode 8 to automate my application. I get started by downloading an existing code: XCUIToDo project. I opened the project in Xcode, and when I click on the Record button, I'm seeing a warning message "Please select a scheme where…
NeedHelp
  • 171
  • 1
  • 4
13
votes
2 answers

How can I locate an XCUIElement searching by partial label text in Swift?

I have been locating XCUIElements using this method: app.staticTexts["Full Label Text"] But what if I only know part of the label text? Part of the label text is generated dynamically (e.g. "Item #1", "Item #2", etc.) so I would like to search for…
C J
  • 567
  • 2
  • 4
  • 11
12
votes
2 answers

disable iOS simulator 'connect hardware keyboard' programmatically

I'm writing XCUITests for view has 2 UITextField and by defualt the simulator has hardware keyboard connected, hence the software one is not being presented. Is it possible to set some settings (maybe in schema?) to force-disable connecting hardware…
Nitisha Sharma
  • 263
  • 3
  • 12
11
votes
1 answer

ATTrackingManager.AuthorizationStatus always returns notDetermined

I don't know can I use this functionality in my UI tests on iOS, but I try it, an have problem with this. In my UI tests I can choose Allow tracking for my app or I can decline tracking, but after all these actions, I want checkout status IDFA via…
Valentina
  • 584
  • 1
  • 9
  • 25
9
votes
2 answers

Accessibility Inspector not working on Xcode Version 13.3 on macOS Monterey Version 12.3

I launch the Accessibility Inspector from within Xcode but it doesn't let me interact with elements in the simulator. I relaunched Xcode, the Accessibility Inspector and simulator but it doesn't seem help. The simulator I'm using is for iPhone…
Sara
  • 105
  • 1
  • 5
9
votes
0 answers

Error getting main window kAXErrorServerNotFound - Cannot Find the Target Application

My XCUITest will fail on one screen because of cannot Find the Target Application: Could anyone please give some suggestion here? I don't understand how comes when first land on this screen the script can still locate the Application, but a few…
user10252638
  • 111
  • 4
9
votes
3 answers

Force Software Keyboard in iOS Simulator for XCUITest

I am using XCUITest to test UI behaviour when the keyboard is present - for example, if content properly moves up when the keyboard appears. For some reason, the iOS simulator insists on regularly just disabling the software keyboard. Sometimes…
BlackWolf
  • 5,239
  • 5
  • 33
  • 60
9
votes
4 answers

How do I access my swift classes from my UI tests?

I have a UI test like so : func testHome(){ if(isRedOrange.clear()){ //code } } How would I access my isRedOrange.clear function from my isRedOrange.swift file from my UI tests?
Helosy
  • 339
  • 1
  • 6
  • 14
9
votes
4 answers

In XCUITests, how to wait for existence of either of two ui elements

Looking at XCTWaiter().wait(...) I believe we can wait for multiple expectations to become true using this code let notHittablePredicate = NSPredicate(format: "hittable == false") let myExpectation = XCTNSPredicateExpectation(predicate:…
Hasaan Ali
  • 1,192
  • 16
  • 22
9
votes
2 answers

UI testing - No matches found for Descendants matching type... recording generated code

I am getting an error No matches found for Find: Descendants matching type NavigationBar from input {( Application, 0x60400019b790, pid: 20515, label: '' )} but the code was generated by the recording function of XCUITest so I don't…
donutjuice101
  • 91
  • 1
  • 1
  • 2
9
votes
1 answer

Xcode Scheme Default Location is ignored in Tests

I've created a GPX file and added it to my project. If I have my project running, I can select the GPX file from the dropdown of possible locations to simulate and have it correctly apply the defined path. The project contains 2 schemes: the Main…
Jan K
  • 365
  • 1
  • 14
1
2 3
42 43