Text cut off detection.

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Text cut off detection.

Post by artur_gadomski » Fri Oct 29, 2010 7:12 am

Hi
Is there a way to detect a text cut off using Ranorex. This is a big problem in language tests where text field is big enough to hold English text but not big enough to hold translated version, resulting in text cut off problems. So my question is can Ranorex detect text cut off's or has anybody made it detect them?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Text cut off detection.

Post by Support Team » Fri Oct 29, 2010 11:14 am

Hi,

Sorry but out of the box there is no feature to validate a text cut off. But you have full access to the .Net Framework and I'm sure there will be a solution for it. But this method you have to create by your own.

Regards,
Peter
Ranorex Team

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Text cut off detection.

Post by Ciege » Fri Oct 29, 2010 5:32 pm

Are you talking about 1) text that is longer than the physical bounds of the text box (ie. only characters 1-10 can be seen but characters 11-99 are off screen) -OR- 2) verifying that the text box is capable of holding all the characters regardless of if they are visible or not (ie. the text box can only hold characters 1-10 and 11-99 do not exist)?


If 1 and if this is a text/edit box - get the measurement of the text box. Click at the far right (or far left if this is a RTL language), copy the character immediately to the left (or right if RTL) then move the cursor using the right arrow (or left arrow if RTL) and see if a new character is now displayed.

If 1 and this is a read only text box (ie. a label) - you can get the width measurement of the text box and compare that to the widths of each character used (knowing the font will help).

If 2 and this is a text/edit box try typing in as many characters as you can through automation and compare that to the string length of the language text.


Other questions/ideas.
Do you have a translation file for each language? Do you know which strings should be translated to what? You can write a more in depth test that knows what strings live where then run you automation in each language and read the corresponding language string file. Then compare the characteristics of the displayed text versus your expected text in the strings file...


There are lots of things you *can* do, it's a matter of how in depth you want to get and how much time you are willing to dedicate to making it work.

Good luck, it's a long process...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Re: Text cut off detection.

Post by artur_gadomski » Mon Nov 01, 2010 8:54 am

I am talking about scenario 1) and only about labels or read only text. And 'off screen' part can't be scrolled into.

So my automation will know location of each label and what string should go into this label. Then look up the string in a translation file, count letters and multiply them either by average width for given font or actual width for each letter. If that is greater than width of label take a screenshot and fail the test.

Does it sound about right?

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Text cut off detection.

Post by Ciege » Mon Nov 01, 2010 4:02 pm

That is certainly one way to attempt. If you know the correct string value and are able to determine the approximate widths then compare that to the width of the displayed label text you should get a pretty good estimation of what text is actually displayed. However, there is always the possibility that you are off by a character or so, so your results may need to have a small oops factor built in.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...