对xcode进行UI test出现的@"u8bf7u8f93u5165u7231u5b66u6d3eu8d26u53f7"进行修改

xiaoxiao2021-02-28  89

1.登录代码如下:

//输入用户名 XCUIElement *textField = [[XCUIApplication alloc] init].textFields[@"\u8bf7\u8f93\u5165\u7231\u5b66\u6d3e\u8d26\u53f7"]; [textField tap]; [textField typeText:@"爱学派MFF"]; //输入密码 XCUIElement *element = [[[[[[[app childrenMatchingType:XCUIElementTypeWindow] elementBoundByIndex:0] childrenMatchingType:XCUIElementTypeOther].element childrenMatchingType:XCUIElementTypeOther].element childrenMatchingType:XCUIElementTypeOther].element childrenMatchingType:XCUIElementTypeOther] elementBoundByIndex:1]; [[[element childrenMatchingType:XCUIElementTypeOther] elementBoundByIndex:0] tap]; [[[element childrenMatchingType:XCUIElementTypeOther] elementBoundByIndex:1] tap]; [app typeText:@"1111"];

2.修改如下:

//输入用户名 XCUIElement *textField = [[XCUIApplication alloc] init].textFields[@"请输入爱学派账号"]; [textField tap]; [textField typeText:@"爱学派MFF"]; //输入密码 XCUIElement *element = [[[[[[[app childrenMatchingType:XCUIElementTypeWindow] elementBoundByIndex:0] childrenMatchingType:XCUIElementTypeOther].element childrenMatchingType:XCUIElementTypeOther].element childrenMatchingType:XCUIElementTypeOther].element childrenMatchingType:XCUIElementTypeOther] elementBoundByIndex:1]; [[[element childrenMatchingType:XCUIElementTypeOther] elementBoundByIndex:0] tap]; [[[element childrenMatchingType:XCUIElementTypeOther] elementBoundByIndex:1] tap]; [app typeText:@"1111"];

即@”\u8bf7\u8f93\u5165\u7231\u5b66\u6d3e\u8d26\u53f7”对应字符串“@”请输入爱学派账号””,注意中文和录制时的翻译。

转载请注明原文地址: https://www.6miu.com/read-30364.html

最新回复(0)