Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#1,954 8 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 5 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
mobile-dev

Hướng nghiên cứu

Bắt đầu bằng cách chạy bản tái hiện tap-action Java được cung cấp trên các phiên bản Appium và Android được liệt kê, sau đó so sánh các action đã được tuần tự hóa với các log Appium được liên kết. Điểm vào liên quan được báo cáo là yêu cầu W3C /actions, với lỗi được hiển thị trong W3CActions.safeHandle; công việc được coi là hoàn tất khi nguyên nhân của phản hồi invalid-argument được xác định và ghi lại hoặc được khắc phục.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Java
Star
1.3k
Fork
755
Merge trung bình
5 ngày 14 giờ
Pull request đã merge (30 ngày)
8

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của appium/java-client

Tất cả issue của appium/java-client

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.