Unable to find webView in iOS Hybrid App_xCode9_Appium1.7.1

Hi Team,

I am working with iOS Hybrid App, I need to test app on Real device with Latest iOS versions 10.3.3 and above.

Currently when I lands on web view(it opens within the App not in safari) in the app and wait time almost 25-30 seconds still I am unable to find a webView in getContextHandles() onscreen webView displays under 5 seconds, it is returning only nativeView

A. Tried to launch iOS-webkit-debug proxy+Appium from capabilities - did not worked

  1. Capabilities.setCapability(“startIWDP”, true);
  2. Capabilities.setCapability(“webkitDebugProxyPort”, “27753”);

B. Tried to launch Manually iOS-webkit-debug proxy+Appium- did not worked

  1. Start Appium server: appium --webkit-debug-proxy-port 27753
  2. Start iOS-webKit-proxy: ios_webkit_debug_proxy -c myDeviceUDID:27753 -d

C. Tried Manual proxy- did not worked

  1. launch iOS-webKit-proxy: ios_webkit_debug_proxy -c myDeviceUDID:27753 -d
  2. In App Navigate to the webContent page (it opens within the App not in safari)
  3. Open url http://localhost:27753/json
  4. Empty response - {}

And when I try to launch safari and go to any random website, url http://localhost:27753/json shows response
“devtoolsFrontendUrl”: “/devtools/devtools.html?ws=localhost:27753/devtools/page/1”,
“faviconUrl”: “”,
“thumbnailUrl”: “/thumb/xyz/”,
“title”: “xyzzy”,
“url”: “xyzzy”,
“webSocketDebuggerUrl”: “ws://localhost:27753/devtools/page/1”,
“appId”: “PID:xyz”

Can someone please help me to understand what exactly I am missing ?

Below are the versions on which I am working
iOS: 10.3.3
xCode: 9
Appium: 1.7.1
Java client: 5.0.3
selenium: 3.6.0
ios_webkit_debug_proxy 1.8

I have validated iOS_webkit_proxy connection with the help of ticket https://github.com/appium/appium/issues/9014


@Masoodmd0786 Did you get any solution for the same ? Pls share.

Yes Using sauce real devices on cloud and with local simulators…

So still no solution on real connected devices then.

Created multiple tickets for local but no luck, cloud real device/ local simulator is best option to get started with scripting and mean while try troubleshooting…

Buddy, start working with local simulators or cloud real device… I have been in mobile industry since it was started from almost 3-4 years and per my experience local device is not feasible you will face network and bunch of issues… mobile automation always needs to be tested using cloud environments

Agreed, but we have to use only physical iOS devices. And I hope it must have an answer. Still looking out for solution.

@Masoodmd0786 :- This issue resolved i am getting both the views in Physical devices. The issue lies with the developer certificate and the provisioning profile. Certificate should be developer not the distributed.

Awesome, I have added local device support as a backlog item, will try with dev cert and check with you for any issues…

1 Like

I am trying to automate a hybrid app(developed using ionic framework) on iOS device. But I am not sure which locators to use. I an trying to access elements using ‘by.css’, but that gives error saying “Locator strategy : css selector is not valid for this session”. Please provide inputs to the same.

Configuration : Appium : 1.7.2 Protractor :5.3.0 Xcode : 9.2 iOS : 11.2.2 Device : iPhone 6+ MacOS : 10.12.6

Are you able to get the Web and Native context ?
If yes, try passing Xpath. Pls share the Appium logs to verify the exact issue.