无法在 Xamarin 移动应用上使用带有 Appium 的 Python 客户端滚动

问题描述

我尝试在侧边栏菜单上重现滚动操作。我尝试比较我的 python 代码和 appium 可视化客户端上记录的操作之间的 appium 调用日志,我发现了一个差异,我认为是问题所在:在 appium 可视化客户端中,TouchActions (touch,moveto,release) 是用一个独特的调用

POST /wd/hub/session/39f9d6db-71c4-4a2d-8ed0-bf64b658d91b/touch/perform
{"actions":[{"action":"press","options":{"x":664,"y":1113}},{"action":"wait","options":{"ms":500}},{"action":"moveto","options":{"x":669,"y":641}},{"action":"release","options":{}}]}[39m
            Calling AppiumDriver.performTouch() with args: [[{"action":"press","options":{}}],"39f9d6db-71c4-4a2d-8ed0-bf64b658d91b"]

[debug] [35m[WD Proxy][39m Matched '/touch/perform' to command name 'performTouch'
[debug] [35m[WD Proxy][39m Proxying [POST /touch/perform] to [POST http://127.0.0.1:8200/wd/hub/session/f1213646-b538-4a19-ac53-ee452fb4467a/touch/perform] with body: {"startX":664,"startY":1113,"endX":669,"endY":641,"steps":14}
[debug] [35m[WD Proxy][39m Got response with status 200: {"sessionId":"f1213646-b538-4a19-ac53-ee452fb4467a","value":null}
[debug] [35m[MJSONWP (39f9d6db)][39m Responding to client with driver.performTouch() result: null
[info] [35m[HTTP][39m [37m<-- POST /wd/hub/session/39f9d6db-71c4-4a2d-8ed0-bf64b658d91b/touch/perform [39m[32m200[39m [90m1093 ms - 76[39m

在我的代码中,动作是分开的:

POST /wd/hub/session/d5f04a12-3bd6-411a-bf4b-518868bb23c0/touch/perform
{"actions":[{"action":"press","options":{"x":100,"y":784}},"options":{"ms":500}
{"action":"moveto","y":455}},"options":{}}]}[39m
    Calling AppiumDriver.performTouch() with args: [[{"action":"press","d5f04a12-3bd6-411a-bf4b-518868bb23c0"]
[debug] [35m[WD Proxy][39m Matched '/touch/down' to command name 'touchDown'
[debug] [35m[WD Proxy][39m Proxying [POST /touch/down] to [POST http://127.0.0.1:8201/wd/hub/session/91baefc6-e069-4862-9f3e-29b8f7300521/touch/down] with body: {"params":{"element":null,"x":100,"y":784}}[debug] [35m[WD Proxy][39m Got response with status 200: {"sessionId":"91baefc6-e069-4862-9f3e-29b8f7300521","value":null}
[debug] [35m[WD Proxy][39m Matched '/touch/move' to command name 'touchMove'
[debug] [35m[WD Proxy][39m Proxying [POST /touch/move] to [POST http://127.0.0.1:8201/wd/hub/session/91baefc6-e069-4862-9f3e-29b8f7300521/touch/move] with body: {"params":{"element":null,"y":455}}[debug] [35m[WD Proxy][39m Got response with status 200: {"sessionId":"91baefc6-e069-4862-9f3e-29b8f7300521","value":null}
[debug] [35m[WD Proxy][39m Matched '/touch/up' to command name 'touchUp'
[debug] [35m[WD Proxy][39m Proxying [POST /touch/up] to [POST http://127.0.0.1:8201/wd/hub/session/91baefc6-e069-4862-9f3e-29b8f7300521/touch/up] with body: {"params":{"x":100,"y":455}}
[debug] [35m[WD Proxy][39m Got response with status 200: {"sessionId":"91baefc6-e069-4862-9f3e-29b8f7300521","value":null}
[debug] [35m[W3C (d5f04a12)][39m Responding to client with driver.performTouch() result: null

对这种奇怪的行为有什么想法吗?

提前感谢您的回答!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)