XCUITests使特定页面中的应用程序崩溃

时间:2018-06-20 12:48:29

标签: swift xcode xcuitest

运行UITest时发生崩溃,这在实际应用工作流程中没有发生。当我转到特定页面并检查是否存在staticText时,应用程序崩溃,出现Sigabrt错误且没有消息。我设法在UITests上放置一个断点,并通过控制台使应用程序崩溃,当我运行bt命令时,我得到了以下堆栈跟踪:

* thread #41, queue = 'com.apple.dt.xctautomationsupport.snapshot-request'
    frame #0: 0x00000001199c425e libsystem_kernel.dylib`semaphore_timedwait_trap + 10
    frame #1: 0x00000001194e1d52 libdispatch.dylib`_dispatch_sema4_timedwait + 72
    frame #2: 0x00000001194e23c9 libdispatch.dylib`_dispatch_semaphore_wait_slow + 58
    frame #3: 0x000000013736f1b2 XCTAutomationSupport`XCTPerformOnMainRunLoop + 534
    frame #4: 0x000000013737b0c6 XCTAutomationSupport`__56-[XCTElementSnapshotRequest loadSnapshotAndReturnError:]_block_invoke + 355
    frame #5: 0x00000001194e1709 libdispatch.dylib`_dispatch_client_callout + 8
    frame #6: 0x00000001194e7e01 libdispatch.dylib`_dispatch_queue_barrier_sync_invoke_and_complete + 94
    frame #7: 0x000000013737ad61 XCTAutomationSupport`-[XCTElementSnapshotRequest loadSnapshotAndReturnError:] + 218
    frame #8: 0x000000013736e157 XCTAutomationSupport`-[XCTElementQueryProcessor snapshotForElement:attributes:parameters:error:] + 152
    frame #9: 0x000000013737d577 XCTAutomationSupport`__45-[XCTElementQuery _snapshotForElement:error:]_block_invoke + 100
    frame #10: 0x000000013737d356 XCTAutomationSupport`-[XCTElementQuery _snapshotForElement:error:] + 707
    frame #11: 0x000000013737d06f XCTAutomationSupport`-[XCTElementQuery _rootElementSnapshot:] + 215
    frame #12: 0x000000013737d6cd XCTAutomationSupport`-[XCTElementQuery matchingSnapshotsWithRelatedElements:error:] + 111
    frame #13: 0x000000013736d872 XCTAutomationSupport`-[XCTElementQueryProcessor fetchMatchesForQuery:reply:] + 192
    frame #14: 0x00000001373790ba XCTAutomationSupport`__51-[XCTAutomationSession fetchMatchesForQuery:reply:]_block_invoke + 66
    frame #15: 0x00000001194e06cb libdispatch.dylib`_dispatch_call_block_and_release + 12
    frame #16: 0x00000001194e1709 libdispatch.dylib`_dispatch_client_callout + 8
    frame #17: 0x00000001194e6294 libdispatch.dylib`_dispatch_queue_override_invoke + 887
    frame #18: 0x00000001194ebc88 libdispatch.dylib`_dispatch_root_queue_drain + 473
    frame #19: 0x00000001194eba51 libdispatch.dylib`_dispatch_worker_thread3 + 119
    frame #20: 0x0000000119a04169 libsystem_pthread.dylib`_pthread_wqthread + 1387
  * frame #21: 0x0000000119a03be9 libsystem_pthread.dylib`start_wqthread + 13

如果我运行该应用程序并执行与该应用程序完全相同的操作,则崩溃根本不会发生。 我该如何调试呢? ps:运行XCode 9.4.1

0 个答案:

没有答案