Clicks on elements don't work properly on iPad and iPhone 10.0+ in landscape mode
See original GitHub issueThe 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()
Issue Analytics
- State:
- Created 7 years ago
- Comments:39 (6 by maintainers)
Top GitHub 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
.