Skip to content

Commit fe356e0

Browse files
committed
refactor: remove legacy fallback for mobile: getAppStrings
This change removes the legacy fallback mechanism when executing `mobile: getAppStrings` in `appium/webdriver/extensions/applications.py`. The `app_strings` method now exclusively uses the `execute_script` approach. Correspondingly, the `GET_APP_STRINGS` command registration in `Applications._add_commands` and the command definition in `MobileCommand` have also been removed.
1 parent 74a9060 commit fe356e0

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

appium/webdriver/extensions/applications.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,7 @@ def app_strings(self, language: Union[str, None] = None, string_file: Union[str,
241241
data['language'] = language
242242
if string_file is not None:
243243
data['stringFile'] = string_file
244-
try:
245-
return self.assert_extension_exists(ext_name).execute_script(ext_name, data)
246-
except UnknownMethodException:
247-
# TODO: Remove the fallback
248-
return self.mark_extension_absence(ext_name).execute(Command.GET_APP_STRINGS, data)['value']
244+
return self.assert_extension_exists(ext_name).execute_script(ext_name, data)
249245

250246
def _add_commands(self) -> None:
251247
self.command_executor.add_command(Command.BACKGROUND, 'POST', '/session/$sessionId/appium/app/background')
@@ -271,4 +267,3 @@ def _add_commands(self) -> None:
271267
'POST',
272268
'/session/$sessionId/appium/device/app_state',
273269
)
274-
self.command_executor.add_command(Command.GET_APP_STRINGS, 'POST', '/session/$sessionId/appium/app/strings')

appium/webdriver/mobilecommand.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class MobileCommand:
3131
SWITCH_TO_CONTEXT = 'switchToContext'
3232

3333
BACKGROUND = 'background'
34-
GET_APP_STRINGS = 'getAppStrings'
3534

3635
IS_LOCKED = 'isLocked'
3736
LOCK = 'lock'

0 commit comments

Comments
 (0)