getStrings
Get app strings for a specific language. Returns a key-value object of all string resources defined in the application for the given language.
Note: Falls back to the deprecated Appium 2 protocol endpoint if the driver does not support the
mobile:execute method.
Usage
browser.getStrings(language, stringFile)
Parameters
| Name | Type | Details |
|---|---|---|
languageoptional | string | Language code (e.g. 'fr', 'de'). Defaults to the device language. |
stringFileoptional | string | Path to the strings file (Android only). |
Example
getStrings.js
it('should get app strings', async () => {
// Get strings for default language
const strings = await browser.getStrings()
// Get strings for a specific language
const frStrings = await browser.getStrings('fr')
})
Returns
- <
Promise<Record<string, string>>>returns: Key-value map of all string resources.
Support
note
Refer to the official Appium driver documentation to see which driver versions support this command.