我正在尝试调用Appium api来滚动ios设备的选择器,代码如下:
import requests
url = 'http://localhost:4723/wd/hub/session/be208e62-dd30-46c0-8bcc-f37327fd1082/execute'
json={ "script":"mobile:selectPickerWheelValue", "args": {"order":"previous", "offset": 0.15,"element": "08660000-0000-0000-A120-000000000000"} }
result = requests.post(url,data=json)
print(result.text)
但我收到以下错误:
{"status":13,"value":{"message":"An unknown server-side error occurred while processing the command. Original error: Element id is expected to be set for selectPickerWheelValue method"},"sessionId":"be208e62-dd30-46c0-8bcc-f37327fd1082"}
任何人都可以提供帮助吗?
将我的'result = requests.post(url,data = json)更改为'result = requests.post(url,json = json)'后,问题已解决。