app_strings fails to return locale, also fails to return default strings.xml
See original GitHub issueThe problem
First of all, this is the apk under test: https://drive.google.com/open?id=0ByLgHLmeVLK5NTlnYmhTaXlid0E And this is the string table: https://drive.google.com/open?id=0ByLgHLmeVLK5SXBsRFc5RjNkX2c
Two issues:
- The target app has strings.xml et el. under the default “values” folder, with only special localized strings under values-en for English; driver.app_strings only returns strings under values-en without including the default strings under values.
- The target app has localized strings for both zh_CN (Simplified Chinese) and zh_TW (Traditional Chinese), however, it doesn’t have any localized string for just zh, driver.app_strings fails to return the localized strings for both zh_CN & zh_TW, instead, it returns the default strings under values.
p.s. my temporary workaround for issue[1] is to pull /data/local/tmp/strings.json directly; however, it couldn’t get around issue[2].
Environment
- Appium version (or git revision) that exhibits the issue: purely npm’s appium@1.6.5
- Last Appium version that did not exhibit the issue (if applicable):
- Desktop OS/version used to run Appium: Ubuntu 16.04
- Node.js version (unless using Appium.app|exe): v8.4.0
- Mobile platform/version under test: Android 7.1.1
- Real device or emulator/simulator: Real Nexus 6P
- Appium CLI or Appium.app|exe: not sure, just appium from npm (/home/mobiserver/.linuxbrew/bin/appium -> …/lib/node_modules/appium/build/lib/main.js*)
Details
Tried this on both uiautomator & uiautomator2, they both have the same issue.
Link to Appium logs
driver.app_strings when locale on mobile device is set to en https://gist.github.com/zavvio/c211645b4cb36966487a175c5e72572a driver.app_strings when locale on mobile device is set to zh_CN https://gist.github.com/zavvio/535d6bd82c83ebd8a9f1c2c0522b7a2f
Code To Reproduce Issue [ Good To Have ]
Sorry, it has some wrapper but this should be equivalent to just calling driver.app_strings
`class Suite_01(unittest.TestCase):
@classmethod
def setUpClass(cls):
# Load configuration file
cls.cfg = MobiConfig(EzPath.find_absolute_path("/MobileApps/config/ci/android_aio/bat_aioa_zm.cfg"))
# Define log
logging.config.fileConfig(EzPath.find_absolute_path(CONFIG.LOG_PATH))
# Add some ip address to no_proxy
SetProxy.add_to_no_proxy(cls.cfg.get("MISC", "no-proxy"))
# Define Appium Server
desired_caps = dict()
desired_caps['platformName'] = cls.cfg.get("DEVICE", "platform-name")
desired_caps['platformVersion'] = cls.cfg.get("DEVICE", "platform-version")
desired_caps['deviceName'] = cls.cfg.get("DEVICE", "device-name")
cls.app = MobiEzApp(cfg=cls.cfg, desired_capabilities={
'automationName': "uiautomator2",
'app': cls.cfg.get("APP", "aio-package"),
'appPackage': "com.hp.printercontrol",
'appActivity': "com.hp.printercontrol.base.PrinterControlActivity",
'appWaitActivity': "com.hp.printercontrol.moobe.UiMoobeEntranceAct,com.hp.printercontrol.base.PrinterControlActivity",
'fullReset': "true"})
cls.ui = MobiUiMap(cls.app, cls.cfg.get("UI-MAP", "aio-android"), language=cls.cfg.get("DEVICE", "language"))
print cls.app.app_strings()
`
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top GitHub Comments
ok, there’s a pickup curve for me but I’ll try to dig into the source code.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.