I am trying to add UI tests to my existing project using Xcode 7. However the UI test recording button is always greyed out. What I am missing here?
I tried restarting Xcode, cleaning and rebuilding the project and adding a new UI test target. Does anyone else experience the same behaviour?
To enable the red button, you have to have the cursor on the test method:
I got stuck on this for a while too. In order to record, you have to be in a class that Xcode recognizes as containing tests. Add a file to your UI testing target with something like:
import Foundation
import XCTest
class MyTests: XCTestCase {
func testSomething() {
}
}
Save the file, clean your project, and switch to another file then back to this one. Record button should be available then.
FWIW: I had this problem and it turns out I was trying to run the simulator in the wrong OS.
I was trying to use iOS 8, and UITesting only works in iOS 9+.
Switch the simulator version, and the record button appears.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With