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.
Usage​
await 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​
Supported platforms: iOS, Android
note
Refer to the official Appium driver documentation to see which driver versions support this command.