Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Questions tagged [xcuitest]

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

0
votes
0answers
12 views

Adding aps-environment entitlement to UITest Target in Xcode

I am testing an app that uses Push notifications. Within the main app target, the 'Push Notifications' (inside the Capabilities tab) is set to on. I created a UITest target for UI Automation Testing....
0
votes
1answer
8 views

Capturing screenshot within a function located in a separate file from your XCTestCase

I'm currently writing an automated iOS test using XCUITest. I have the main .swift file where the test actually is called from, and then I have a separate .swift file that has a few functions that I ...
-1
votes
1answer
43 views

Try-catch like feature for uncertain code block in Swift 4

I am writing a test in XCUITest. There is an introductory banner which may or may not come on the mobile screen while my test is in progress. I want to write my case in such a way that, if the banner ...
3
votes
1answer
91 views

How do I assert that a text field is empty?

I have an empty text field on my UI, though it has a placeholder text (whose value is foo) set in the storyboard. In my UI test, I am trying to check that its text value starts out empty, but when I ...
0
votes
0answers
10 views

How to do 'page' object design in XCUITest

I'm new to XCUITest. I would like to get some suggestions on how to design 'page' (actually more like screen) object XCUITest. Is there any open-source project that give samples to reference? I'm ...
0
votes
0answers
23 views

How do I add an extension for XCUIElement?

I am new to UI testing and xcode/ios development in general. How do I add extensions that hold methods that can be called within UI test targets? This is a SAMPLE extension I'd like to add: ...
0
votes
0answers
6 views

auto Reset simulators before each XCUITest

I would like to get simulators auto reset before each of my XCUITest. I was thinking the following options: 1. add [xcrun simctl erase all] command in scheme ==> Select the Product > Scheme > Edit ...
-1
votes
0answers
24 views

XCTAssert got 'XCTAssertTrue failed', but could see the value that I was trying to assert

This line will error out because of assert failed: XCTAssert(app.staticTexts["Scan items as you add them to your cart"].exists) But from the Accessibility Inspector (attached a screenshot), I could ...
0
votes
0answers
10 views

Getting app's console/file logs and video after running XCUITest automation

I am trying to automate a couple of flows for my iOS app. I am trying to build something which will be triggered timely on my MAC machine with phone connected using a shell script doing xcodebuild. ...
0
votes
1answer
31 views

How to clear NSUserDefaults programmatically in XCUITest using Simulator

I've read several answers related to this and they suggest doing one of the following, but these options are not working for me. I have an XCUITest and I'm trying to clear the standard user defaults ...
0
votes
0answers
44 views

Integrating SonarQube (Swift) with Bamboo

I tried SonarQube and sonar-scanner for my XCUItests locally on my machine using the docker image but now I want to integrate it with our CI (Bamboo), we already have our SonarQube server but I have ...
0
votes
0answers
28 views

xcuitest (swift) - how to retrieve the string/name of a table header

I'm trying to fix a problem I'm have where I can't retrieve the string value from a table header. I recreated a simple example of it myself and posted the code below. I've tried setting the ...
-2
votes
4answers
37 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
35 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
0answers
23 views

function testSuiteWillStart under XCTestObservation is getting called when running tests from Xcode

I am using Xcode version - Version 9.4.1 (9F2000). I am trying to create custom logs for tests running with XCUITest by overwriting XCTestObservation class and registering it with test class. ...
0
votes
0answers
10 views

Custom XCUITest framework

I have a utility class for my UI tests. I want to make it private by converting it into the framework. Since the UI tests runs in a different target, I really don't have any idea about the conversion ...
0
votes
0answers
25 views

XCUITest integration with TestRail

Currently working on integrating my UITest-run results into TestRail, so after every test run it marks my tests as Pass\Fail in testrail. The idea I have is: In CI create a "pre-build" script that ...
0
votes
0answers
19 views

Using a try for button tap in XCUITest not working

I've recently switched over to using XCUITest (from Appium/Java) and am having some trouble with the do / catch. I want the code to try tap on a button, then if it's unable to tap on the button, go ...
0
votes
1answer
36 views

XCUITest not recognizing alert

I'm new to XCUITest and have come across a problem where it's not recognizing an alert. I used the recorder to get the commands, but when I try to play it back, it fails with an error saying: No ...
1
vote
2answers
32 views

Can an XCTestRunner access View Controller properties of target application?

I am trying to write some smart UI tests using XCUITest. Now I want to build a test suite such that, depending on my applications ViewController I make deduce what type of testing happens. Example ...
0
votes
2answers
49 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
30 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 ...
1
vote
2answers
180 views

How to run automated XCUITests in Xcode for iOS via .ipa

I am facing an issue which ultimately results in following error - The bundle “$(PRODUCT_NAME)” couldn’t be loaded because its executable couldn’t be located. Try reinstalling the bundle. Error ...
0
votes
1answer
21 views

Call a method only once within XCUITest in Swift 4

