Questions tagged [xcode-ui-testing]

UI Testing in Xcode was introduced in Xcode 7, allowing a developer to write UI tests in Swift/Objective-C. The primary method of interacting with an app is via an instance of XCUIApplication. Tests run via the Product > Test menu item or from the editor, with results displayed in the Test navigator....

0
votes
0answers
20 views

How to hit a breakpoint in application while running UI test in iOS?

We have an iOS application for which we have written XCUI tests. We need to debug the iOS application while the test is running to capture some data. But breakpoints set in the application are never ...
0
votes
1answer
17 views

Xcode: Why won't my launch arguments work while recording UI tests?

As I am planning to setup UI tests into my app, and using launch arguments to mockup some data, I realized something while building a simple test project: In the app target: class ViewController: ...
0
votes
1answer
15 views

XCUITest: Interacting with table with many cells

I have a UITableView with a search bar. The table can contain thousands of cells. Performance is fine, since only cells on-screen are actually fetched/rendered. I'm trying to interact with the ...
0
votes
0answers
16 views

UITest code coverage report - Is there any way to merge multiple .xccovreport?

For some reason, I need to execute UITest through xcodebuild commandline tool for several times. A xccovreport will be generated for each xcodebuild execution. So I will obtain many xccovreports. Is ...
0
votes
0answers
11 views

Waiting for focus using predicate on XCUIElement

I'm currently using NSPredicate to wait for conditions on XCUITest elements, as follows: class func waitForCondition(condition: String, element: XCUIElement) -> Bool { let predicate = ...
0
votes
1answer
68 views

Xcode 10 UI Tests Reason: Image Not Found with Cocoapods

I'm trying to run a UI Test in my app but as soon as the simulator launches I get: The bundle “AppUITests” couldn't be loaded because it is damaged or missing necessary resources. Try reinstalling ...
0
votes
1answer
31 views

iOS - How to differentiate UI and Unit tests, and how to use them in this concrete situation?

I am completely beginner about UI and unit tests, and very confused about how to use them, as well as how to differentiate them. So I have thought about the following use case: I have a user who has ...
1
vote
1answer
58 views

The bundle “MyProjectUITests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle

I'm willing to add unit and UI tests to my app. I first configured unit tests with success, I tried to do the same with UI tests. Here is my Podfile, after adding a new UI Testing Bundle target : ...
0
votes
3answers
49 views

Getting the value in the textfield in IOS Simulator

I am new to Swift and x-code. I'm currently developing an app where there is only one textbox and one submit button. I am writing a test case which is like this- "Whenever i click the submit button, ...
0
votes
2answers
33 views

XCUIElement unique identifier

In XCUITests, is there an unique way to identify a given XCUIElement that persists across queries? I can't use labels because sometimes elements can come with identical labels. Hash/hashvalue works ...
0
votes
0answers
35 views

Is there a way to determine which view invoked “Timestamped Event Matching Error”

The "Timestamped Event Matching Error" is common one regarding Xcode Testing as seen from popular StackOverflow questions here and here and the concensus to solve it seems to be: Enable the ...
0
votes
1answer
19 views

How to deal with recycling lists

I'm building a UI test suite for an iOS app using XCUITest api. The app uses recycle lists and I need to access specific cells of those lists during my tests as shown in the code below: let cells: ...
0
votes
1answer
45 views

Element does not retain its Storyboard accessibility identifier or type in runtime

I have an automated UI test to make sure a page displays the correct elements by searching for them using XCUIElement queries like so let instructionLabelID ="UIA_HelpViewController_InstructionLabel"...
0
votes
0answers
33 views

Unit tests that need UI input?

I know that unit tests aren't supposed to deal with the UI, and that UI tests shouldn't involve testing the model, such as whether testing a value is nil or not. But what about when the model ...
-1
votes
1answer
59 views

XCUITest: Failed ( Thread 1: EXC_BAD_ACCESS (code=1, address=0x0) ) when trying click on text field

I'm getting this error on the XCUITest when trying click on text field: (i'm using Xcode Version 9.4.1 ) Thread 1: EXC_BAD_ACCESS (code=1, address=0x0) This the unit Test: let app = ...
3
votes
2answers
168 views

Get current GPS position in iOS UITest

Is it possible to get the current GPS position of the phone/simulator in a UITest test-case? One possible workaround would be to run a test app in the background and communicate with that app in the ...
0
votes
1answer
114 views

