Код PyCharm:
from appium import webdriver
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['automationName'] = 'UiAutomator2'
desired_caps['platformVersion'] = '10'
desired_caps['deviceName'] = 'AppiumEmulator'
desired_caps['app'] = ('G:\\Appium\\KickStartAppium\\Android_Demo_App.apk')
desired_caps['appPackage'] = 'com.google.android.apps.nexuslauncher'
desired_caps['appActivity'] = 'com.google.android.apps.nexuslauncher.NexusLauncherActivity'
desired_caps['udid'] = 'emulator-5554'
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
driver.implicitly_wait(10)
ClickEle = driver.find_element_by_id("com.code2lead.kwad:id/EnterValue")
ClickEle.click()
Ошибка PyCharm:
"C:\Users\Nandha Kumar\PycharmProjects\AppiumLaunchApp\venv\Scripts\python.exe" "C:/Users/Nandha Kumar/PycharmProjects/AppiumLaunchApp/KickStartApp.py"
Traceback (most recent call last):
File "C:/Users/Nandha Kumar/PycharmProjects/AppiumLaunchApp/KickStartApp.py", line 19, in <module>
ClickEle = driver.find_element_by_id("com.code2lead.kwad:id/EnterValue")
File "C:\Users\Nandha Kumar\PycharmProjects\AppiumLaunchApp\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 360, in find_element_by_id
return self.find_element(by=By.ID, value=id_)
File "C:\Users\Nandha Kumar\PycharmProjects\AppiumLaunchApp\venv\lib\site-packages\appium\webdriver\webdriver.py", line 279, in find_element
return self.execute(RemoteCommand.FIND_ELEMENT, {
File "C:\Users\Nandha Kumar\PycharmProjects\AppiumLaunchApp\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\Nandha Kumar\PycharmProjects\AppiumLaunchApp\venv\lib\site-packages\appium\webdriver\errorhandler.py", line 31, in check_response
raise wde
File "C:\Users\Nandha Kumar\PycharmProjects\AppiumLaunchApp\venv\lib\site-packages\appium\webdriver\errorhandler.py", line 26, in check_response
super().check_response(response)
File "C:\Users\Nandha Kumar\PycharmProjects\AppiumLaunchApp\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: An element could not be located on the page using the given search parameters.