0

Related to XCTest UI Testing - How to close and open an app without relaunch? is there any way to lock the screen from a UI test? XCUIDevice.Button only has three cases, home, volume up and volume down.

Ilias Karim
  • 4,798
  • 3
  • 38
  • 60

1 Answers1

1

XCUIDevice has a private method for this. Shh, it's kinda secret.

XCUIDevice.shared.perform(NSSelectorFromString("pressLockButton"))
Mike Collins
  • 4,108
  • 1
  • 21
  • 28