Apple's XCUITest framework for UI Testing on iOS and Mac OS.
Questions tagged [xcuitest]
638 questions
4
votes
3 answers
Is it possible to automate two apps at the same time in iOS?
We have this scenario:
Execute the script in app1, in certain step app1 sends us a SMS with a URL, app1 is expecting a validation code in a textfield
We have to open SMS app to verify if SMS exists, this SMS has a URL and when we click on it, it…

Ricardo Cruz
- 41
- 1
- 3
3
votes
1 answer
no such file or directory - swiftdoc swiftmodule swiftsourceinfo swiftdoc
I have a project where I write XCUITests. I would like to place the accessibility IDs in a separate framework along with other things so that they can be read in the project and in the tests.
MyProject
- MyProject.xcworkscapce
- MyFramework
-…

brainray
- 12,512
- 11
- 67
- 116
3
votes
2 answers
SwiftUI tvOS custom Button missing accessibility Focused state
TL;DR: Is there any way to have custom button style (custom pressed state) in SwiftUI on tvOS while it is still working correctly with Accessibility Focus API and therefore its hasFocus works in UI tests?
Please visit dedicated Github repo for a…

Lukas Kukacka
- 7,604
- 2
- 25
- 50
3
votes
1 answer
SwipeUp and Swiping Right not working correctly on XCUITest - M1 Mac
On an intel computer, my XCUITest test works perfectly fine to swipe left and swipe right on a cell using cell.swipeRight() or cell.swipeLeft().
On my m1 computer, cell.swipeLeft() works but cell.swipeRight() doesn't. I don't think it swipe right…

reutsey
- 1,743
- 1
- 17
- 36
3
votes
0 answers
Accessing Watch Faces with the XCUITest Framework
Context
I'm building Unit Tests for the Apple Watch using the XCUITest library. I'd like to take screenshots of the Watch Faces on the simulator, so I was thinking on using the bundle ID of the 'Clock App' via the:
XCUIApplication(bundleIdentifier:…

西間木
- 31
- 1
3
votes
3 answers
XCTest The test runner exited with code -1 before finishing running tests
We are running Xcode 12.4 and keep randomly seeing the following errors when running our XCUITest tests:
The test runner exited with code -1 before finishing running tests
We can rerun the failed tests and they will pass. Does anyone know the…

reutsey
- 1,743
- 1
- 17
- 36
3
votes
1 answer
XCUITest performance result metric has only duration
I created a XCUITest für measuring performance almost similar like in this WWDC video:
https://developer.apple.com/videos/play/wwdc2020/10077/
With this measure part:
measure (metrics: [XCTOSSignpostMetric.scrollDecelerationMetric]){
…

Patrick_K
- 219
- 2
- 11
3
votes
1 answer
Passing environment variables to XCUITest
I run UI tests on CI/CD provider (like CircleCI), I need to read multiple secret environment variables (like testing username and password). I could easily set it but I don't understand how to pass them properly to test cases.
I found 2 ways to do…

Vasily
- 3,740
- 3
- 27
- 61
3
votes
4 answers
Is it possible to testing uitest (XCUI) when open url external browser?
Currently, I have to create automation ui test with XCUI and I have some action to open external browser by default is Safari.
I need to create some uitest's behavior like this.
Go to external browser when click my button.
Check is open correct url…

Nawin P.
- 223
- 1
- 4
- 11
3
votes
1 answer
appium - XCUITest does not always start with error ECONNREFUSED
I am trying to run some appium tests on iOS and it seems about half the time the WebDriverAgent never starts up. I get this error over and over again in the appium logs:
[debug] [simctl] WD Proxy Matched '/status' to command name…

kroe761
- 3,296
- 9
- 52
- 81
3
votes
1 answer
How to dismiss iOS 14 datePicker modal?
My development team has implemented the new iOS 14 date picker in the "compact" style, which pops a modal on top of our application. It doesn't have any controls to dismiss. As a user, I can tap outside the modal, which I figured…

Mike Collins
- 4,108
- 1
- 21
- 28
3
votes
0 answers
How to uninstall and install a app for every test in XCUITest (Xcode 11.7)
In my present app, after user registers, we won't show the register screen again
Is there any way to uninstall and install the app or at-least to clear the app cache to get the register screen for every test.
I am using XCODE 11.7 and i am running…

teja
- 127
- 2
- 11
3
votes
1 answer
UIPasteboard.general.string takes too long
In my UI test, I have a test where I am using the UIPasteboard to throw the input around. Just before I use it, I store the current value of the pasteboard into a local temporary variable like so: let currentClipboard = UIPasteboard.general.string…

Bawenang Rukmoko Pardian Putra
- 1,311
- 1
- 17
- 33
3
votes
1 answer
How to access xcconfig variables from XCUITest code
I need to access an environment variable named ENV that is set in the xcconfig file for my main app target, but from inside my UI test target.
After doing a ton of googling this is what I've tried:
set the main xcconfig as the configuration for the…

rmp251
- 5,018
- 4
- 34
- 46
3
votes
1 answer
Inputting textfields is flaky when running all tests at once using parallel testing
I am trying to do UI Tests using XCUITest. Currently I have a bit of a problem in inputting a text into a UITextField. Here is what I've got in my Robot class to type the text using the keyboard:
func typeTextToTextField(_ element: XCUIElement,…

Bawenang Rukmoko Pardian Putra
- 1,311
- 1
- 17
- 33