facebookarchive / WebDriverAgent

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

WebDriverAgent (Appium 1.7.0) + Xcode 9 + iOS10.x not finding element on new app if manually navigated to new app #732

Open rajfidel opened 7 years ago

rajfidel commented 7 years ago

The problem

This below mentioned issue is only present in the combination of WebDriverAgent (Appium 1.7.0) + Xcode 9 + iOS 10.x:

  1. If session was started for a bundleID (in this case com.fidlee.ICMHelper), and another app is manually opened (in this case com.apple.Preferences), findElement does not find any element present on com.apple.Preferences. PageSource shows all the elements correctly though.
  2. FindElement only works if the appium session was started for the bundleID on which the element is present. So if appium session was started for bundleID com.apple.Preferences, it would be able to find elements present in com.apple.Preferences application.

This issue is not present for the combination of WebdriverAgent (Appium 1.7.0) + Xcode 8.3.3 + iOS 10.x This issue is not present for the combination of WebdriverAgent (Appium 1.7.0) + Xcode 9 + iOS 11.0

Appium Logs are available below:

  1. On iOS 10 + Appium 1.7.0 WebdriverAgent + Xcode 9, create session for com.fidlee.ICMHelper, manually launch com.apple.Preferences and try to find an element. Logs available here (Is unable to find element All other scenarios described below work fine)
  2. On iOS 10 + Appium 1.7.0 WebdriverAgent + Xcode 9, create session for com.apple.Preferences and try to find an element. Logs available here (Is able to find element)
  3. On iOS 11 + Appium 1.7.0 WebdriverAgent + Xcode 9, create session for com.fidlee.ICMHelper, manually launch com.apple.Preferences and try to find an element. Logs available here (Is able to find element)
  4. On iOS 11 + Appium 1.7.0 WebdriverAgent + Xcode 9, create session for com.apple.Preferences and try to find an element. Logs available here (Is able to find element)

Environment

marekcirkos commented 7 years ago

You try to match element by name "Wi-Fi", is it possible that it is different when run with Xcode 8.3.3?

rajfidel commented 7 years ago

@marekcirkos On iOS 10.x + Xcode 8.3.3 and on iOS 10.x + Xcode 9.0, if the Appium session launches com.apple.Preferences, it is able to match the element by name "Wi-Fi" (I do ensure it is on the main Preferences page in both cases, so it is not a setup issue). Also, this issue is not specific to Preferences app. Just mentioned Preferences as an example to reproduce the issue.

I have tried matching element by accessibility identifiers as well on our application under test and it doesn't find the element in the following 2 conditions on iOS 10.x + Xcode 9.0:

  1. Manually navigate to application under test and then try to find the element that was manually launched (by name, accessibility identifier etc.)
  2. Click using Appium a button that navigates to another application (using CustomURL schemes) and then try to find the element on the new application that was launched (by name, accessibility identifier etc.).

Currently I am using different setups for iOS 10.x and iOS 11.x (iOS 10.x + Xcode 8.3.3 and iOS 11.x + Xcode 9) to get around this issue since iOS 10.x + Xcode 9 is not working in the above 2 mentioned cases (Not able to figure out why it is not working).

rajfidel commented 7 years ago

@marekcirkos Also, please rebuild WebdriverAgent on iPhone using Xcode 9 if the issue has to be reproduced (Reusing WebdriverAgent on iPhone from Xcode 8.3.3 will not display the issue)

coolzire commented 7 years ago

@marekcirkos I am seeing this issue too. I had no problem with using xcode 8 and iphone 5s 10.3.3. However since I updated to xcode 9 and the issue occur on my 10.3.3 device but not on my 11.0.2 device. If you use the appium gui , you are able to see the elements but you can't interact with them directly. Touch action do work .

vslobotskoy commented 7 years ago

@marekcirkos , I am seeing the same issue with my iOS 10.x phones after I upgraded to XCode 9. My used case is similar: I launch session of com.apple.Preferences, then I swipe up to get airplane mode/wifi/bluetooth controls, and then I can't find any of them. The same works fine with iOS 11 (Although the elements have slightly different names).

rajfidel commented 7 years ago

@marekcirkos Also, this is not a timing issue. I have tried waiting for more than a minute after navigating to the new app before trying to find multiple elements using multiple locators (accessibility identifiers available in our test application, by name, xpath etc). This has never worked for me with Xcode 9 + iOS 10 combination and works every time with Xcode 8.3.3 + iOS 10 combination.

denkisdeng commented 7 years ago

@marekcirkos , I get the same issue ,need help !!

leandromercado commented 7 years ago

I have the same issue.

iOS 10.3.3 + xcode 9.1 + Appium 1.7.1 = I can't find OK button for allowing permissions popup. But I can find it with iOS 11.1.1

iOS 11.1.1 + xcode 9.1 + Appium 1.7.1 = I can't find some random buttons on the app, but I can find them on Appium Inspector, or on iOS 10.x.x

ilushkafi commented 7 years ago

I have the same issue! Please help!

mrif0393 commented 6 years ago

I have update my appium to 1.7.1 xcode to latest 9.2 macos to 10.12.6 and ios 11.Earlier i could see the element tree in the inspector and elements are getting clicked.But after the update it is not working. Any solution for this.

kgneil commented 6 years ago

This is also my issue. Is there any update on this?

amishra1312 commented 6 years ago

I am using Appium 1.7.2/Xcode 9.2/MacOS 10.12.6 with iOS 11.2.2 and facing the same issue. Any update on this?

kumarpillai commented 6 years ago

Not able to work on Simulator elements where as real device is working fine on finding elements. I tried with few combinations, changing xcode version, appium version, simulator build version in android sdk. Example Xcode 9.0/9.2, appium 1.7/1.72, sim 10.3/11.0.1. Simulator which was working earlier a month ago is not working now. Any ideas please.