question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WebDriverAgent multi session and parralel execution of command

See original GitHub issue

The problem

My problem, question concerns WebDriverAgent sub repository.

We can’t perform several actions simultaneously because when executing an action with a Session ID the latter will wait for the screen of the Device to stop moving again before sending back a response to the call and performing pending action in the pipe.

For example, with the device you test, open a long website using Chrome and perform a Swipe from top to bottom. The action will take 11second to send back a response to the caller and start executing the second action in the pipe that we would have executed in parralel. Those 11s are due to the fact that the IOS screen keep moving. (If you positionned the scroll at the bottom of the page, because there is nothing to scroll down anymore, the action will be executed way quicker (s).

So I was hoping that we could have several session in parralel to perform simultaneous action. But whenever we execute a POST command to generate a new Session ID it invalidates the previous one.

Could you please help us how to deal with it ?

Thank you in advance

Environment

  • WDA version (or git revision) that exhibits the issue: Not using Appium but WebDriverAgent only: 3.16.0
  • Desktop OS/version used to run WDA: MACOS BigSur 11.6
  • Node.js version (unless using Appium.app|exe): 12.22.1
  • Npm or Yarn package manager: 6.14.12
  • Real device or emulator/simulator:IPhone 6 Plus
  • Appium CLI or Appium.app|exe: N/A

Code To Reproduce Issue [ Good To Have ]

Generate Session ID curl -X POST $JSON_HEADER -d "{\"desiredCapabilities\":{\"bundleId\":\" jp.asurion.hako.nonprod\"}, \"capabilities\":{}}" $DEVICE_URL/session -s -w 'Total: %{time_total}s\n'

Simulating a SWIPE from top to bottom (just updating the y value 
url -X POST $DEVICE_URL/session/$SESSION_ID/wda/touch/perform -H 'content-type: application/json' -d '{"actions":[[{"action": "tap","options": { "x": 314.8047105073929, "y": 480.46292304992676 }}, {"action": "wait","options": { "ms": 17 }}, {"action": "moveTo","options": { "x": 252.25136697292328, "y": 479.13202476501465 }}, {"action": "wait","options": { "ms": 17 }}, {"action": "release","options": { }} ]]}' -s -w 'Total: %{time_total}s\n'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
mykola-mokhnachcommented, Dec 7, 2021

I wonder how Appium deal with such issue… maybe it didnt. it probably give a bad user experience then

It has nothing to do with Appium. It simply proxies all requests to XCTest framework. Btw the latter does not even provide any public APIs for touch actions, just a couple of shortcuts

1reaction
mykola-mokhnachcommented, Dec 7, 2021

Nothing I know of.

I would try to play with waitForIdleTimeout/animationCoolOffTimeout settings to cut off delays. Although, this might possibly create another issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running Multiple Appium Tests in Parallel - HeadSpin
This is a detailed guide on how to run multiple Appium tests in parallel.
Read more >
iOS [XCUITEST] real devices Parallel Execution - Feature
With the help of WebDriverAgent Appium will be able to run test on all real iOS devices parallely. With minor changes in WebDriverAgent...
Read more >
appium-xcuitest-driver - npm
Appium driver for iOS using XCUITest for backend. Latest version: 4.10.3, last published: 20 hours ago. Start using appium-xcuitest-driver ...
Read more >
Parallel execution in Appium 1.7 - Medium
In case of Android test using UIAutomator2 driver, multiple Android devices can be connected to the same Appium server on different systemPort ....
Read more >
Parallel Execution in Selenium: Session Handling & TestNG ...
To understand how to run selenium scripts in parallel with Multiple Browsers. Let's first understand Session Handling. During test execution ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found