KeyError:使用Python的Appium中的“ touchAction” 错误码
C:\Users\PycharmProjects\AppiumSandbox\venv\Scripts\python.exe C:/Users/PycharmProjects/AppiumSandbox/tests/contactone.py Traceback (most recent call last): File “C:/Users/PycharmProjects/AppiumSandbox/tests/contactone.py”, line 21, in user_action.tap(x=909, y=220).perform() File “C:\Users\PycharmProjects\AppiumSandbox\venv\lib\site-packages\appium\webdriver\common\touch_action.py”, line 149, in perform self._driver.execute(Command.TOUCH_ACTION, params) File “C:\Users\PycharmProjects\AppiumSandbox\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 319, in execute response = self.command_executor.execute(driver_command, params) File “C:\Users\PycharmProjects\AppiumSandbox\venv\lib\site-packages\selenium\webdriver\remote\remote_connection.py”, line 367, in execute command_info = self._commands[command] KeyError: ‘touchAction’
解决方案
通过添加from appium import webdriver
和删除from selenium import webdriver
提到的自动化脚本可以解决问题。