Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

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

Offen
#1,954 8 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 5 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
java
Bereich
mobile-dev

Rechercherichtung

Führe zunächst die bereitgestellte Java-Tap-Action-Reproduktion gegen die aufgeführten Appium- und Android-Versionen aus und vergleiche anschließend die serialisierten Aktionen mit den verlinkten Appium-Logs. Der relevante gemeldete Einstiegspunkt ist die W3C /actions-Anfrage, wobei der Fehler in W3CActions.safeHandle angezeigt wird; abgeschlossen ist die Aufgabe, wenn die Ursache der invalid-argument-Antwort identifiziert und dokumentiert oder korrigiert wurde.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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

Vorherrschende Sprache
Java
Sterne
1.3k
Forks
755
Ø Merge
5 T. 14 Std.
Gemergte PRs (30 T.)
8

Entwicklungsumgebung

  • Kein Dockerfile und keine Docker-Compose-Datei
  • Hat eine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus appium/java-client

Alle Issues in appium/java-client

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.