Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Appium 2.0 - [W3C] Matched W3C error code 'invalid argument' to InvalidArgumentError

未关闭
#1,954 8 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
java
领域
mobile-dev

调研方向

首先,针对列出的 Appium 和 Android 版本运行提供的 Java tap-action reproduction,然后将序列化后的 actions 与链接的 Appium 日志进行比较。相关的已报告入口点是 W3C /actions 请求,失败显示在 W3CActions.safeHandle 中;完成标准是识别并记录或修正 invalid-argument 响应的原因。

由索引模型根据 Issue 内容生成。

描述

Description

Getting error while perform tap Action using W3C

Environment

  • Java client build version: 8.5.1
  • Appium Version: 2.0.0-rc.3
  • Node.js version: v14.18.0
  • Mobile platform/version: Android 12
  • Real device: Moto G20 Fusion

Code To Reproduce Issue [ Good To Have ]

Below is the sample tap action code

public void tapCenterUsingW3C()
{
           log.info("CLICKING AT CENTER OF SCREEN");
           Dimension dimension = getAppiumDriver().manage().window().getSize();
           System.out.println("dimension dimension " + dimension);
           Point point = new Point((int) (dimension.width * 0.5), (int) (dimension.height * 0.5));
           System.out.println("dimension dimension  point.getX() " + point.getX());
           System.out.println("dimension dimension  point.getY() " + point.getY());
           PointerInput FINGER = new PointerInput(TOUCH, "finger");
           Sequence tap = new Sequence(FINGER, 100)
                .addAction(FINGER.createPointerMove(ofMillis(10), viewport(), point.getX(), point.getY()))
                .addAction(FINGER.createPointerDown(LEFT.asArg()))
                .addAction(new Pause(FINGER, ofMillis(milliseconds)))
                .addAction(FINGER.createPointerUp(LEFT.asArg()));
           getAppiumDriver().perform(List.of(tap));
           log.info("CLICKED AT CENTER OF SCREEN");
  }

Link To Appium Logs

[debug] [AndroidUiautomator2Driver@3aba (07890412)] Matched '/actions' to command name 'performActions'
[debug] [AndroidUiautomator2Driver@3aba (07890412)] Proxying [POST /actions] to [POST http://127.0.0.1:10001/session/042567b1-6a57-4895-816a-60f11f23ba74/actions] with body: {"actions":[{"id":"finger","type":"pointer","parameters":{"pointerType":"touch"},"actions":[{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"},{"duration":0,"type":"pause"}...
[AndroidUiautomator2Driver@3aba (07890412)] Got response with status 400: {"sessionId":"042567b1-6a57-4895-816a-60f11f23ba74","value":{"error":"invalid argument","message":"Exception while reading JSON","stacktrace":"io.appium.uiautomator2.common.exceptions.InvalidArgumentException: Exception while reading JSON\n\tat io.appium.uiautomator2.handler.W3CActions.safeHandle(W3CActions.java:92)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:59)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:277)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:271)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)\n\tat io.n...
[debug] [W3C] Matched W3C error code 'invalid argument' to InvalidArgumentError
[debug] [AndroidUiautomator2Driver@3aba (07890412)] Encountered internal error running command: io.appium.uiautomator2.common.exceptions.InvalidArgumentException: Exception while reading JSON

Detailed Appium Log:

https://gist.github.com/dipakkumar1225/76f6e226e8fb1e1a5110deb30a0aad62

主要语言
Java
星标
1.3k
派生
755
平均合并
5 天 14 小时
30 天内合并 PR
8

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

appium/java-client 的其他 Issue

查看 appium/java-client 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。