appium: Clicks on elements don't work properly on iPad and iPhone 10.0+ in landscape mode

The problem

Triggering WebElement->click method on iPad 10.0 simulator in landscape mode does work properly and always clicks at wrong location. At the same time it works as expected in portrait mode.

Environment

  • Appium version (or git revision) that exhibits the issue: 1.6.0 @ XCUITest
  • Last Appium version that did not exhibit the issue (if applicable):
  • Desktop OS/version used to run Appium: 10.11
  • Node.js version (unless using Appium.app|exe): 5.4.1
  • Mobile platform/version under test: iOS 10.0
  • Real device or emulator/simulator: iPad Air Simulator
  • Appium CLI or Appium.app|exe: CLI

Details

This is, most likely, bug in XCTest framework itself and I have already reported it to Apple bugtracker, but, probably, we can introduce a workaround or add it to the official documentation as known issue. Although, the described problem is not reproducible in iPad simulator 9.3. It only started to fail after I upgraded Xcode to version 8.0. It looks like XCTest always assumes we are in portrait mode and calculates wrong coordinates for clicking. I’ve tried to directly call WDA methods like setOrientation and setRotation, but neither of them helps to workaround the problem. Reference to the other known issue: https://github.com/facebook/WebDriverAgent/issues/300

Code To Reproduce Issue [ Good To Have ]

driver.rotate(ScreenOrientation.LANDSCAPE);
WebElement el = driver.getElement(locator);
el.click()

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 39 (6 by maintainers)

Most upvoted comments

We are eagerly awaiting a fix too. Apple is aware of the problem.

@maesiva You need to install it within the Appium installation for it to work. Or you can re-install the whole thing with npm uninstall -g appium && npm install -g appium --no-shrinkwrap.

@maesiva looks like the same issue as #7357 so we’ll track it there

Can you let me know how do i update WDA master branch alone ? Download and Copy the code folder manually ? Or is there a npm command for that ?

I downloaded it from : https://github.com/facebook/WebDriverAgent and Copied it to /Users/automation/node_modules/appium-xcuitest-driver/. And fetched dependencies again. It worked for me in landscape mode. 😃 I copied the bundle i got from1.6.1 for new WDA project copied from git.