My test suite contains some test cases. I have some private functions where I will check elements existence. Consider I have three test cases: func test_1() { ... checkListViewElements() ....
1
vote
0answers
53 views

xcodebuild error DVTAssertions: ASSERTION FAILURE while executing single command line test, but the all test case command works fine

I can execute my project using XCUItest with following command: xcodebuild test -workspace Maple.xcworkspace -scheme Maple -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 8,OS=...
0
votes
1answer
28 views

UITest does not work within Framework

I am creating a framework for an iOS and my framework contains UI(Visual Presentation) as well now I want to write XCTest for my framework and I am able write and run the unit Test as we do within ...
2
votes
1answer
57 views

Xcode XCUITest XCUICoordinate not working with press and/or drag

I am running Xcode 9.4.1 and trying to do long press and press & drag functions using XCUICoordinates. I have both methods working fine on XCUIElements but both failing when run against ...
0
votes
0answers
30 views

XCTestCase stops after failure

I have a XCTestCase, but if the test fail - the app quits right away. I did change this line to the following: continueAfterFailure = true and it still quit the app after failure. Does anyone know ...
2
votes
2answers
253 views

Upgrading XCode to 9.1 and iOS Simulator to iOS 11.1 has slowing down Appium-iOS tests drastically

Upgrading XCode to 9.1 and iOS Simulator to iOS 11.1 has slowing down Appium-java based tests drastically. My set-up Appium-ide: 1.2.7 Appium command-line: 1.7.1 IOS: macOS Sierra 10.12.6 XCode: 9....
0
votes
0answers
19 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, ...
0
votes
0answers
26 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
0answers
14 views

XCUITest ignores thenDragTo coordinate value

I am preparing user interface test and one of the steps is to select a date on calendar view. The view is slightly customised https://github.com/ruslanskorb/RSDayFlow. I want to scroll (to swipe since ...
0
votes
1answer
32 views

How to make UITests and api interact

I want to write test cases for my iOS application. I have managed to write UI tests but I am really getting confused as to how to make my application wait for the api to end. Just for example, UI ...
0
votes
1answer
26 views

getting output from URLSession in XCUITest

I'm trying to grab a value from a URL inside a XCUI Test. However it's not outputting so I'm not sure if there's anything I'm supposed to be doing aside from I've already tried in the code below: ...
0
votes
0answers
41 views

XCUITests crashes the application in specific page

I'm having a crash while running my UITests that doesn't happen within the actual app workflow. When I go to a specific page and check for the existence of a staticText the application crashes with a ...
1
vote
1answer
94 views

XCUITest: Failed to find Matching Element

I have a close button on a ViewController that is being presented as a ChildViewController. I have this button's accessibility turned on and the accessibility identifier is closeButton. This button ...
1
vote
0answers
46 views

Checkbox not hittable on iPad - XCUITest Apple

I'm working on a XCUITest for Fastlane Screenshot automation. All of the below code works totally fine on every iPhone Simulator. It's just a problem with the iPad. After starting the app I handle ...
0
votes
1answer
39 views

How can I get an XCUITest application (the XCUI Test application, not the SUT) to access the photos library?

I'd like to be able to have my XCUITest application post an image to a server. I've installed the image using the xcrun simctl addmedia command, but I can't figure out to how to access it from the ...
0
votes
1answer
16 views

Run UITest written within Framework

I am working on a framework which contains Visual Representation(UI) and I have written some UI tests into it but I am not able to run UITest written within framework. Could anyone please guide me ...
0
votes
0answers
30 views

Opening View Controller is extremely slow on Appium

In my app, instantiating and pushing view controller is extremely slow means it's taking 5+ minutes. Tested on simulator only. Code: @IBAction fileprivate func locationButtonTapped(_ sender: ...
0
votes
3answers
166 views

XCUI Test: How to fetch List of elements from the iOS screen

I have recently started automating iOS apps on iPhone real devices with the XCUI test setup. I got a scenario where my app contains 5 screens in the home page, each screen contains a unique card ...
0
votes
1answer
37 views

xcuitest- Trying to tap on a link within a linklabel

I am trying to tap on a link within a link label. Using the recorder I have this code for the tap event let link = XCUIApplication().scrollViews.otherElements.links["link here"] link.tap() does not ...
0
votes
1answer
19 views

How to identify some random widnows thrown while XCUITest running in xcode

We have UI automation code to test our app. While test suites are running randomly keychain throws a window to enter credentials to access keychain item. We are not sure when that window is thrown. ...
0
votes
1answer
18 views

Run xctestrun from command prompt in windows

How to run xctestrun in an ios device connected through usb from command prompt in windows.. This can be achieved in a mac using the xcodebuild command inbuild within the xCode IDE. Need similar ...
0
votes
0answers
11 views

Is it possible to move an app to a split view / a slider over view programmatically inside ui test after an app running?

I want to test that some functionality works in a split/a slide over view. My current ui test opens the dock panel and tries to drag the iMessage app to the right border of a simulator's screen. ...
0
votes
1answer
59 views

XCUITest on multiple devices

I need to automate this scenario: Do sth on 1st device (tap UI element) Verify sth on 2nd device (verify UI element) Do sth on 2nd device Verify sth on 1st device Is this doable on XCUITest? Is it ...
0
votes
2answers
38 views

XCTestCase - how to assert on a NSTextView containing String?

I have a macOS project that I'm creating UI tests for. While it's relatively easy to find staticText, buttons, etc. by their text value. Using a subscript lookup on .textViews doesn't (seem to) work....
0
votes
0answers
19 views

XCUIElementQuery to return elements not containing particular elements

As the title suggests, I need to find the better way to get access to elements or cells that don't contain a particular object. The object is always either there or not. No duplicates within the ...
1
vote
1answer
51 views

UITests failing when run in group but succeed when run independently

I'm currently working on a project with many asynchronous code and I'm writing the UITests for this project. During the development I run them one by one but never in a group. So I thought the tests ...
1
vote
0answers
134 views

UI Tests with react native. How to fix Timestamped Event Matching Error: Failed to find matching element

I am trying to integrate UI tests in an quite big react native project. But as soon as i want to record the ui test i get the warning Timestamped Event Matching Error: Failed to find matching element ...