facebookarchive / WebDriverAgent

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

iOS 11 displayed value returns false incorrectly for XCUIElementTypeImage #746

Open rajfidel opened 6 years ago

rajfidel commented 6 years ago

The problem

We have an iOS test application. When installed on a device with iOS 10.x, the displayed value for XCUIElementTypeImage elements is "true" (which is correct) When installed on a device with iOS 11.0, the displayed value for XCUIElementTypeImage elements is "false" (incorrect) I can see that the image is visible on the GUI on checking manually in both cases. This issue is only present on XCUIElementTypeImage elements. (Easily reproducible by checking the image displayed property value on iOS Settings application com.apple.Preferences)

Both devices are iPhone 6s (same form factor), Appium 1.7.0 + Xcode 9 is used in both cases above. WebdriverAgent was removed and freshly installed on the iPhone in both cases. There are no overlapping GUI components that overlap with the XCUIElementTypeImage element as per the page source (Not sure if it matters, but checked anyways, just in case)

On debugging WebdriverAgent: On iOS 11.0 - hitPoint is -1.000000, -1.000000 (incorrect) On iOS 10.x - hitPoint is 47.500000, 291.500000 (correct) which causes the below code snippet in XCUIElement+FBIsVisible.m to execute (in iOS 10.x) or not execute (in iOS 11.0)

  if (CGRectContainsPoint(appFrame, self.fb_hitPoint)) {
    return YES;
  }

Environment

Details

Got the displayed property and the Page source for the following configurations:

Appium 1.7.0 + iOS 10 + Xcode 9 --> Page source here, Appium logs here Appium 1.7.0 + iOS 11 + Xcode 9 --> Page source here, Appium logs here.

The XCUIElementTypeImage element of interest is with name 'PairDevice_KeepImage'. The 'x', 'y', 'width' attribute values are all same for iOS 10.x and 11.0 The displayed value is the only one that is different between 10.x and 11.0.

mykola-mokhnach commented 6 years ago

@rajfidel Can you try to apply the patch from https://github.com/facebook/WebDriverAgent/pull/764 locally and check if it works for you?

ptthuong commented 6 years ago

@mykola-mokhnach How can I apply your patch locally? I have an issue that was described here. Maybe it's same with this issue

niu0220 commented 6 years ago

Hi @mykola-mokhnach , @ptthuong i have some issue with appium1.7.2-beta5, and I would like to know how can I apply the patch??? Please let me know the steps, so I can help to test it too.

Thanks, Sharon

niu0220 commented 6 years ago

HI, any update here? the problem is even worst in newest Appium@1.7.2 version ( terminal and desktop). any suggestions?

Thanks

alangithubtrader commented 6 years ago

I am experiencing the same issue. I am using Appium 1.7.2 because 1.8 is still unstable for me when i test on android.

TheKnight commented 6 years ago

I have same issues on appium 1.8.1 and iOS 11.4.

abhilashsiyer commented 5 years ago

Hey guys, facing the same issue on iOS11.4 and appium 1.7.2 or appium 1.8.1.

Visible is returned true when I run my tests on 11.0, But when I run the same test on 11.4, I get Visible as false. These elements are either of type XCUIElementTypeStaticText or XCUIElementTypeButton.

iOS 11, Xcode 9.1

XCUIElementTypeButton type="XCUIElementTypeButton" name="booking_item_more_menu" label="More menu" enabled="true" visible="true" x="311" y="384" width="48" height="58"

The same element in iOS 11.4, Xcode 9.4

XCUIElementTypeButton type="XCUIElementTypeButton" name="booking_item_more_menu" label="More menu" enabled="true" visible="false" x="311" y="383" width="48" height="59"

Any advice is much appreciated !

brandonburgess08 commented 5 years ago

So is there a resolution for this? I am using Xcode 9.4 and Appium 1.7.1 and all elements return isDisplayed=false. It looks like upgrading to 1.8.1 has not solved the issue.

brandonburgess08 commented 5 years ago

So is there a resolution for this? I am using Xcode 9.4 and Appium 1.7.1 and all elements return isDisplayed=false. It looks like upgrading to 1.8.1 has not solved the issue.

I upgraded to Appium 1.7.2 and isVisible is now returning true.

ganjarpanji commented 5 years ago

this issue still occurred in appium 1.10.1 😢

JAidhy commented 5 years ago

This issue is still happening on 1.11.0. Any solution to this?