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”对应字符串“@”请输入爱学派账号””,注意中文和录制时的翻译。
本文提供了使用Objective-C进行爱学派平台账号登录的代码示例,详细展示了如何输入用户名和密码的过程,并给出了相应的修改建议。
1260

被折叠的 条评论
为什么被折叠?



