fields appear to be empty, although they are not

Mobile Testing, Android App Testing.
Essramasoud
Posts: 8
Joined: Tue Dec 29, 2015 4:27 pm

fields appear to be empty, although they are not

Post by Essramasoud » Wed Jan 13, 2016 3:24 pm

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.

Fergal
Certified Professional
Certified Professional
Posts: 298
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

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

Post by Fergal » Thu Jan 14, 2016 12:54 pm

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?

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

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

Post by krstcs » Thu Jan 14, 2016 2:14 pm

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.)
Shortcuts usually aren't...

Essramasoud
Posts: 8
Joined: Tue Dec 29, 2015 4:27 pm

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

Post by Essramasoud » Sun Jan 17, 2016 8:40 am

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.

Essramasoud
Posts: 8
Joined: Tue Dec 29, 2015 4:27 pm

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

Post by Essramasoud » Sun Jan 17, 2016 8:45 am

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,

zivshapirawork
Posts: 62
Joined: Wed Sep 24, 2014 7:47 am
Location: Israel

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

Post by zivshapirawork » Sun Jan 17, 2016 2:27 pm

You can probably use it programatically

Essramasoud
Posts: 8
Joined: Tue Dec 29, 2015 4:27 pm

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

Post by Essramasoud » Sun Jan 17, 2016 4:02 pm

zivshapirawork wrote:You can probably use it programatically
I couldn't the action "Key sequence" is not supported neither in user code nor recording.

Fergal
Certified Professional
Certified Professional
Posts: 298
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

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

Post by Fergal » Mon Jan 18, 2016 10:40 am

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?

tvu
Posts: 195
Joined: Tue Apr 07, 2015 10:47 pm

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

Post by tvu » Thu Jan 21, 2016 1:16 am

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.