简体   繁体   English

使用IOS UI自动化工具进行测试时无法登录应用

[英]Unable to login in to the app when testing using IOS UI automation tool

I am trying to automate test cases for our Ios mobile app , chosen Xcode instrument UI automation. 我正在尝试为我们的Io​​s移动应用程序自动化测试用例,选择了Xcode仪器UI自动化。 So have created a java script for login form but am unable to login into the app ..even when correct credentials are given. 因此,已经为登录表单创建了Java脚本,但是即使提供了正确的凭据也无法登录到应用程序。 It says Invalid credentials. 它说无效的凭据。 I checked my username and password where i have configured in the script. 我检查了我在脚本中配置的用户名和密码。 When I give credentials using my Keyboard it gets signed in... 当我使用键盘提供凭据时,它就会登录...

Why the login is not happening when the credentials are given using the UI tool? 使用UI工具提供凭据时为什么没有登录?

Since Thejaswi didn't have permissions yet to upload an image, he emailed me a screenshot of the problem and I thought I'd post them here in my answer to provide more context. 由于Thejaswi还没有上传图像的权限,因此他通过电子邮件将问题的屏幕快照发送给我,我认为我应该将其张贴在答案中以提供更多背景信息。

You didn't provide enough detail to me to help solve the problem, but I do have a suggestion that could point you in the right direction. 您没有为我提供足够的细节来帮助解决问题,但是我有一个建议,可以为您指明正确的方向。 From the screenshot, it looks like UI Automation is filling in the fields and pressing the button correctly. 在屏幕截图中,UI Automation似乎正在填写字段并正确按下按钮。 Since you point out that the app can log in just fine when controlled manually, that leads me to believe that the password that UI Automation is typing in is wrong. 既然您指出手动控制该应用程序后就可以正常登录,这使我相信UI Automation输入的密码是错误的。

I would double check the password you are using the automation script. 我会仔细检查您使用自动化脚本的密码。 If that is correct, then I would have the alert view that displays the "Invalid password" message also display the password that was typed in. This would help rule out if UI Automation isn't properly sending the right keypresses to fill in the password field. 如果那是正确的,那么我将在显示“无效密码”消息的警报视图中显示输入的密码。这将有助于排除UI自动化未正确发送正确的按键以填充密码的情况。领域。

屏幕截图

使用UIKeyboard类解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM