1

I am testing a mobile app which doesn't have right set locators in it, so i can use only "resource-id"

from appium.webdriver.common.appiumby import AppiumBy

# Locators

profile_btn = (AppiumBy.ID, 'io.dzain.dzain.uat:id/navItemIV')
profile_btn.click()

When I run this code following error message is displayed AttributeError: 'tuple' object has no attribute 'click'

How can i use the resource-id to handle this problem?

Tigran
  • 19
  • 4

1 Answers1

0

You call clicks on the appium/webdriver elements returned from the driver, something like so:

profile_btn = self.driver.find_element(AppiumBy.ID, 'io.dzain.dzain.uat:id/navItemIV')
profile_btn.click()

You feed your by method and your element locator definition into the find_element function and call clicks on the element object it returns to you.

Legako
  • 33
  • 2
  • 8