Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions appium/webdriver/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,17 @@ def zoom(self, element=None, percent=200, steps=50):
self.execute_script('mobile: pinchOpen', opts)
return self

@property
def app_strings(self):
"""Returns the application strings from the device.
def app_strings(self, language=None):
"""Returns the application strings from the device for the specified
language.

:Usage:
strings = driver.app_strings
:Args:
- language - strings language code
"""
return self.execute(Command.GET_APP_STRINGS)['value']
data = {}
if language != None:
data['language'] = language
return self.execute(Command.GET_APP_STRINGS, data)['value']

def reset(self):
"""Resets the current application on the device.
Expand Down Expand Up @@ -518,7 +521,7 @@ def _addCommands(self):
self.command_executor._commands[Command.MULTI_ACTION] = \
('POST', '/session/$sessionId/touch/multi/perform')
self.command_executor._commands[Command.GET_APP_STRINGS] = \
('GET', '/session/$sessionId/appium/app/strings')
('POST', '/session/$sessionId/appium/app/strings')
self.command_executor._commands[Command.KEY_EVENT] = \
('POST', '/session/$sessionId/appium/device/keyevent')
self.command_executor._commands[Command.GET_CURRENT_ACTIVITY] = \
Expand Down
6 changes: 5 additions & 1 deletion test/functional/android/appium_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ def tearDown(self):
self.driver.quit()

def test_app_strings(self):
strings = self.driver.app_strings
strings = self.driver.app_strings()
self.assertEqual(u'You can\'t wipe my data, you are a monkey!', strings[u'monkey_wipe_data'])

def test_app_strings_with_language(self):
strings = self.driver.app_strings("en")
self.assertEqual(u'You can\'t wipe my data, you are a monkey!', strings[u'monkey_wipe_data'])

def test_keyevent(self):
Expand Down