Xcode 10 GM: XCUIScreen.main.screenshot() crashes with `dyld: lazy symbol binding failed`

When I run XCUIScreen.main.screenshot() (in Xcode 10 GM) from an XCTestCase the test crashes with: dyld: lazy symbol binding failed: can't resolve symbol _XCStringFromRect in /Applications/Xcode.app/...
0
votes
0answers
29 views

iOS UITesting element appear few seconds

How can i assert that my spinner exists for a limited period of time? I tried both exists and waitForExistence but since the element after few seconds disappear the test fails. If i remove from code ...
0
votes
0answers
15 views

How does Xcode server run tests in release mode without Enable Testability?

When using Xcode server to execute UI Tests, the bot has a setting to 'override' the configuration to Release mode. This was handy as tests would be executed on release build. Now when I am trying ...
1
vote
1answer
26 views

Play audio file as microphone input using AudioKit - for iOS simulator dictation testing

I am looking for a way of play an audio file and have it as input for the iOS simulator microphone. I am creating a bunch of UI tests for an iOS app that uses dictation (speech-to-text) and I didn't ...
0
votes
1answer
52 views

How to access Apple Id “Sign In” dialog from UI Test?

I have some UI tests and wanna test what happens when I press "subscribe" button. In simulator there is an alert displayed asking to sign in with apple id: I tried to wait for alert using app.alerts["...
0
votes
0answers
37 views

Xcode swift UI Testing compare two screenshots

Basically what I have is a list of items and i can create a new item in that list using a button. Now I want to test whether the item is added in the list when button is clicked or not. While ...
0
votes
0answers
15 views

UI test returns wrong number of otherElements

I have a UI test that checks if an annotation view is shown on an MKMapView. Since annotation views are accessed as otherElements, I use the following code: let actualPinsShown = shopEasyApp....
0
votes
1answer
24 views

XCUIElement hierarchy within UITableViewCell

I encountered a strange behaviour in UI-tests. When I add a custom view into UITableViewCell, some of it's subviews are not accessible. However, it's OK in Xcode's Debug View Hierarchy. Yes, I know ...
0
votes
1answer
28 views

Recording tap on UISegmentedControl gets assertion fail during test

I have a segmented control with three buttons, labeled "I", "II" and curiously enough "III". When I run in the simulator and record, it emits code of the form: let app = XCUIApplication() app....
1
vote
0answers
24 views

How to UI test workflows that uses controllers provided by the system

I wanna UI test an app workflow that calls, beside others, an UIDocumentPickerViewController. I tried to record this workflow in Xcode, but when i reach this controller i get an error message saying ...
-2
votes
4answers
87 views

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....
1
vote
0answers
42 views

XCTest can't find the test bundle

I am trying to write XCUItests for an iOS app that is build using Appcelerator-Alloy. I opened the xcodeproject from the build folder, added a UI test bundle and then a UI test class (it has an ...
0
votes
2answers
65 views

“Neither element nor any descendant has keyboard focus” when running XCTestCase in a real iPhone

I'm trying to run a UI test case where there are two input fields exists. Following is my code let usernameTextField = app.webViews.otherElements["Identity Server"].textFields["Username"] let ...
0
votes
0answers
19 views

fastlane snapshot - localized button titles

I'm currently struggling with the automatic screenshot generation using fastlane or better snapshot. My idea is/was to surpass the login screen by pasting username and password into the corresponding ...
0
votes
0answers
41 views

How to create an XCTestCase for UIViewController (using NIB) in swift?

I have intermediate experience in iOS development, but never tried to write test cases till last week, I am trying to create UI test cases for UIViewController, by reading many articles regarding ...
0
votes
1answer
70 views

Perform a full swipe left action in UI Tests?

I have implemented leading and trailing swipe actions in a table view. Now, I'm trying to test them in XCTest UI tests. To test a regular swipe in either direction is easy: tableCell.swipeRight() ...
3
votes
1answer
85 views

How to UI test UICollectionViewCell didSelect

I have a UIViewController that has a child UIViewController, this child holds a UICollectionView and inside this collectionView I need to simulate a didSelect method or in other words, a user tapped ...
0
votes
0answers
25 views

Can we run MAC OSX UI Tests using xcbuild or xctool

I am using Xcode 9+. I didn't find any documentations related to MacOSX UI Tests running from command line and there are many about iOS. I am using XCTest framework which allows running tests from ...
0
votes
0answers
58 views

How can I UITest the change of the image of a UIButton in Swift?

When I tap a UIButton, the image should change to reflect its new state (e.g. Record -> Pause etc). In my XCode UITest function, how do I interrogate the buttons current image after the tap to assert ...
0
votes
1answer
36 views

Is it possible to operate with the last of matching elemenst in XCTest?

I would like to tap the last [Play] button in my app, and I'm looking for something like app.buttons["play"].lastMatch.tap() Is there any way to do so?
0
votes
1answer
34 views

IOS Testing framework that can run all test then generate a report?

I need a advice from you guys. I need a framework to do Automation UITest for IOS Apps. I need to write the tests then to run them all and at the end to give me a report. What can I use to do my tests ...
0
votes
3answers
66 views

Is it possible to match UI elements by labels using regex in XCUIElementQuery?

I'm currently learning how to create UI Tests in XCode. I use XCUIElementQuery to locate alert and close it let dismissSavedPasswordButton = app.alerts["Select a Saved Password to Use With “My App”"]...
0
votes
0answers
19 views

FIRApp.configure() causes crash in UITesting for m iOS application

I am trying to write some uitest methods for my application. However, FIRApp.configure() line which is called in AppDelegate causes crash with this message. Main Thread Checker: UI API called on a ...
0
votes
1answer
38 views

Xcode UI Test using ErrorTextField from Material Library

I'm using ErrorTextField from ComicMind's Material library. How to access the detail value when using UI Test if i want to check the detail value in a certain point in the test. e.g. let ...
0
votes
1answer
48 views

Uitest refresh control swift

I am trying to add uitest for refresh control but I could not have done it because of I can't get access to refresh control with accessibility identifier (refreshControl.accessibilityIdentifier ="...
2
votes
4answers
400 views

How to get rid of this Error Generating Code Coverage in Xcode 9.4

I continuously see this pop up "Error Generating Code Coverage " when I try to run my UI Tests and this is followed by another error bundle identifier missing. I have enable code coverage in test ...
0
votes
0answers
12 views

Unable to access my NSMenu in UI tests

I have NSmenu object as statusMenu, I have set its accessibility identifier as "testMenu" But when I try to access it in my UItests as below let app = XCUIApplication() let menu = ...
1
vote
0answers
34 views

Asynchronous wait failed for XCUI tests:Exceeded timeout of 60 seconds, with unfulfilled expectations

let button = app.buttons["BACK TO DASHBOARD"] let exists = NSPredicate(format: "exists == 1") expectation(for: exists, evaluatedWith: button) { // If the button exists, ...
1
vote
2answers
58 views

How to query “Main Window” in iOS UI tests?

At one point in my tests I need to interact with views that are inside Main Window. When I do a po app.windows, I get this: Find: Target Application 0x1c40d7680 Output: { Application, ...
0
votes
1answer
40 views

UI Test for AVFoundation's Camera

I'm trying to create a UI test for QR reader. I'm using AVFoundation's barcode types to decode QR. When user pressed the button QR Reader will appear. If the camera captures QR code with the correct ...
0
votes
2answers
64 views

XCUI tests failed due to Asynchronous wait failed: Exceeded timeout of 30 seconds, with unfulfilled expectations

let webViewsQuery = app.webViews let emailOrPhoneTextField = webViewsQuery/*@START_MENU_TOKEN@*/.textFields["Email or phone"]/*[[".otherElements[\"Sign in – Google accounts\"].textFields[\"Email ...
0
votes
1answer
29 views

Can't get path of image in NSBundle?

I am trying to get the path of an image while UITesting. I've tried multiple ways as shown under here, but none are working? Name of image file is: TestImage.fff NSBundle* testBundle = [NSBundle ...
0
votes
1answer
83 views

iOS Webview UI Testing

Unable to access UI elements during UI testing of an iOS application based on ionic framework. For instance, I would like to tap the button with the label "home Home". Below is my debugDescription of ...
4
votes
1answer
60 views

UIPicker not selectable while UI Testing

I'm trying to create a test for a flow in my app that includes two UIPickerView and I'm unable to select them while running in the "record" mode of Xcode. Also if I check the count of datePickers, ...