UITesting of Alerts in xCode 7.1
I'm writing UITests in xCode 7.1 and have a problem in testing alerts (Allow notifications in my case). While creating a test xCode writes this code: app.alerts["\U201cAppName\U201d Would Like to Send You Notifications"].collectionViews.buttons["OK"].tap() Which immediately causes error: Invalid escape sequence in literal So I replaced xCode's code with: app.alerts["\u{201c}AppName\u{201d} Would Like to Send You Notifications"].collectionViews.buttons["OK"].tap() But when I run UITest it fails with message: UI Testing Failure - No matches found for Alert The same for code app.alerts["“AppName”