Reputation: 3159
Hi people I have a serious problem at hand, I have made a sample iphone app with "username" and "password" field and a "login" button and I have set the accessibility labels for all the components to be username, password and login and written a java script to test these components which goes as follows -:
UIALogger.logStart("Starting Test"); var view = UIATarget.localTarget().frontMostApp().mainWindow();
var textfields = view.textFields()["username"]; var passwordFields = view.secureTextFields(); var convertButton = view.buttons()["login"];
textfields.setValue("ABC"); passwordFields[0].setValue("SDE");
convertButton.tap();
what I observe is that when I fire up instruments to test the app through the above java script, the js successfully enters value into the username field but is unable to enter the value in the password field which I have made secure also the button is tapped successfully and the control moves to the next page in the app and on the next page there is a logout button set with the accessibility label "logout" which also I am not able to tap on. Can you please suggest a workaround for this situation if any.
Upvotes: 0
Views: 492
Reputation: 38475
var passwordFields = view.secureTextFields();
How many secure text fields are there - what happens if you output the length of that array?
Why not
var passwordfield = view.secureTextFields()["password"];
passwordField.setValue("SDE");
in the same way you did for the text field?
Upvotes: 1