Incomplete universal character name in UI Testing

白昼怎懂夜的黑 提交于 2019-12-06 18:40:52

问题


I am using Xcode 7's new feature : UI Testing. After recording the interaction, Xcode generated the code automatically :

- (void)testDoubleTapToolBarItem {
    [[[XCUIApplication alloc] init].tabBars.buttons[@"\U5173\U6ce8"] doubleTap];
                                                    ~~~~~~~~~~~~~~~~
}

However, warning showed as well. Any one know how to fix this?

Incomplete universal character name


Edit: This seems to be a BUG since Xcode 7.0 GM


回答1:


You can use the following workaround as this seems to be a bug in xcode:

replace all \U to \u and it should work.




回答2:


I tried replace \U to \u but still got error "Expected hexadecimal code in braces after unicode escape", so have to add \u{you value here}, like collectionViewsQuery.buttons["\u{6ce8}\u{518c}"].tap()

See more at Expected hexadecimal code in braces after unicode escape



来源:https://stackoverflow.com/questions/32432068/incomplete-universal-character-name-in-ui-testing

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