Page 1 of 1

fields appear to be empty, although they are not

Posted: Wed Jan 13, 2016 3:24 pm
by Essramasoud
Hi,
I am trying to automate the testing of an android application.
I recorded the steps which are:

1. touch username field
2. set field's value
3. touch password field
4. set its value
5. tap login button.

When I play the recording, it performs all the steps, but it doesn't login, and the message i get (from the app) is "Please fill username and password"... which is the message set to appear when the fields are empty.

How can I solve this problem.

Re: fields appear to be empty, although they are not

Posted: Thu Jan 14, 2016 12:54 pm
by Fergal
Essramasoud wrote:..1. touch username field
2. set field's value
3. touch password field
4. set its value
5. tap login button...
If you play steps 1-4 and look at the Android device, has the test actually filled in values for username and password?

Re: fields appear to be empty, although they are not

Posted: Thu Jan 14, 2016 2:14 pm
by krstcs
SetValue should be used as a very last resort.

It does not fire any events, it just sets the value of a property.

For many user controls, especially text entry fields, this means that the software doesn't realize anything has been changed, because developers do not account for a means of entering text that a real user wouldn't be able to do.

Have you tried using Key Sequence actions? (I don't test on mobile yet, so I don't know if it does.)

Re: fields appear to be empty, although they are not

Posted: Sun Jan 17, 2016 8:40 am
by Essramasoud
Fergal wrote:If you play steps 1-4 and look at the Android device, has the test actually filled in values for username and password?
Yes, the values get filled in.

Re: fields appear to be empty, although they are not

Posted: Sun Jan 17, 2016 8:45 am
by Essramasoud
krstcs wrote:SetValue should be used as a very last resort.

It does not fire any events, it just sets the value of a property.

For many user controls, especially text entry fields, this means that the software doesn't realize anything has been changed, because developers do not account for a means of entering text that a real user wouldn't be able to do.

Have you tried using Key Sequence actions? (I don't test on mobile yet, so I don't know if it does.)

Yes, the problem is just as you described, but the thing is that there is no "Key Sequence" action for the mobile recording.

I don't know if there is a workaround for this, is there?

Thanks,

Re: fields appear to be empty, although they are not

Posted: Sun Jan 17, 2016 2:27 pm
by zivshapirawork
You can probably use it programatically

Re: fields appear to be empty, although they are not

Posted: Sun Jan 17, 2016 4:02 pm
by Essramasoud
zivshapirawork wrote:You can probably use it programatically
I couldn't the action "Key sequence" is not supported neither in user code nor recording.

Re: fields appear to be empty, although they are not

Posted: Mon Jan 18, 2016 10:40 am
by Fergal
Essramasoud wrote:
Fergal wrote:If you play steps 1-4 and look at the Android device, has the test actually filled in values for username and password?
Yes, the values get filled in.
If you then complete step 5 ("5. tap login button...") manually, do the values get submitted?

Re: fields appear to be empty, although they are not

Posted: Thu Jan 21, 2016 1:16 am
by tvu
We also ran into this before where we couldn't set the value to a text field. This was an issue for us on Ranorex 5.4.3, but has been fixed in Ranorex 5.4.4. We wrote some custom code utilizing the PressKeys() method to type the value with the mobile device's keyboard.