Sitelet https://github.com/appium/python-client/pull/724/files
Skip to content
Merged
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
8 changes: 6 additions & 2 deletions appium/webdriver/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,9 @@ def find_element(self, by: str = AppiumBy.ID, value: Union[str, Dict] = None) ->
`appium.webdriver.webelement.WebElement`: The found element

"""
# TODO: If we need, we should enable below converter for Web context
# We prefer to patch locators in the client code
# Checking current context every time a locator is accessed could significantly slow down tests
# Check https://github.com/appium/python-client/pull/724 before submitting any issue
# if by == By.ID:
# by = By.CSS_SELECTOR
# value = '[id="%s"]' % value
Expand Down Expand Up @@ -368,7 +370,9 @@ def find_elements(
Returns:
:obj:`list` of :obj:`appium.webdriver.webelement.WebElement`: The found elements
"""
# TODO: If we need, we should enable below converter for Web context
# We prefer to patch locators in the client code
# Checking current context every time a locator is accessed could significantly slow down tests
# Check https://github.com/appium/python-client/pull/724 before submitting any issue
# if by == By.ID:
# by = By.CSS_SELECTOR
# value = '[id="%s"]' % value
Expand Down
12 changes: 8 additions & 4 deletions appium/webdriver/webelement.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ def find_element(self, by: str = AppiumBy.ID, value: Union[str, Dict] = None) ->
Returns:
`appium.webdriver.webelement.WebElement`
"""
# TODO: If we need, we should enable below converter for Web context
# We prefer to patch locators in the client code
# Checking current context every time a locator is accessed could significantly slow down tests
# Check https://github.com/appium/python-client/pull/724 before submitting any issue
# if by == By.ID:
# by = By.CSS_SELECTOR
# value = '[id="%s"]' % value
Expand Down Expand Up @@ -125,7 +127,9 @@ def find_elements(self, by: str = AppiumBy.ID, value: Union[str, Dict] = None) -
Returns:
:obj:`list` of :obj:`appium.webdriver.webelement.WebElement`
"""
# TODO: If we need, we should enable below converter for Web context
# We prefer to patch locators in the client code
# Checking current context every time a locator is accessed could significantly slow down tests
# Check https://github.com/appium/python-client/pull/724 before submitting any issue
# if by == By.ID:
# by = By.CSS_SELECTOR
# value = '[id="%s"]' % value
Expand All @@ -135,8 +139,8 @@ def find_elements(self, by: str = AppiumBy.ID, value: Union[str, Dict] = None) -
# by = By.CSS_SELECTOR
# value = ".%s" % value
# elif by == By.NAME:
# by = By.CSS_SELECTOR
# value = '[name="%s"]' % value
# by = By.CSS_SELECTOR
# value = '[name="%s"]' % value

return self._execute(RemoteCommand.FIND_CHILD_ELEMENTS, {"using": by, "value": value})['value']

Expand Down