'XCUIElement' is not a member type of 'XCTest'

Hi Guys!


I`m having problem with UI Testing, using XCode 7.3.


expression produced error: /var/folders/fn/v9qbg2dn1c5b_s_yxxh31qg80000gp/T/lldb/99599/expr24.swift:1:53: error: 'XCUIElement' is not a member type of 'XCTest'


I have a main View with a (TableView and a View with a button). When I click in a cell at the TableView, it will refresh with some content in the View.

It crashs when I click in another cell and (after refreshing the View content) try to press the button.

This happens only when i try using UI Testing. Normally, the app works like a charm.


Someone had the same problem?

Thanks!

Replies

Maybe that`s the problem, but I don't know what to do 😟


file:///%3Cunknown%3E: test failure: -[ProductUITest testResgateProdutoSemSKU()] failed: UI Testing Failure - Failure getting snapshot Error Domain=XCTestManagerErrorDomain Code=9 "Error -25204 getting snapshot for element <AXUIElement 0x7b141df0> {pid=32577}" UserInfo={NSLocalizedDescription=Error -25204 getting snapshot for element <AXUIElement 0x7b141df0> {pid=32577}}

Same problem here with Xcode 8.0 (8A218a)


expression produced error: /var/folders/pv/5jlpdzzn3p55w0ynccpt8x500000gn/T/lldb/37283/expr139.swift:1:53: error: 'XCUIElement' is not a member type of 'XCTest'
$__lldb__DumpForDebugger(Swift.UnsafePointer<XCTest.XCUIElement>(bitPattern: 0x119244860).memory)
                                             ~~~~~~ ^
/var/folders/pv/5jlpdzzn3p55w0ynccpt8x500000gn/T/lldb/37283/expr139.swift:1:45: note: while parsing this '<' as a type parameter bracket
$__lldb__DumpForDebugger(Swift.UnsafePointer<XCTest.XCUIElement>(bitPattern: 0x119244860).memory)


The file expr139.swift content is :


$__lldb__DumpForDebugger(Swift.UnsafePointer<XCTest.XCUIElement>(bitPattern: 0x119244860).memory)

I got the same problem in my automation test. I am using the xcode version 8.0(8A218a)


I always get the error as below and the object that be printed by debugdescription could not be access through code

xpression produced error: /var/folders/g5/wwmlnjw90432hmd_fls8q0fdwqlkkf/T/lldb/1342/expr30.swift:1:53: error: 'XCUIApplication' is not a member type of 'XCTest'

$__lldb__DumpForDebugger(Swift.UnsafePointer<XCTest.XCUIApplication>(bitPattern: 0x104d88890).memory)

~~~~~~ ^

/var/folders/g5/wwmlnjw90432hmd_fls8q0fdwqlkkf/T/lldb/1342/expr30.swift:1:45: note: while parsing this '<' as a type parameter bracket

$__lldb__DumpForDebugger(Swift.UnsafePointer<XCTest.XCUIApplication>(bitPattern: 0x104d88890).memory)

^

does anyone know the solutions? the same code can run successfully in xcode 7.3.1. however, it could not run now in 8.0

I have the same problem in XCode 8


expression produced error: /var/folders/25/9_sb609576jcmgdbqt553ps08n5b5c/T/lldb/43074/expr40.swift:1:53: error: 'XCUIElement' is not a member type of 'XCTest'
$__lldb__DumpForDebugger(Swift.UnsafePointer<XCTest.XCUIElement>(bitPattern: 0x116a0b940).memory)
                                             ~~~~~~ ^
/var/folders/25/9_sb609576jcmgdbqt553ps08n5b5c/T/lldb/43074/expr40.swift:1:45: note: while parsing this '<' as a type parameter bracket
$__lldb__DumpForDebugger(Swift.UnsafePointer<XCTest.XCUIElement>(bitPattern: 0x116a0b940).memory)

Receiving the same error in XCode Version 8.2.1 (8C1002).

If any one has found a solution to this, Please reply!



expression produced error: /var/folders/6x/zkx6q8_x0nb7tngb6f8dtb300000gp/T/lldb/2531/expr14.swift:1:53: error: 'XCUIElement' is not a member type of 'XCTest'

$__lldb__DumpForDebugger(Swift.UnsafePointer<XCTest.XCUIElement>(bitPattern: 0x11cd576e0).memory)

~~~~~~ ^

/var/folders/6x/zkx6q8_x0nb7tngb6f8dtb300000gp/T/lldb/2531/expr14.swift:1:45: note: while parsing this '<' as a type parameter bracket

$__lldb__DumpForDebugger(Swift.UnsafePointer<XCTest.XCUIElement>(bitPattern: 0x11cd576e0).memory)

Same issue here with 8.2. I can't believe Apple is not addressing this...my automation is now broken.

I had a very similar issue only when I try to print test related objects at the debugger prompt

(but it works normally If I just run the test and don't breakpoint with the debugger)

(I'm using Xcode 8.2.1)


for example:


I set a breakpoint just after this line:

let app = XCUIApplication()


and then try

(lldb) po app

expression produced error: error: /var/folders/y0/1ghrk5gn4911s6kwq6n1ny8w0000gn/T/./lldb/2506/expr33.swift:1:72: error: 'XCUIApplication' is not a member type of 'XCTest'

Swift._DebuggerSupport.stringForPrintObject(Swift.UnsafePointer<XCTest.XCUIApplication>(bitPattern: 0x1214213b0)!.pointee)

~~~~~~ ^


but when I check debugDescription, it works


(lldb) po app.debugDescription


"Attributes: Application 0x608000176500: {{0.0, 0.0},

.

.


then surprisingly, the same command that failed above works now successfully!


(lldb) po app

Attributes: Application 0x608000176500: {{0.0, 0.0}, {375.0, 667.0}}

.

.


I don't understand why, but it seems a workaround.

It works! But why!

I had the same issue, but when I change device on which test run then everything works. I have Xcode 8.3.3 (8E3004b), and I tried to run a test on iOS 10.3.2 (14F89) and on it the same error occurs, but on iOS 10.3.1 (14E304) everything works fine.

Hi guys , so did anyone managed to make this work ?

but when I check debugDescription, it works
(lldb) po app.debugDescription

This works, but has the unfortunate side-effect of not being properly formatted (you get an actual blob of text with embedded "\n"'s instead of it properly line-broken). This is with Xcode 11.2 beta.


It amazes me how Apple can spend $6B on a spaceship campus, but can't be bothered to do proper QA testing (or hire 1 person to monitor the forums for questions/bugs).