Swift UITesting error: Invalid escape sequence in literal. \\U201c

你。 提交于 2019-11-30 18:54:49
Martin R

This seems to be a bug in Xcode when generating code during UI recording. Swift uses \u{NNNN} escape sequences in string literals, so

app.alerts["Allow \u{201c}Light Alarm\u{201c} ..."]

would be correct, or simply

app.alerts["Allow “Light Alarm“ ..."]

(Actually it should be "Allow “Light Alarm” ..." where the second quotation mark is U+201D = RIGHT DOUBLE QUOTATION MARK :)

A similar issue for UI recorded code in Objective-C was reported in Incomplete universal character name in UI Testing.

I do not know a workaround, it seems that the only thing you can do at present is to fix the code after recording (and sent a bug report to Apple).

Installing Xcode 7.3 fixed this issue for me

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!