from appium import webdriver
from appium.webdriver.common.appiumby import AppiumBy
Import Appium UiAutomator2 driver for Android platforms (AppiumOptions)
from appium.options.android import UiAutomator2Options
desired_cap = {
“platformName”: “Android”,
“deviceName”: “RZ8M526X8ZV”,
“app”: “C://Users//admin//Downloads//com.virtualmaze.offlinemapnavigationtracker_2.2.5.0-5090_minAPI23(arm64-v8a,armeabi-v7a,x86,x86_64)(nodpi)_apkmirror.com.apk”
}
capabilities_options = UiAutomator2Options().load_capabilities(desired_cap)
driver = webdriver.Remote(“http://localhost:4723/wd/hub”, options=capabilities_options)
driver.find_elements_by_id(‘android:id/navigationBarBackground’).click()
error Traceback (most recent call last):
File “D:UsersadminPycharmProjectspythonProjectfirst.py”, line 15, in
driver.find_elements_by_id(‘android:id/navigationBarBackground’).click()
^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: ‘WebDriver’ object has no attribute ‘find_elements_by_id’
to provide the code that must work
bhanu prasad sn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1