Get background text values

Mobile Testing, Android App Testing.
nusu
Posts: 7
Joined: Thu Jan 30, 2014 1:54 pm

Get background text values

Post by nusu » Thu Jan 30, 2014 3:43 pm

Hi,

Can you tell me how to get background text values like “Please enter password” while login (or something similar)
Environment used:
- Physical device: Android Nexus 4
- Operating system: Windows 7 SP1
- Ranorex version: 4.1.4.16685

Thank you.

User avatar
mebner
Posts: 61
Joined: Tue Dec 17, 2013 6:42 pm

Re: Get background text values

Post by mebner » Mon Feb 03, 2014 2:43 pm

Hi Nusu,

Could you please explain in detail what you are trying to do?
What do you mean with: get background text values like "Please enter password"?
Do you want to validate if the specific text is shown?

Regards,
Markus

nusu
Posts: 7
Joined: Thu Jan 30, 2014 1:54 pm

Re: Get background text values

Post by nusu » Mon Feb 17, 2014 12:02 pm

Hi Markus,

Yes, I want to validate if the specific text is shown.
The thing is that this is a background text in an input field (for password) and I can’t validate it. Validation can be done for characters that are typed in the input field only, and anyway that would led to the above background text to be unavailable. (Moreover, this being a password field, the typed characters will be transformed in asterisk.)

Best regards,
Nic

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Get background text values

Post by Support Team » Mon Feb 24, 2014 5:45 pm

Hi Nic,

Can you please post a Ranorex snapshot file? This will help to analyze the issue in more detail.
Thank you!

Regards,
Bernhard
.
Image

nusu
Posts: 7
Joined: Thu Jan 30, 2014 1:54 pm

Re: Get background text values

Post by nusu » Tue Mar 04, 2014 4:49 pm

Hi Bernhard,

Due to company's rules the only thing that I can post is the Track line of the affected input; it is similar to:
"/mobileapp[@title='testpapp']/form[@title='LoginActivity']//text"

As you can see in attachments, there's nothing in Ranorex Spy - Overview/Detail section that I can relate to (like Text, Caption)



Best regards,
Nic
Attachments
Detail.png
Detail.png (24.76 KiB) Viewed 1398 times
Overview.png
Overview.png (19.5 KiB) Viewed 1398 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Get background text values

Post by Support Team » Wed Mar 05, 2014 4:51 pm

Hi nusu,

You can, for example use a "Validate" (ContainsImage) action in order to check if the text is available in the text box.
You can use the "Validate" button in the recorder in order to create a "ContainsImage" action.
Please let me know if this doesn't work.
Please take a look at the following site on our website: http://www.ranorex.com/support/user-gui ... arted.html

Regards,
Bernhard
.
Image

nusu
Posts: 7
Joined: Thu Jan 30, 2014 1:54 pm

Re: Get background text values

Post by nusu » Wed Mar 05, 2014 5:51 pm

Hi Bernhard,

Thank you for the quick reply. I know that such a validation would work as I used it before (used it in order to test that the stored image found in some section/page is different from the actual one found in a different section/page; this approach is OK-and it works- to be used in that context ).
But, in this case, I stick to the same page, the login page, therefore the first page(I don’t go to a different page, do some modifications that would affect the first page and then return to the first one to check that the stored image wasn't modified meantime, and I’m not in a scenario were I store the existing image, move to a different page and then compare the images).
The thing is that besides this “Enter password” verification I also have to test the number of wrong password retries; so, it would be a validation against smth. similar to “Wrong password. Number of retries <counter>”, where <counter> would be decremented with every wrong login attempt.
Using an approach like validating "ContainsImage" action would mean to validate the image against itself, and that is not the intended purpose; that’s why I was searching for a validation against a “Match Value”.


Best regards,
Nic

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Get background text values

Post by Support Team » Fri Mar 07, 2014 4:09 pm

Hi Nic,

Unfortunately it is hard to analyze the issue without access to our application or at least to a Ranorex Snapshot file.
I know that your company rules don't allow to post the *.apk in the forum, but would it be possible to send it to [email protected]?
This would help to analyze the issue in more detail.

Regards,
Bernhard
.
Image

nusu
Posts: 7
Joined: Thu Jan 30, 2014 1:54 pm

Re: Get background text values

Post by nusu » Tue Mar 11, 2014 2:19 pm

Hi Bernhard,

Unfortunately it is a security issue and we need to keep our privacy but, we nevertheless need at least a guideline containing some rules or tips for our Developments; maybe you can provide us with a guideline how our devs should change the app so it is possible to read this elements. There should be some general guideline rules that the developers should follow in order the app’s elements to be readable for this particular case (“Login”). For example a general construction of a Table with cells that contain information.
Thank you.

Best regards,
Nic

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Get background text values

Post by Support Team » Mon Mar 17, 2014 3:47 pm

Hi Nic,

You can, for example try to use the R.id to make the value visible for Ranorex. A description how to set the RID can be found using the following website: Understanding R.java
I hope this works for you.

Regards,
Bernhard
.
Image