facebookarchive / WebDriverAgent

A WebDriver server for iOS that runs inside the Simulator.
Other
4.14k stars 1.35k forks source link

Appium IOS: XCUIElementTypeTable automatically scrolls when findelement is called #863

Open ervin-chan-bcs opened 6 years ago

ervin-chan-bcs commented 6 years ago

I’m currently testing out an app that has several XCUIElementTypeCell in an XCUIElementTypeTable. I search for a specific text from the table and click the specific list. Once I click it, the XCUIElementTypeCell expands, showing several items for me to interact with, one of which is a button that shows another screen.

Whenever I try to do a findelement to the button that needs to be clicked, the whole UI scrolls, causing the test script to fail since the button is no longer in view. Any reason as to why this is happening?

To add, it seems to only happen when interacting with cells found way below the list/table. It doesn’t happen when selecting the first several cells that appear upon loading.

FYI, Appium told me to raise this issue here.

Environment Appium version (or git revision) that exhibits the issue: 1.7.1 and 1.7.2 Last Appium version that did not exhibit the issue (if applicable): n/a Desktop OS/version used to run Appium: macOS Sierra 10.12.6 Node.js version (unless using Appium.app|exe): 9.4.0 Mobile platform/version under test: iOS - IPhone 5S on 10.3.3 Real device or emulator/simulator: real device Appium CLI or Appium.app|exe: Appium CLI

Link to Appium logs https://gist.github.com/ervin-chan-bcs/ec946487551cd72d8ac16859a2151021

marekcirkos commented 6 years ago

Does it scroll to the top? May be we click navigation bar instead for that element. Which would mean that either click button is broken or returned frames of the element are wrong. Can you investigate that? I am happy to review diffs tho will not have time to work on it.

ervin-chan-bcs commented 6 years ago

Based on my observation, it scrolls back to the top.

I'm not sure what you need to investigate further. How do i check if the click button is broken or the returned frames are wrong? Manually, the button works fine. Automation also works fine if selected element is the first few displayed in list upon loading. It just happens when we select elements below the table after scrolling further.

marekcirkos commented 6 years ago

I would check how inspector page looks before tapping. Check frames, and whether there are other elements with same locator

rahulcode commented 6 years ago

We are facing the same issue in Appium. Is there any update regarding the same?