Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The screen control is not working #1

Open
BastienTLC opened this issue May 6, 2024 · 1 comment
Open

The screen control is not working #1

BastienTLC opened this issue May 6, 2024 · 1 comment

Comments

@BastienTLC
Copy link

When i try to tap or swipe on the screen nothing is happening
when i consult the logs after tap on screen :
./view_log -proc wdaproxy

time="2024-05-06T10:39:50+02:00" level=info msg="req start" body_in="{\"actions\":[{\"action\":\"tap\",\"options\":{\"x\":223.69976341724396,\"y\":459.04386925697327}}]}" type=req.start uri=/session/229BDA73-8799-446E-A988-07E5011762EB/wda/touch/perform
Error:%!s(<nil>)
[10:39:50] 404 POST /session/229BDA73-8799-446E-A988-07E5011762EB/wda/touch/perform ([) 7.24ms
time="2024-05-06T10:39:50+02:00" level=info msg="req done" body_out= type=req.done uri=/session/229BDA73-8799-446E-A988-07E5011762EB/wda/touch/perform

./view_log -proc wda

Req URI: /session/229BDA73-8799-446E-A988-07E5011762EB/wda/touch/perform
{
  "actions": [
    {
      "action": "tap",
      "options": {
        "x": 223.69976341724396,
        "y": 459.04386925697327
      }
    }
  ]
}

./view_log -proc stf_ios_device

2024-05-06T08:39:50.027Z INF/device-ios:plugins:wdaCommands 4149 [b4ab88414479f4a65d75df74e997235082a689ef] click at x: 223.69976341724396 y: 459.04386925697327
2024-05-06T08:39:50.037Z WRN/device-ios:plugins:wdaCommands 4149 [b4ab88414479f4a65d75df74e997235082a689ef] posting {"actions":[{"action":"tap","options":{"x":223.69976341724396,"y":459.04386925697327}}]} to: http://localhost:8100/session/229BDA73-8799-446E-A988-07E5011762EB/wda/touch/perform status code: 404

These errors seem to show that the endpoint does not exist
When i check in WDA documentation : https://w3c.github.io/webdriver/ i can't find somethings related to /touch/perform endpoint.
So to ensure me that working i forked this repository : https://github.com/BastienTLC/stf-ios-provider to adapt the endpoints

Did you manage to get control working without forking this repository ?

@NguyenHoangDuy2406
Copy link

@BastienTLC @Jitu1888
The "tap & swipe" won't work because now with the WebDriverAgent version over 7.0.0, the old actions are removed: https://github.com/appium/appium-xcuitest-driver/releases/tag/v7.0.0

We must update the script in coordinator/wda.go > function swipe to:

func ( self *WDAType ) swipe( sid string, x1 int, y1 int, x2 int, y2 int ) ( string ) {
  log.Info( "Swiping:", x1, y1, x2, y2 )
  json := fmt.Sprintf( `{
    "actions": [
      {
        "type": "pointer",
        "id": "finger1",
        "parameters": {"pointerType": "touch"},
        "actions": [
          {"type": "pointerMove", "duration": 0, "x": %d, "y": %d},
          {"type": "pointerDown", "button": 0},
          {"type": "pause", "duration": 500},
          {"type": "pointerMove", "duration": 0, "origin": "pointer", "x": %d, "y": %d},
          {"type": "pointerUp", "button": 0}
        ]
      }
    ]
  }`, x1, y1, x2, y2 )
  resp, _ := http.Post( self.base + "/session/" + sid + "/actions", "application/json", strings.NewReader( json ) )
  res := resp_to_str( resp )
  log.Info( "response " + res )
  return res
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants