happymff的博客

坚持每天学一点,积少成多!

对xcode进行UI test出现的@"\u8bf7\u8f93\u5165\u7231\u5b66\u6d3e\u8d26\u53f7"进行修改

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://blog.csdn.net/happymff/article/details/74926141
个人分类: 杂项
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

对xcode进行UI test出现的@"\u8bf7\u8f93\u5165\u7231\u5b66\u6d3e\u8d26\u53f7"进行修改

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