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.

Long press touch action is no longer working for iOS in 1.8.0

See original GitHub issue

The problem

Long press TouchAction method is not recognized as long press in iOS when moving up to Appium 1.8.0. If I use Appium 1.7.2, the long press method works as expected.

Environment

  • Appium version (or git revision) that exhibits the issue: 1.8.0 (Appium Desktop 1.6.1)
  • Last Appium version that did not exhibit the issue (if applicable): 1.7.2 (Appium Desktop 1.5.0)
  • Desktop OS/version used to run Appium: Mac (10.13.3), Ruby 2.5.1 (Ruby Gems: appium_console (2.8.1), appium_lib (9.12.0), appium_lib_core (1.5.0)
  • Mobile platform/version under test: Xcode 9.2 (11.2)
  • Real device or emulator/simulator: Simulator
  • Appium CLI or Appium.app|exe: Appium.app

Details

It seems like something has changed with the long press method, which has caused it to not be recognized as a long press in iOS. Executing the following commands in Appium Ruby Console, I got unexpected results when calling long_press() in Appium 1.8.0.

Command 1.7.2 gesture recognized 1.8.0 gesture recognized result
Appium::TouchAction.new.press(x:200,y:100).release.perform tap tap pass
Appium::TouchAction.new.long_press(x:200,y:100).release.perform long press tap fail
Appium::TouchAction.new.press(x:200,y:100).wait(500).release.perform tap tap pass
Appium::TouchAction.new.press(x:200,y:100).wait(501).release.perform long press long press pass

Link to Appium logs

Will add if needed

Code To Reproduce Issue

https://github.com/JoelWhitney/sample-appium-test/tree/touch-action-bug

Steps To Reproduce Issue

  1. Clone sample-appium-test
  2. In Appium Desktop 1.6.1, start Server 1.8.0
  3. Open Terminal at sample-appium-test directory
  4. Start Appium Ruby Console, via arc command
  5. Execute Appium::TouchAction.new.long_press(x:200,y:100).release.perform command
  6. Notice UILabel says Tap occurred instead of Long press occurred
  7. Execute Appium::TouchAction.new.press(x:200,y:100).wait(500).release.perform command
  8. Notice UILabel says Long press occurred as expected
  9. In Appium Desktop 1.5.0, start server 1.7.2
  10. Repeat steps 5-8 and notice long press behaves as expected

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9

github_iconTop GitHub Comments

1reaction
mykola-mokhnachcommented, May 17, 2018

since 1.8.0 touch action handler has been completely rewritten, so it is now using the “fair” XCTest implementation under the hood. Previously we were trying to match a limited set of action chains that were similar to the available XCUIElement method calls.

0reactions
lock[bot]commented, Jun 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

iOS + appium java client: Long press TouchAction does not ...
I am trying to automate long press touch action in a native iOS app. Approach1: to simulate long press in top left corner...
Read more >
appium/java-client - Gitter
I am trying to automate my iOS app where I need to inspect one of the webview ... The method longPress(LongPressOptions) in the...
Read more >
Longpress is not working in iPhone devices - Appium Discuss
I have used below code to press long press. It is working and thrown exception. webElement = driver.findElementByAccessibilityId(“Sign Up ...
Read more >
Maps SDK for iOS release notes - Google Developers
5 and lower will no longer work after those versions are decommissioned. To avoid disruption for your users, build new versions of your...
Read more >
UniFi Protect iOS 1.8.0 - Ubiquiti Community
Also, all of the cameras show "Excellent" when they are in fact wired devices, not WiFi devices. In the Network app, they show...
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