简体   繁体   中英

Xcode 7 record ui button doesn't appear

I created a ui test class:

import Foundation
import XCTest
@testable import TestProject

@available(iOS 9.0, *)
class ChangeWishListUITests: XCTestCase {

    func testExample() {
        // Use recording to get started writing UI tests.
        // Use XCTAssert and related functions to verify your tests produce the correct results.


    }

}

Run app on iphone 6 simulator with ios 9.3: 在此处输入图片说明

But, record button, like in this tutorial: https://developer.apple.com/library/ios/documentation/ToolsLanguages/Conceptual/Xcode_Overview/RecordingUITests.html#//apple_ref/doc/uid/TP40010215-CH75-SW1

didn't appear.

在此处输入图片说明

  1. your cursor has to be inside the method that you want to implement (because Xcode generates the code to the cursor position)

If this doesn't help:

  1. sometimes Xcode appears to be instable when you add a UI test to an existing project. The following sequence helped me in some cases:

    • clean the project
    • restart Xcode
    • rebuild the project
    • click inside the test method to set the cursor

Sometimes I had to do this two times.

  1. Your simulator has to run at least iOS 9.0

就我而言,我忘记了在项目中添加UI测试目标并将测试文件分配给该目标

the debug area is hidden...

toggle debug editor on keyboard by pressing "shift + command + y" simultaneously

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM