Xcode UITesting crashes
Asked Answered
J

2

1

Anyone familiar with the following issue when generating UI tests?

Crashed Thread:        26  Dispatch queue: XCUIRecorder_iOS.processingQueue

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

The problem lies in the fact that when trying to press a control, Xcode suddenly crashes.

I know this is a widely known error, however, any solutions so far?

Thanks!

Johnette answered 26/10, 2015 at 18:20 Comment(0)
E
2

I had the same problem and I managed to find a workaround for this problem.

In my case I had a collection view with lots of cells in it, I was trying to test the interaction with the cells and as soon as I was tapping a cell Xcode will crash with the same error. I've looked into the crash logs and after this

Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY

I was able to find a snapshopArray of the view tree, in my case it was looking like this:

"Application 0x7fb0d39ce270: {{0.0, 0.0}, {320.0, 568.0}}, label: 'Workout'",
"Window 0x7fb0d643cda0: Main Window, {{0.0, 0.0}, {320.0, 568.0}}",
"Other 0x7fb0d58d9850: {{0.0, 0.0}, {320.0, 568.0}}",
"Other 0x7fb0d40c27f0: {{0.0, 0.0}, {320.0, 568.0}}",
"Other 0x7fb13a249920: {{0.0, 0.0}, {320.0, 568.0}}",
"Other 0x7fb138762330: {{0.0, 0.0}, {320.0, 568.0}}",
"Other 0x7fb0d5e1b830: {{0.0, 20.0}, {320.0, 497.0}}",
"CollectionView 0x7fb0d401ddd0: {{0.0, 64.0}, {320.0, 453.0}}",
"Cell 0x7fb13a6419e0: {{52.5, 96.0}, {43.0, 43.0}}, label: '2'",
"Other 0x7fb138701770: {{52.5, 96.0}, {43.0, 43.0}}",
"StaticText 0x7fb0d393d500: {{52.5, 96.0}, {43.0, 43.0}}, label: '2'"

You dont need to pay too much attention and you can see that the CollectionView object doesnt have an accessibilityLabel. I immediately opened my storyboard and guess what, I didnt had Accessibility enabled for my collection view. I enabled it and added an identifier and a label. Run the UI Test recording again and guess what: BINGO! no more crashes!

Your case might be different but always check if your views have the accessibility enabled and have of course a label and an identifier set in place.

Etiology answered 2/11, 2015 at 19:1 Comment(0)
P
1

If this is a bug related to accessibility, you might want to look at my answer here. My workaround was to programmatically set the value of the accessibilityIdentifier property of the control that generates the crash.

Palladium answered 27/11, 2015 at 16:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.