UI Testing target locale and region settings

Hello,

I'm trying to set the language and the region of my UI Testing target, and unfortunately it doesn't seem to work.

I've tried both ways, first:

  • Product | Scheme | Edit Scheme
  • Run | Options
    • Application Language: French
    • Application Region: France
  • Test | Arguments

    Use the Run action's arguments and environment variables: Checked

And I try this other way:

  • Product | Scheme | Edit Scheme
  • Test | Arguments
    • Use the Run action's arguments and environment variables: Unchecked
    • Arguments passed at launch:
      • -AppleLanguages (French)
      • -AppleLocale fr_FR

Each way resulting in the UI Testing still happening in English. Moreover, when I hit the record button, the recording runs correctly in French...

So if I do something wrong, I would be happy to know!

Thanks in advance!

Is not via XCODE?


XCODE->Product->Scheme->Edit Scheme->Run (left menu)->Options (Tab)->Application Language = "English" (I could setup to "Portuguese (Brazil)", but I intend to use the language English.


XCODE->Product->Scheme->Edit Scheme->Run (left menu)->Options (Tab)->Application Region = "Brazil" (here I intend to use Brazillian's regional settings -> 1.200,43)

You can add arguments when you run the UITest Application

Like this:

XCUIApplication().launchArguments += [“-AppleLanguages”, “(fr)”]

XCUIApplication().launchArguments += [“-AppleLocale”, “fr_FR”]

XCUIApplication().launch()
UI Testing target locale and region settings
 
 
Q