Hoppa till huvudinnehåll

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
NameTypeDetails
language
optional
stringLanguage code (e.g. 'fr', 'de'). Defaults to the device language.
stringFile
optional
stringPath 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

Support for ios Support for android

anteckning

Refer to the official Appium driver documentation to see which driver versions support this command.

Welcome! How can I help?

WebdriverIO AI Copilot