Testing localized apps (with localised accessibilityLabel)

212 views
Skip to first unread message

pdkn

unread,
Jul 12, 2011, 11:01:58 AM7/12/11
to Frank
hi guys,

If accessibilityLabel's are localized are there any thoughts how Frank
can test apps set to a specific locale without having to write
separate cucumber features? I've noticed that FoneMonkey has a
potential solution with a category on UIView that adds monkeyID.

http://www.gorillalogic.com/books/fonemonkey-doc/user-guide/understanding-monkeyids

Not ideal but interested to hear peoples ideas.

One idea is a gem that can match expectedMarks in cucumber features to
NSLocalizedString defs in the app sourcecode and auto-generate
localized versions of the cucumber files...




Steven Solomon

unread,
Jul 12, 2011, 11:07:47 AM7/12/11
to frank-...@googlegroups.com
you can safely assume your locales work if you have strings tables setup. but im curious do you have different features in another locale?

pdkn

unread,
Jul 12, 2011, 11:17:43 AM7/12/11
to Frank
Cool - That's a good point we do actually have specific features for
locales (or more precisely have features removed for some locales i.e
facebook integration for China)


On Jul 12, 4:07 pm, Steven Solomon <solomon.steve...@gmail.com> wrote:
>  you can safely assume your locales work if you have strings tables setup. but im curious do you have different features in another locale?
>
> On Jul 12, 2011, at 11:01 AM, pdkn wrote:
>
>
>
>
>
>
>
> > hi guys,
>
> > If accessibilityLabel's are localized are there any thoughts how Frank
> > can test apps set to a specific locale without having to write
> > separate cucumber features? I've noticed that FoneMonkey has a
> > potential solution with a category on UIView that adds monkeyID.
>
> >http://www.gorillalogic.com/books/fonemonkey-doc/user-guide/understan...

Steven Solomon

unread,
Jul 12, 2011, 11:23:59 AM7/12/11
to frank-...@googlegroups.com
very cool. maybe you can launch the simulator with the command line tool there is probably a param to pass in the locale to open to, but this might require diving into pete's simlauncher to get it to work but i imagine thats a way. or maybe applescript can drive the simulator to launch into a certain locale

pdkn

unread,
Jul 12, 2011, 11:36:32 AM7/12/11
to Frank
Presume those setting are sitting in a plist somewhere in the
simulator dir - time to investigate...

Pete Hodgson

unread,
Jul 12, 2011, 11:40:01 AM7/12/11
to frank-...@googlegroups.com

You may already be aware (or maybe it was you who posted it!), but IIRC someone posted to the list a while ago with some info on setting localization, or something. Sorry for the super vague email, not in front of a computer to check properly.

Cheers,
Pete
--
Typed on a teeny tiny keyboard

pdkn

unread,
Jul 12, 2011, 11:41:21 AM7/12/11
to Frank
lovely jubbly, hidden plist found

/Users/{USERNAME}/Library/Application Support/iPhone Simulator/4.3.2/
Library/Preferences/.GlobalPreferences.plist

bit of Ruby FileUtils magic should be able to change that file...

Steven Solomon

unread,
Jul 12, 2011, 11:44:58 AM7/12/11
to frank-...@googlegroups.com
Nice

pdkn

unread,
Jul 12, 2011, 12:00:57 PM7/12/11
to Frank

pdkn

unread,
Jul 12, 2011, 1:20:41 PM7/12/11
to Frank
actually, This looks promising from our friends at google

http://code.google.com/p/ios-sim-locale/wiki/Usage



On Jul 12, 5:00 pm, pdkn <keanepa...@gmail.com> wrote:
> Thank Peter, found the post:
>
> http://groups.google.com/group/frank-discuss/browse_thread/thread/867...

Pete Hodgson

unread,
Jul 12, 2011, 1:24:24 PM7/12/11
to frank-...@googlegroups.com

Oh, nice find. Always good to let someone else do the work :)

Cheers,
Pete
--
Typed on a teeny tiny keyboard

pdkn

unread,
Jul 13, 2011, 5:58:28 AM7/13/11
to Frank
so ios-sim-locale works a treat! ;) However when the simulator locale
is changes my steps start failing where accessibilityLabels are
localised. Steven what did you mean by 'strings tables setup'? I'm
thinking I'll need to write some ruby that loads in the correct
Localizable.strings file then swaps out the expectedMark values in
English with the locale value. Any other suggestions welcome?

On Jul 12, 6:24 pm, Pete Hodgson <phodg...@thoughtworks.com> wrote:
> Oh, nice find. Always good to let someone else do the work :)
>
> Cheers,
> Pete
> --
> Typed on a teeny tiny keyboard

Steven Solomon

unread,
Jul 13, 2011, 8:33:20 AM7/13/11
to frank-...@googlegroups.com
it's an apple technology that holds a list of key-value pairs in a certain language your app can have many of them and if you set up your app to use them, the system handles switching between locales

http://cocoawithlove.com/2011/04/user-interface-strings-in-cocoa.html

Steven Solomon

unread,
Jul 13, 2011, 8:34:45 AM7/13/11
to frank-...@googlegroups.com
my bad accidently sent before i finished reading (Localizable.strings is a string table sorry for the jargon )

On Jul 13, 2011, at 5:58 AM, pdkn wrote:

pdkn

unread,
Jul 13, 2011, 9:22:16 AM7/13/11
to Frank
Thanks Steven, so that's all set up but the steps are failing. If
localization is supported, presume it will be part of UISpec. Haven't
spotted any code handling it there? After discussion with the team
we're going to take a different approach. There's not much benefit in
running the same Scenarios for each locale unless the user journey is
different. For the specific scenarios that differ by locale we can
create separate ones with values in the locale under test... reckon it
should still be pretty DRY....

Steven Solomon

unread,
Jul 13, 2011, 9:30:32 AM7/13/11
to frank-...@googlegroups.com
is symbiote highlighting the views as expected?
maybe it is having trouble with unicode chars?

pdkn

unread,
Jul 13, 2011, 9:53:26 AM7/13/11
to Frank
symbiote looks fine, showing labels correctly in Japanese...

pdkn

unread,
Jul 13, 2011, 10:20:36 AM7/13/11
to Frank
interestingly if I hardcode the value in Japanese there's a
syntaxError:

syntax error, unexpected $end, expecting keyword_end
When %q|I touch the button marked "ワークアウトを選ぶ"|
^
(SyntaxError)

Steven Solomon

unread,
Jul 13, 2011, 10:24:25 AM7/13/11
to frank-...@googlegroups.com
try using the unicode consts for this, i image symbiote is doing this behind the scenes by html encoding the input text

pdkn

unread,
Jul 13, 2011, 10:32:25 AM7/13/11
to Frank
scratch that problem, fixed - needed to add "# encoding: utf-8" to top
of .rb file...

deepti

unread,
May 19, 2015, 7:55:48 AM5/19/15
to frank-...@googlegroups.com, keane...@gmail.com
Hi pdkn, 
Could you please elaborate how did you solve the problem?
I am stuck in a similar situation, I have localizable.strings file for each local language. While I am using the same variable name in my cucumber feature file, I am not able to read the values from localizable.strings file.

Thanks in Advance
Deepti
Reply all
Reply to author
Forward
0 new messages