Search code examples
iosunit-testingui-automationios-ui-automation

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. So have created a java script for login form but am unable to login into the app ..even when correct credentials are given. 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?


Solution

  • 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.

    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. 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.

    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.

    Screenshots