Create and run unit tests, performance tests, and UI tests for your Xcode project using XCTest.

XCTest Documentation

Posts under XCTest tag

182 Posts
Sort by:
Post not yet marked as solved
14 Replies
18k Views
I have a test I want to be able to run, but need to be able to handle different states, might be logged in, might have saved login credentials in Safari, etc.When a system dialog, "Safari Saved Password" in this case, comes up, I cannot seem to affect it any way, even though I have recorded a session that selectes "Not Now", the query actually fails to find the button.The Accessibility inspector shows the button existing about 3 levels down, but there doesn't seem to be a way I can find to access it. AXApplication AXWindow AXButtonIs there a way to get to this thing?Thanks!
Posted
by
Post not yet marked as solved
21 Replies
11k Views
How can this be controlled? For example, I have 4 different options in my picker wheel (a blank “ ” option, BUDGET, MISC, and WORK ISSUE). If my current value of the picker wheel is BUDGET, and I call the adjustToPickerWheelValue() method to change it to MISC, I will get an error “UI Testing Failure – Internal error: unable to find current value ‘BUDGET, 2 of 4’ in possible values BUDGET, MISC, WORK ISSUE…”. It’s the “, 2 of 4” that is messing the value up. This is also the value of the picker wheel I see when I use the simulator’s accessibility inspector tool.Also...We have search fields embedded in the same component as our Segmented Control and the testing framework is unable to interact with it. If I record my actions in XCode, when I tap this search bar, it records the code app.tables.searchFields[“Search”].tap(), but this line does not execute properly. An error is raised that the framework cannot find the element. I have even tried to query the element by using app.descendantsMatchingType(.SearchField).element, but that still would not return the results I was looking for.
Posted
by
Post marked as solved
11 Replies
17k Views
Has anybody found a good way to scroll to an element?I can do something like the below function. But I am running into situation where a single swipeUp is too much swipe!! It looks like swipeUp is about 1.5 the size in view. So when I swipe up the element I am wanting goes out of view in the top.Any ideas?Thanks!func swipeUpUntilElementFound(app: XCUIApplication, element : XCUIElement, maxNumberOfSwipes : UInt) -> Bool{ if element.exists{ return true } else { for _ in 1...maxNumberOfSwipes{ app.swipeUp() if element.exists{ return true } } return false } }
Posted
by
Post not yet marked as solved
1 Replies
631 Views
HiThe app under test is localized and internationalized. So when device language is changed, strings displayed on the app are changed.I am trying to write test cases that work independent of the current language, in order to achieve this some of the static text/button labels have to be localized for the element query to work correctly.How can we achieve this? If I try to have all the strings in an external file, the bundle created for UITesting for some reason does NOT include this strings file.Can someone please shed light on how to include non-code files into UI Testing bundle?I tried having the file named as .json, .strings. It does not work.ThanksNaveen
Posted
by
Post not yet marked as solved
1 Replies
305 Views
We are trying to build tooling around UI tests. We'd like to get a list of all of the UI tests in our project. Does anyone know how to do this on the command line using xcodebuild or some other command line tool?Also, do you know if it's possible to ask xcodebuild to only run specific tests via the command line some how?
Posted
by
Post not yet marked as solved
6 Replies
5.1k Views
When we run our UI tests locally with Xcode all tests pass time after time. But when we run the UI tests on our continuous integration server using Fastlane many tests fail with "UI Testing Failure - No matches found for". While investigating the issue we found that the UI tests also fail when run them locally using `xcodebuild test`. Is anyone experiencing the same issues? Why do the UI tests behave differently when run using Xcode and `xcodebuild test` on the same machine ?
Posted
by
Post not yet marked as solved
3 Replies
705 Views
In order to test my application UI I need to be able to open file but XCUITests recording doesn't work after a NSOpenPanel is displayed.Is there something I'm missing or any workaround?In my case I want to open a video in my AVPlayer.
Posted
by
Post marked as Apple Recommended
1.2k Views
Hello,I have unique requirement where i want to use automation frameworks such as XCUITest etc. to be able to automate 3rd party apps. I know that the XCode 8 now has native support however so far from what i can tell it only works if you have access to source code?In my case the app is available as a binary and there is no source code access available/possible? In this case any recommendations how Ui based autoamtion can be built and used?Previoulsy i was able to use UiAutomation framework but that has been depcreated in latest XCode. In the new XCUITest framework I havent been able to sort out how to target a 3rd party app installed on the iPhone and automate that.Any help would be appreciated.Thanks
Posted
by
Post not yet marked as solved
2 Replies
2.1k Views
In Unit Test, I have a simple table view with a bunch of basic cells (cells with just a label). I would like to access the cell using `cellForRow(at:)`, so I can test thing like selecting and deselecting the row programmatically, but this `cellForRow` queiry always returns `nil`.There is some discussion online that I should be using the data source's `tableView(_, cellForRowAt:)` instead. This is _not_ my intention. I only want to test the cell's visibility, test selecting and deselecting them. To test for visibility, `cellForRow(at:)` is the right function to use. Furthermore, the data source's `tableView(_, cellForRowAt:)` has no safeguard for out-of-range index access, while table view's `cellForRow(at:)` will gracefully return `nil` in this case, which I also wanted to test my table view controller on.However, while I can always get a valid cell from `tableViewController.tableView(_:cellForRowAt:)`, I couldn't understand why I always get `nil` from `tableView.cellForRow(at:)`. I have verfied both the `tableView` and the `tableViewController` are not `nil` in my unit test, and I have also triggered view loading with:_ = tableViewController.viewin `setUp()`. I also verified with `tableView.indexPathsForVisibleRows`, and the result _does_ include the index path I used for `cellForRow(at:)`.When I queried my cell through LLDB and breakpoints, sometimes my cell would show up properly. Is it possible that I am missing things like asynchronous waiting since loading up cells visually may be done in a different thread? Am I supposed to add expectation waiting of some sort to wait until the cells are fully loaded up before I can access them with `cellForRow(at:)`, even through `tableView.indexPathsForVisibleRows` already returns the expected index paths.? I tried to set this up but I'm not sure how to override my table view controller's `init()`.Here's my code in the Unit Test class.import XCTest @testable import TableViewTest class TableViewTestTests: XCTestCase { private var appDelegate: AppDelegate! private var tableVC: TableViewController! override func setUp() { super.setUp() appDelegate = UIApplication.shared.delegate as! AppDelegate let storyboard = UIStoryboard(name: "Main", bundle: Bundle.main) tableVC = storyboard.instantiateViewController(withIdentifier: "TableViewController") as! TableViewController // Trigger view load and viewDidLoad() _ = tableVC.view } override func tearDown() { super.tearDown() } func testGetFirstRow() { let tableView = tableVC.tableView! let indexPath0 = IndexPath(item: 0, section: 0) let cell0 = tableView.cellForRow(at: indexPath0) let visibleRows = tableView.indexPathsForVisibleRows XCTAssert(visibleRows != nil) // PASSED XCTAssert(tableView.indexPathsForVisibleRows!.contains(indexPath0)) // PASSED XCTAssert(cell0 != nil) // FAILED } func testGetFirstRowDataSource() { let tableView = tableVC.tableView! let indexPath0 = IndexPath(item: 0, section: 0) // This won't check for cell visibility. let cell0 = tableVC.tableView(tableView, cellForRowAt: indexPath0) let visibleRows = tableView.indexPathsForVisibleRows XCTAssert(visibleRows != nil) // PASSED XCTAssert(tableView.indexPathsForVisibleRows!.contains(indexPath0)) // PASSED }
Posted
by
Post not yet marked as solved
2 Replies
2.1k Views
When executing the test suites I have, I see many times where the “wait for app to idle” stalls and will time out with the message “App animations complete notification not received, will attempt to continue.”The code I used to make the test suites have zero customized code and most of it was generated via the recorder. Example below: t = 23.41s Find the "btn login" Button t = 23.41s Snapshot accessibility hierarchy for com.testapp.mobilecordova t = 24.44s Find: Descendants matching type NavigationBar t = 24.44s Find: Elements matching predicate '"LOG IN" IN identifiers' t = 24.44s Find: Descendants matching type Button t = 24.44s Find: Elements matching predicate '"btn login" IN identifiers' t = 24.45s Wait for app to idle t = 24.95s Synthesize event t = 25.22s Wait for app to idle t = 147.39s App animations complete notification not received, will attempt to continue. t = 147.39s Snapshot accessibility hierarchy for com.testapp.mobilecordova t = 148.10s Find: Descendants matching type StaticText t = 148.10s Find: Elements matching predicate '"PLEASE TURN ON NOTIFICATIONS" IN identifiers' t = 148.10s Use cached accessibility hierarchy for com.testapp.mobilecordova t = 148.10s Find: Descendants matching type CollectionView t = 148.11s Find: Descendants matching type StaticText t = 148.11s Find: Elements matching predicate '"3D Rooms Now Available!" IN identifiers' t = 148.11s Use cached accessibility hierarchy for com.testapp.mobilecordova t = 148.11s Find: Descendants matching type StaticText t = 148.12s Find: Elements matching predicate '"DAILY" IN identifiers' t = 148.17s Check predicate `exists == 1` against object `"HOME" StaticText` t = 148.17s Snapshot accessibility hierarchy for com.testapp.mobilecordova t = 148.62s Find: Descendants matching type NavigationBar t = 148.62s Find: Elements matching predicate '"HOME" IN identifiers' t = 148.62s Find: Descendants matching type StaticText t = 148.62s Find: Elements matching predicate '"HOME" IN identifiers' t = 148.62s Use cached accessibility hierarchy for com.testapp.mobilecordova t = 148.63s Find: Descendants matching type NavigationBar t = 148.63s Find: Elements matching predicate '"HOME" IN identifiers' t = 148.63s Find: Descendants matching type StaticText t = 148.63s Find: Elements matching predicate '"HOME" IN identifiers' t = 148.63s Use cached accessibility hierarchy for com.testapp.mobilecordova t = 148.64s Find: Descendants matching type Button t = 148.64s Find: Elements matching predicate '"My Friends" IN identifiers' t = 148.64s Tap "compose" Button t = 148.64s Wait for app to idle t = 269.48s App animations complete notification not received, will attempt to continue. t = 269.48s Find the "compose" Button t = 269.48s Snapshot accessibility hierarchy for com.testapp.mobilecordova t = 269.96s Find: Descendants matching type CollectionView t = 269.96s Find: Descendants matching type Button t = 269.97s Find: Elements matching predicate '"compose" IN identifiers' t = 269.97s Wait for app to idle t = 391.80s App animations complete notification not received, will attempt to continue. t = 391.80s Synthesize event t = 392.12s Wait for app to idleI have been searching for a way to modify this or add code to make it pass but have not been successful. I tried disabling the animations and found that the tests no longer wait and tests fail 100% of the time.
Posted
by
Post marked as solved
5 Replies
6.8k Views
Hi everyone!Is it possible that the use of the tap() method doesn't work on UITableViews when the cell is not visible? Official documentation says that the method should make the cell with the correspective identifier visible and then tap on it.But if I try this code:let app = XCUIApplication() let myTableView = app.tables.element(matching: .table, identifier: "tableView01") let myCell = myTableView.cells.element(matching: .cell, identifier: "tappableCell") myCell.tap()I get this error: << UITests.testP() failed: Computed invalid hit point (-1.2, -0.5) for Cell, 0x17419c7d0, traits: 8589934593, identifier: 'tappableCell' >>And if I change the code into this:let app = XCUIApplication() let myTableView = app.tables.element(matching: .table, identifier: "tableView01") myTableView.swipeUp(). //I swipe so that the cell becomes visible... let myCell = myTableView.cells.element(matching: .cell, identifier: "tappableCell") myCell.tap()Nothing happens! On the command line I get the log as the action should've been computed but on the screen nothing happens!Then I tried positioning a breakpoint just before the tap() method and giving the tap command manually from the command line writing 'po myCell.tap()' and it worked indeed! What's happening?! I have the same strange bug with both Xcode 8.3.3 and Xcode 9 - Beta 4.Do you know any possible solution? Am I wrong in something? It could be related with my usage of accessibility identifiers to run the query?Thank you for your support!Andrea
Posted
by
Post not yet marked as solved
1 Replies
4.8k Views
Platform: iOS.Programming language: Swift.What i have done?Created a test target and given the Host application as the target which i am trying to write test cases.Checked the Allow Testing Host Application API's.Added Target dependencies to the particular target that i want to test. Added pod dependencies to the test target as well.I am trying to import a swift file in XCTests class but it does not import. If i give the target membership for that particular file, i am facing lot of errors out of no where. What could be the best way to import the swift class. What are the settings that are to be added or modified in the project settings ?Any suggestions?
Posted
by
Post marked as solved
3 Replies
4.3k Views
I included the Tests and UITests schemas when I created my Xcode project, but now I want to remove them. Even if I delete those groups, I still get build errors on the files and the files still show in the editor. How do I remove those files from my project for good?
Posted
by
Post not yet marked as solved
2 Replies
3.5k Views
Querying an element sometimes freezez the UI test for 60 seconds. This happens randomly and works correctly after waiting for 60 seconds. t = 9.14s Find the Window t = 70.20s Find the Window (retry 1)from the console log, seems like XCUITest can't find the window.
Posted
by
Post not yet marked as solved
2 Replies
1.7k Views
Guys,I about to throw my laptop out the window. Could anyone help here. I'm building my app through xcodebuild command with the option enableAddressSanitizer YES.xcodebuild build-for-testing -project 'SparkMacDesktop/SparkMacDesktop.xcodeproj' -scheme 'Incremental Build Unit Test' -configuration Release -enableAddressSanitizer YESThis works fine. It's builds and when I run my test it's finding issues. Brilliant. One of the issues is00:04:30.629 ==24173==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0This is false positive and all I want to do is set detect-odr-violation=0. It states to set the environmental ASAN_OPTIONS=detect_odr_violation=01. I have tried to do this using "export ASAN_OPTIONS=detect_odr_violation=0" just before running xcodebuild command2. I have tried to do it by setting this value in path (bash_profile..etc...)3. I have tried setting it in the xcode project, in the schema. Go to schema, edit schema, select Arguments and add enviromental variableNothing works. Does anyone know how to set this enviromental variable. Any help here would really be appreciated.Thanks,Gary
Posted
by
Post not yet marked as solved
3 Replies
10k Views
Hi,I'm using Xcode 9.2 and iOS 11.2 Simulator.I would like to see my application's logs (NSLog call) while the app is tested with XCTest UI tests.I can launch the test with:xcodebuild -project MyProject.xcodeproj -scheme MyScheme -destination "platform=iOS Simulator,name=iPhone 5s,OS=11.2" testThe output of this command is the ouput of the UI test, but I don't see the application NSLog logs.Test Case '-[TestsUIOrangeEtMoi.OEMHomeTest testTapOnFactureTile]' started. t = 0.00s Start Test at 2017-12-07 11:26:05.743 t = 0.04s Set Up t = 0.15s Open com.orange.fr.orangeetmoisettings.bdx2 t = 0.18s Launch com.orange.fr.orangeetmoisettings.bdx2 t = 4.30s Wait for com.orange.fr.orangeetmoisettings.bdx2 to idle t = 6.49s Tap "Adresse mail ou numéro de mobile" TextField t = 6.49s Wait for com.orange.fr.orangeetmoisettings.bdx2 to idleIn the Simulator, I can go to 'Debug > Open System Log...", and it will open a log file ~/Library/Logs/CoreSimulator/DA22333D-A6BF-41EC-8BA4-F21C0EE6E177/system.log where DA22333D-A6BF-41EC-8BA4-F21C0EE6E177 is a hash of the simulator id. If I tail -f this file, I don't see any application logs, just "core" logs.Any idea how to access the application logs in this case ?Regards, Jc
Posted
by
Post not yet marked as solved
1 Replies
760 Views
When running a UI test the other day, an assertion failure terminated the test early when an expected button did not come onto screen. In looking at the screenshots, it appears the hosting app died during the test, leaving the UI test runner staring at the Springboard, rather than the main app, during accessibility element evaluation.In looking through the log files (Xcode Server > xcbot_name > Logs > Download Logs...) I see logs about the test runner and its attempts to find an on-screen button. But I see nothing about the main hosting app itself and why it crashed.Are these crash logs kept only in the Simulator?(I really hope not, as the nature of our project requires constant Simulator resets to avoid app cache conflicts between branch integrations)
Posted
by
Post not yet marked as solved
4 Replies
4.5k Views
Xcode version : Version 9.4.1 (9F2000)Currently I am testing an an app using Automation with XCTest Framework.I am running into a series of issues with the UI where the element says it is visible (exists) and isHittable (Both are true), but the next thing that shows up is an Assertion Failure. (Note: This doesn't happen for the same element everytime. Sometimes it works fine with one element and doesnt with the same element).Failed to determine hittability of "notification2:title" StaticText: Error copying attributes -25202I found this issue in earlier versions of Xcode too but the Assertion failure gave an error "Failure to determine hit point for the element".Thins that i have tried:-> Adding sleep before checking if the element is hittable or when tapping on the element.->Adding waitForExistenceWithTimeout before checking for the element or tapping on it.These didn't help me.Adding to the above, due to the nature of the app I can't test it on the simulator. I am testing it on a real device. And below is the log that i print before tapping or checking for the element. You can see element.exists and element.isHittable both return true but gives an Assertion failure.Checking for the element is visible and hittable before scrolling the parentElement. Element is Visible--YES, Element is hittable--YES
Posted
by
Post not yet marked as solved
2 Replies
1.7k Views
I'm almost at the beginning of Swift programming education. Now i'm trying to create UI tests for my app. I can't find popover in application's elements tree. It's statusbar application and popover is the main UI but it's completely missed for testing framework…Popover created programatically using UI from storyboard. In `AppDelegate.swift` i have this code:@NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.squareLength) let popover = NSPopover() func applicationDidFinishLaunching(_ aNotification: Notification) { stopAutostarter() if let button = statusItem.button { button.image = NSImage(named: NSImage.Name("StatusBarButtonImage")) button.action = #selector(togglePopover(_:)) } popover.contentViewController = PopoverViewController.freshController() popover.behavior = .transient popover.setAccessibilityEnabled(true) statusItem.button?.setAccessibilityEnabled(true) syncIcon() } @objc func togglePopover(_ sender: Any?) { if popover.isShown { closePopover(sender: sender) } else { showPopover(sender: sender) } } func showPopover(sender: Any?) { if let button = statusItem.button { popover.show(relativeTo: button.bounds, of: button, preferredEdge: NSRectEdge.minY) } } func closePopover(sender: Any?) { popover.performClose(sender) } }My `PopoverViewController.swift` (where PopoverViewController.mainView is slightly modified NSView just to return `true` in `acceptsFirstResponder`):class PopoverViewController: NSViewController { @IBOutlet weak var mainView: RespondingView! override func viewDidLoad() { super.viewDidLoad() mainView.setAccessibilityEnabled(true) mainView.setAccessibilityRole(.window) mainView.setAccessibilityIdentifier("PopoverView") } static func freshController() -> PopoverViewController { let storyboard = NSStoryboard(name: "Main", bundle: nil) let identifier = NSStoryboard.SceneIdentifier("PopoverViewController") guard let viewcontroller = storyboard.instantiateController( withIdentifier: identifier) as? PopoverViewController else { fatalError("Why can't i find PopoverViewController? - Check Main.storyboard") } return viewcontroller } }So now, when i try to record clicking buttons placed in popover in UI tests i've got error: "Recorder Service Error: Left Mouse Down: Failed to find matching element"When i try analyze application - it's just not have my ppover in elements tree. Only main menu bar, touch bar and menu bar with statusbar button Which is not contains popover.po XCUIApplication() t = 91.06s Snapshot accessibility hierarchy for app with pid 62106 t = 91.16s Snapshot accessibility hierarchy for app with pid 62106 Attributes: Application, pid: 62106, title: 'MyApp', Disabled Element subtree: →Application, 0x600003924000, pid: 62106, title: 'MyApp', Disabled MenuBar, 0x6000039240d0, {{0.0, 0.0}, {0.0, 0.0}} MenuBarItem, 0x6000039241a0, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Apple' Menu, 0x600003924270, {{880.0, 8448.0}, {196.0, 250.0}} MenuItem, 0x600003924340, {{0.0, 0.0}, {196.0, 19.0}}, title: 'About This Mac' MenuItem, 0x600003924410, {{0.0, 0.0}, {0.0, 0.0}}, title: 'System Information…' MenuItem, 0x6000039244e0, {{0.0, 19.0}, {196.0, 12.0}}, Disabled MenuItem, 0x6000039245b0, {{0.0, 31.0}, {196.0, 19.0}}, title: 'System Preferences…' MenuItem, 0x600003924680, {{0.0, 50.0}, {196.0, 19.0}}, title: 'App Store…' MenuItem, 0x600003924750, {{0.0, 69.0}, {196.0, 12.0}}, Disabled MenuItem, 0x600003924820, {{0.0, 81.0}, {196.0, 19.0}}, title: 'Recent Items' Menu, 0x6000039248f0, {{880.0, 1920.0}, {319.0, 532.0}} MenuItem, 0x6000039249c0, {{0.0, 0.0}, {319.0, 19.0}}, title: 'Applications', Disabled MenuItem, 0x600003924a90, {{0.0, 19.0}, {319.0, 21.0}}, title: 'Accessibility Inspector.app' MenuItem, 0x600003924b60, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Show “Accessibility Inspector.app” in Finder'MenuItem, 0x6000039156c0, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Show “STDOUT-2018-11-14T01-10-23.log.gz” in Finder' MenuItem, 0x600003915790, {{0.0, 470.0}, {319.0, 12.0}}, Disabled MenuItem, 0x600003915860, {{0.0, 482.0}, {319.0, 19.0}}, title: 'Servers', Disabled MenuItem, 0x600003915930, {{0.0, 501.0}, {319.0, 12.0}}, Disabled MenuItem, 0x600003915a00, {{0.0, 513.0}, {319.0, 19.0}}, title: 'Clear Menu' MenuItem, 0x600003915ad0, {{0.0, 100.0}, {196.0, 12.0}}, Disabled MenuItem, 0x600003915ba0, {{0.0, 112.0}, {196.0, 19.0}}, title: 'Force Quit…' MenuItem, 0x600003915c70, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Force Quit MyApp' MenuItem, 0x600003915d40, {{0.0, 131.0}, {196.0, 12.0}}, Disabled MenuItem, 0x600003915e10, {{0.0, 143.0}, {196.0, 19.0}}, title: 'Sleep' MenuItem, 0x600003915ee0, {{0.0, 162.0}, {196.0, 19.0}}, title: 'Restart…' MenuItem, 0x600003915fb0, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Restart' MenuItem, 0x600003916080, {{0.0, 181.0}, {196.0, 19.0}}, title: 'Shut Down…' MenuItem, 0x600003916150, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Shut Down' MenuItem, 0x600003916220, {{0.0, 200.0}, {196.0, 12.0}}, Disabled MenuItem, 0x6000039163c0, {{0.0, 212.0}, {196.0, 19.0}}, title: 'Lock Screen' MenuItem, 0x600003916490, {{0.0, 231.0}, {196.0, 19.0}}, title: 'Log Out qnub…' MenuItem, 0x600003916560, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Log Out qnub' MenuBarItem, 0x600003916630, {{0.0, 0.0}, {0.0, 0.0}}, title: 'MyApp' Menu, 0x600003916700, {{880.0, 10368.0}, {187.0, 181.0}} MenuItem, 0x6000039167d0, {{0.0, 0.0}, {187.0, 19.0}}, title: 'About MyApp' MenuItem, 0x6000039168a0, {{0.0, 19.0}, {187.0, 12.0}}, Disabled MenuItem, 0x600003916970, {{0.0, 31.0}, {187.0, 19.0}}, title: 'Preferences…', Disabled MenuItem, 0x600003916a40, {{0.0, 50.0}, {187.0, 12.0}}, Disabled MenuItem, 0x600003916b10, {{0.0, 62.0}, {187.0, 19.0}}, title: 'Services' Menu, 0x600003916be0, {{880.0, 10368.0}, {203.0, 38.0}} MenuItem, 0x600003916cb0, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Add to iTunes as a Spoken Track' MenuItem, 0x600003916d80, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Convert Text to Full Width' MenuItem, 0x600003916e50, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Convert Text to Half Width' MenuItem, 0x600003916f20, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Convert Text to Simplified Chinese' MenuItem, 0x600003916ff0, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Convert Text to Traditional Chinese' MenuItem, 0x6000039170c0, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Make New Sticky Note' MenuItem, 0x600003917190, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Open' MenuItem, 0x600003917260, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Show in Finder' MenuItem, 0x600003917330, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Show Info in Finder' MenuItem, 0x600003917400, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Show Map' MenuItem, 0x6000039174d0, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Import Image' MenuItem, 0x6000039175a0, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Open with Monosnap' MenuItem, 0x600003917670, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Set Desktop Picture' MenuItem, 0x600003917740, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Compress using Keka' MenuItem, 0x600003917810, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Extract using Keka' MenuItem, 0x6000039178e0, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Send to Keka' MenuItem, 0x6000039179b0, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Encode Selected Audio Files' MenuItem, 0x600003917b50, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Encode Selected Video Files' MenuItem, 0x600003917c20, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Folder Actions Setup…' MenuItem, 0x600003917cf0, {{0.0, 0.0}, {0.0, 0.0}}, title: 'New iTerm2 Tab Here' MenuItem, 0x600003917dc0, {{0.0, 0.0}, {0.0, 0.0}}, title: 'New iTerm2 Window Here' MenuItem, 0x600003917e90, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Upload with Monosnap' MenuItem, 0x600003910270, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Look Up in Dictionary' MenuItem, 0x600003910340, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Search With Google' MenuItem, 0x600003913400, {{0.0, 0.0}, {0.0, 0.0}}, title: 'New Email To Address' MenuItem, 0x6000039134d0, {{0.0, 0.0}, {0.0, 0.0}}, title: 'New Email With Selection' MenuItem, 0x600003913e90, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Add to Reading List' MenuItem, 0x600003913dc0, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Open URL' MenuItem, 0x600003913cf0, {{0.0, 0.0}, {203.0, 19.0}}, title: 'No Services Apply', Disabled MenuItem, 0x6000039138e0, {{0.0, 19.0}, {203.0, 19.0}}, title: 'Services Preferences…' MenuItem, 0x6000039139b0, {{0.0, 81.0}, {187.0, 12.0}}, Disabled MenuItem, 0x600003913c20, {{0.0, 93.0}, {187.0, 19.0}}, title: 'Hide MyApp', Disabled MenuItem, 0x600003913b50, {{0.0, 112.0}, {187.0, 19.0}}, title: 'Hide Others' MenuItem, 0x600003913a80, {{0.0, 131.0}, {187.0, 19.0}}, title: 'Show All', Disabled MenuItem, 0x600003913810, {{0.0, 150.0}, {187.0, 12.0}}, Disabled MenuItem, 0x600003913740, {{0.0, 162.0}, {187.0, 19.0}}, title: 'Quit MyApp' MenuBarItem, 0x600003913670, {{0.0, 0.0}, {0.0, 0.0}}, title: 'Edit' Menu, 0x6000039135a0, {{880.0, 10368.0}, {249.0, 321.0}} MenuItem, 0x6000039130c0, {{0.0, 0.0}, {249.0, 19.0}}, title: 'Undo', Disabled MenuItem, 0x600003913330, {{0.0, 19.0}, {249.0, 19.0}}, title: 'Redo', Disabled MenuItem, 0x600003913260, {{0.0, 38.0}, {249.0, 12.0}}, Disabled MenuItem, 0x600003913190, {{0.0, 50.0}, {249.0, 19.0}}, title: 'Cut', Disabled MenuItem, 0x600003912ff0, {{0.0, 69.0}, {249.0, 19.0}}, title: 'Copy', Disabled MenuItem, 0x600003912f20, {{0.0, 88.0}, {249.0, 19.0}}, title: 'Paste', Disabled MenuItem, 0x600003912e50, {{0.0, 107.0}, {249.0, 19.0}}, title: 'Paste and Match Style', Disabled MenuItem, 0x600003912d80, {{0.0, 126.0}, {249.0, 19.0}}, title: 'Delete', Disabled MenuItem, 0x600003912cb0, {{0.0, 145.0}, {249.0, 19.0}}, title: 'Select All', Disabled MenuItem, 0x600003912be0, {{0.0, 164.0}, {249.0, 12.0}}, Disabled MenuItem, 0x600003912b10, {{0.0, 176.0}, {249.0, 19.0}}, title: 'Find' Menu, 0x600003912a40, {{880.0, 7680.0}, {216.0, 114.0}} MenuItem, 0x600003912970, {{0.0, 0.0}, {216.0, 19.0}}, title: 'Find…', Disabled MenuItem, 0x6000039128a0, {{0.0, 19.0}, {216.0, 19.0}}, title: 'Find and Replace…', Disabled MenuItem, 0x6000039127d0, {{0.0, 38.0}, {216.0, 19.0}}, title: 'Find Next', Disabled MenuItem, 0x600003912700, {{0.0, 57.0}, {216.0, 19.0}}, title: 'Find Previous', Disabled MenuItem, 0x600003912630, {{0.0, 76.0}, {216.0, 19.0}}, title: 'Use Selection for Find', Disabled MenuItem, 0x600003912560, {{0.0, 95.0}, {216.0, 19.0}}, title: 'Jump to Selection', Disabled MenuItem, 0x600003912490, {{0.0, 195.0}, {249.0, 19.0}}, title: 'Spelling and Grammar' Menu, 0x6000039123c0, {{880.0, 7680.0}, {256.0, 107.0}} MenuItem, 0x6000039122f0, {{0.0, 0.0}, {256.0, 19.0}}, title: 'Show Spelling and Grammar' MenuItem, 0x600003912220, {{0.0, 19.0}, {256.0, 19.0}}, title: 'Check Document Now', Disabled MenuItem, 0x600003912150, {{0.0, 38.0}, {256.0, 12.0}}, Disabled MenuItem, 0x600003912080, {{0.0, 50.0}, {256.0, 19.0}}, title: 'Check Spelling While Typing', Disabled MenuItem, 0x600003911fb0, {{0.0, 69.0}, {256.0, 19.0}}, title: 'Check Grammar With Spelling', Disabled MenuItem, 0x600003911ee0, {{0.0, 88.0}, {256.0, 19.0}}, title: 'Correct Spelling Automatically', Disabled MenuItem, 0x600003911e10, {{0.0, 214.0}, {249.0, 19.0}}, title: 'Substitutions' Menu, 0x600003911d40, {{880.0, 8448.0}, {165.0, 145.0}} MenuItem, 0x600003911c70, {{0.0, 0.0}, {165.0, 19.0}}, title: 'Show Substitutions', Disabled MenuItem, 0x600003911ba0, {{0.0, 19.0}, {165.0, 12.0}}, Disabled MenuItem, 0x600003911ad0, {{0.0, 31.0}, {165.0, 19.0}}, title: 'Smart Copy/Paste', Disabled MenuItem, 0x600003911a00, {{0.0, 50.0}, {165.0, 19.0}}, title: 'Smart Quotes', Disabled MenuItem, 0x600003911930, {{0.0, 69.0}, {165.0, 19.0}}, title: 'Smart Dashes', Disabled MenuItem, 0x600003910f70, {{0.0, 88.0}, {165.0, 19.0}}, title: 'Smart Links', Disabled MenuItem, 0x600003911860, {{0.0, 107.0}, {165.0, 19.0}}, title: 'Data Detectors', Disabled MenuItem, 0x600003911790, {{0.0, 126.0}, {165.0, 19.0}}, title: 'Text Replacement', Disabled MenuItem, 0x6000039116c0, {{0.0, 233.0}, {249.0, 19.0}}, title: 'Transformations' Menu, 0x6000039115f0, {{880.0, 1920.0}, {155.0, 57.0}} MenuItem, 0x600003911520, {{0.0, 0.0}, {155.0, 19.0}}, title: 'Make Upper Case', Disabled MenuItem, 0x600003911450, {{0.0, 19.0}, {155.0, 19.0}}, title: 'Make Lower Case', Disabled MenuItem, 0x600003911380, {{0.0, 38.0}, {155.0, 19.0}}, title: 'Capitalize', Disabled MenuItem, 0x6000039112b0, {{0.0, 252.0}, {249.0, 19.0}}, title: 'Speech' Menu, 0x6000039111e0, {{880.0, 10368.0}, {136.0, 38.0}} MenuItem, 0x600003911110, {{0.0, 0.0}, {136.0, 19.0}}, title: 'Start Speaking', Disabled MenuItem, 0x600003910ea0, {{0.0, 19.0}, {136.0, 19.0}}, title: 'Stop Speaking', Disabled MenuItem, 0x600003910dd0, {{0.0, 271.0}, {249.0, 12.0}}, Disabled MenuItem, 0x600003910d00, {{0.0, 283.0}, {249.0, 19.0}}, title: 'Start Dictation…' MenuItem, 0x600003910b60, {{0.0, 302.0}, {249.0, 19.0}}, title: 'Emoji & Symbols' TouchBar, 0x600003910a90, {{80.0, 0.0}, {685.0, 30.0}}, Disabled MenuBar, 0x6000039109c0, {{935.0, 0.0}, {30.0, 22.0}} StatusItem, 0x6000039108f0, {{935.0, 0.0}, {30.0, 22.0}} StatusItem, 0x600003910820, {{1372.0, -1440.0}, {30.0, 22.0}}, Disabled Path to element: →Application, pid: 62106, title: 'MyApp', Disabled Query chain: →Find: Target Application 'my.app.MyApp' Output: { Application, pid: 62106, title: 'MyApp', Disabled }So trying to assertXCTAssertTrue(XCUIApplication().descendants(matching: .other).matching( identifier: "PopoverView").element.exists)is alwais fail.How to fix it to get working UI testing with popover?
Posted
by