Deevakar verma
Deevakar verma

Reputation: 251

How can i use UIAutomation in XCODE 8 , Swift 3

import XCTest

class UnitTestClass: XCTestCase {

override func setUp() {
    super.setUp()
    // Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDown() {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    super.tearDown()
}

func testExample() {

}

I have multiple UIViewController classes in my app. Now, i want to test each class by UIAutomation in Xcode 8 ,swift 3. After Searching a lot, i didn't get any useful tutorial or tool in Xcode or swift's latest version. My App's First screen is Login screen. Can anyone help me to find-out the useful solution

Upvotes: 0

Views: 1137

Answers (1)

Fahim
Fahim

Reputation: 3556

I believe UIAutomation was deprecated in Xcode 8. But you can set up UI tests in Xcode 8 by simply doing the following:

  1. Add an iOS UI Testing Bundle target to your project.
  2. Create a test method under the new test file created as part of that target.
  3. Click inside the curly braces within the method.
  4. Click the "record" icon shown below the source editor to start recording your UI actions in the simulator.

Watch this WWDC Video to learn more about UI testing in Xcode.

Upvotes: 1

Related Questions