user2924482
user2924482

Reputation: 9140

XCTest: Use of unresolved identifier XCTContext

I'm using Xcode Version 8.3.3 and I'm trying to XCTContext on Swift but I'm getting the following error:

Use of unresolved identifer XCTContext

This is implementation:

   XCTContext.runActivity(named: "Capture screenshot") { activity in
    let screen = XCUIScreen.main
    let screenShot = screen.screenshot()
    let attachment = XCTAttachment(screenshot: screenShot)
    attachment.lifetime = .keepAlways
    activity.add(attachment)
    }

enter image description here

XCTContext doesn't event show in autocomplete:

enter image description here

Any of you knows why I'm getting this error?

I'll really appreciate your help

Upvotes: 0

Views: 1083

Answers (1)

Titouan de Bailleul
Titouan de Bailleul

Reputation: 12949

XCTContext is only available with Xcode 9. That's why you get this error when trying to use it with Xcode 8.x

Upvotes: 2

Related Questions