Almett
Almett

Reputation: 906

Unable to switch locale in Appium Android

Things were working pretty well until this issue come up. Locale unable to switch while I'm running test case through Appium+TestNG+Android Emulator.TestNG configuration is below:

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite thread-count="1" verbose="1" name="AndroidSuite"
    skipfailedinvocationcounts="false" junit="false" parallel="false"
    data-provider-thread-count="50" annotations="JDK">

    <parameter name="mobileNodeType" value="appium" />
    <parameter name="seleniumhost" value="localhost" />
    <parameter name="seleniumport" value="4723" />
    
     <parameter name="mobileAppLanguage" value="de_DE" />
     <parameter name="mobileAppLocale" value="DE" /> 
     
    <parameter name="mobilePlatform" value="ANDROID" />
    <parameter name="appPath" value="{apk file path}"/>
    <!-- <parameter name="appPath" value="{APP path}"/> --> 
    <parameter name="mobileDevice" value="android:6.0"/>
    <parameter name="mobileDeviceType" value="nexus5"/>
    
    <test verbose="2" name="AndroidTest" annotations="JDK">
        <classes>
             <class name="com.x.y.{ClassName}">
              <methods>
                <include name="{CaseName}"></include>
              </methods>
            </class>
        </classes>
    </test>
</suite>

Approaches I've tried:

1.Set locale from Appium command line.

2.Wipe emulator data and restart.

3.Delete and recreate emulator.

4.Reinstall Appium command line tool.

Please take a look if anyone had the similar issue. Thanks in advance.

Upvotes: 1

Views: 550

Answers (1)

Almett
Almett

Reputation: 906

I figured out the solution myself. Mobile App language in Android must be like

<parameter name="mobileAppLanguage" value="de_DE" />

Instead of

<parameter name="mobileAppLanguage" value="de" />

Upvotes: 1

Related Questions