Xcode7 | Xcode UI Tests | How to handle location service alert?

Xcode 9 let springboard = XCUIApplication(bundleIdentifier: “com.apple.springboard”) let allowBtn = springboard.buttons[“Allow”] if allowBtn.exists { allowBtn.tap() } Xcode 8.3.3 _ = addUIInterruptionMonitor(withDescription: “Location Dialog”) { (alert) -> Bool in alert.buttons[“Allow”].tap() return true } app.buttons[“Request Location”].tap() app.tap() // need to interact with the app for the handler to fire Note that it is a bit different as … Read more

Is it possible to “toggle software keyboard” via the code in UI test?

Tested in Xcode 10.3 & Xcode 11. The snippet below needs to be located in the app target (not the test bundle) — for instance, in AppDelegate.swift. It will disable any hardware keyboards from automatically connecting by setting any UIKeyboardInputMode‘s automaticHardwareLayout properties to nil. 🔥 Does not depend on the settings of the Simulator. #if … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)