Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode UITest Record button is disabled

Has anyone seen this happen before? I can not run UITests because the button is disabled. I have not found any help online. I have deleted and added a new test target, restarted Xcode and deleted derived data. None of these worked and I have no idea what to try next.

like image 283
Abbey Jackson Avatar asked Nov 25 '15 16:11

Abbey Jackson


3 Answers

You have to create a new target in your project.
Steps:
1) File > New > Target
2) Select in left box: iOS > Test
3) In right box: iOS UI Testing Bundle
4) Run your aplication
5) Record your actions
6) Make assertions
like image 200
emilianoeloi Avatar answered Nov 06 '22 21:11

emilianoeloi


Another possible cause could be that the UI testing target was not build/run successfully.

Go to Product > Test and make sure no errors. You should also see the test cases in the Test Navigator (if you don't see, then it is not recognised).

like image 28
samwize Avatar answered Nov 06 '22 21:11

samwize


I had the same issue and finally found a solution.

  1. Write a new UI test in a file which is linked to the UI test target.
  2. In the new test write XCTFail("") (which will fail the test)
  3. Run your UI tests and they should fail.
  4. Remove XCTFail("") you added and the red button is now enabled.
like image 2
harmeet07 Avatar answered Nov 06 '22 21:11

harmeet07