1
votes

I am automating a native iOS app, where after tapping Register with Facebook, the Facebook app opens, where the user can input his login credentials. The problem is that after the Facebook app is opened, no elements can be interacted with, though they are located in the Appium inspector. So is there any way to switch to the Facebook app and interact with it, before returning to the original app?

Appium Version: 1.4.13 Mac OS X: 10.11.4 Device: iPhone5 / iOS 9.3 Xcode Version: 7.3

Here is a screen of the 2 opened apps

1
probably there is a WEBVIEW that you get to see as shown in the screen, could you try and get the current context at this point and come back. - Naman
If you are able to locate in uiautomator then you should be able to interact with elements. If you are using ids then use complete id with package name (copy whole resource-id from uiautomator). - Chandrashekhar Swami
If possible post uiautomator image to know element tree structure - Chandrashekhar Swami
Hi Shekhar, uiautomator is an Android inspecting tool only (in Android I can interact with the stock Facebook app fine). When inspecting with the Appium inspector, what I get for the password field for example is: name: password-field type: UIASecureTextField value: Password label: Password Field enabled: true visible: false valid: true location: {28, 281} size: {269, 44} xpath: //UIAApplication[1]/UIAWindow[1]/UIASecureTextField[1] However, mapping by name or Xpath is not possible, because I haven't switched to the Facebook app, and Appium still can not interact with it. - Arokh
When I use driver.getContext(); on the Facebook app, all I get is the same as in the original app: "value":"NATIVE_APP". And switching with the driver.switchTo() does not let me interact with the Facebook app also. - Arokh

1 Answers

1
votes

Appium works by a unique session id w.r.t to the device and app, u cannot switch from one app to another.

I would suggest automate after registering manually. Then u can give the facebook app name in app name capability from which it will start interact with the app