Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appium 1.6.5 or above XCUITest not able to find the web views in my hybrid ios app #9014

Closed
SK-Samy opened this issue Aug 11, 2017 · 11 comments
Labels
XCUITest regarding xcuitest driver

Comments

@SK-Samy
Copy link

SK-Samy commented Aug 11, 2017

The problem

Hi,
When I search AVAILABLE_CONTEXT in my hybrid mobile app(.ipa) in iOS real device, appium returns only "Native_context" where it is not returning my web_view. Earlier it was working with appium 1.6.3 not in 1.6.5 or above.

Environment

  • Appium version : 1.6.6-beta.4
  • Xcode : 8.2.1
  • Mac Desktop OS: 10.11.6
  • Node.js version :4.4.4
  • Mobile platform/version under test: ios 10.0.1
  • Real device : iOS Device connected to MAC
  • Appium CLI : Appium CLI 1.6.6-beta.4

Details

In appium upgraded version, Not able to see the available context for "web_view" wherein earlier version it was working fine.

my capabilities (appium.txt)
[caps]
platformName = "iOS"
deviceName = "iPhone"
app = "/Users/tmp/.ipa"
sendKeyStrategy = "setValue"
automationName="XCUITest"
useNewWDA=true
startIWDP=true
udid="
**************************"
realDeviceLogger="/usr/local/lib/node_modules/deviceconsole/deviceconsole"
platformVersion = "10.0.1"
xcodeConfigfile="/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Configurations/ProjectSettings.xcconfig"

[appium_lib]
server_url = "http://localhost:4723/wd/hub"

Link to Appium logs

below link are my appium log
Appium log

Code To Reproduce Issue [ Good To Have ]

For reference.

@mykola-mokhnach mykola-mokhnach added the XCUITest regarding xcuitest driver label Aug 11, 2017
@SK-Samy
Copy link
Author

SK-Samy commented Aug 14, 2017

@mykola-mokhnach is there any solution?

@siggerzz
Copy link

Works fine for me on 1.6.3/4/5/6-beta.4

@SK-Samy
Copy link
Author

SK-Samy commented Aug 14, 2017

@siggerzz can you please share your capabilities(appium.txt)

@siggerzz
Copy link

@EBtransversal

        caps.SetCapability("name", TestContext.CurrentContext.Test.Name);
        caps.SetCapability("deviceName", _deviceName);
        caps.SetCapability("platformName", _platformName);
        caps.SetCapability("platformVersion", _platformVersion);
        caps.SetCapability("environment", _environment);
        caps.SetCapability("autoWebview", true);
        caps.SetCapability("startIWDP", true);
        caps.SetCapability("xodeOrgId", "XXXXXXX");
        caps.SetCapability("xcodeSigningId", "iPhone Developer");

I imagine the ones that's of interest to you is the 'autoWebview' capability.

Hope it helps!

@pavanbachu0604
Copy link

Can you try clearing the WDA Cache :
sudo rm -rf /Users/$USER/Library/Developer/Xcode/DerivedData/WebDriverAgent-*

@SK-Samy
Copy link
Author

SK-Samy commented Aug 16, 2017

@pavanbachu0604
I cleared those cookies still the issue is persisting :(
below are my console output..

[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: false
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[debug] [RemoteDebugger] Page element JSON: []
[debug] [iOS] No web frames found.
[debug] [MJSONWP] Responding to client with driver.getContexts() result: ["NATIVE_APP"]
[HTTP] <-- GET /wd/hub/session/d58d3378-e270-49f1-a721-c3e9fd117227/contexts 200 16 ms - 86
[HTTP] --> GET /wd/hub/session/d58d3378-e270-49f1-a721-c3e9fd117227/contexts {}
[debug] [MJSONWP] Calling AppiumDriver.getContexts() with args: ["d58d3378-e270-49f1-a721-c3e9fd117227"]
[debug] [XCUITest] Executing command 'getContexts'
[debug] [iOS] Getting list of available contexts
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: false
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[debug] [RemoteDebugger] Page element JSON: []
[debug] [iOS] No web frames found.
[debug] [MJSONWP] Responding to client with driver.getContexts() result: ["NATIVE_APP"]
[HTTP] <-- GET /wd/hub/session/d58d3378-e270-49f1-a721-c3e9fd117227/contexts 200 12 ms - 86
[debug] [XCUITest] Connection to WDA timed out
[debug] [iProxy] recv failed: Operation not permitted
[HTTP] --> GET /wd/hub/session/d58d3378-e270-49f1-a721-c3e9fd117227/source {}

@jlipps
Copy link
Member

jlipps commented Aug 30, 2017

@EBtransversal if you run IWDP on its own, then launch your app and try to use Safari to attach to the remote debugger in your app, are you able to?

@jlipps
Copy link
Member

jlipps commented Sep 8, 2017

@jlipps
Copy link
Member

jlipps commented Sep 14, 2017

@maxklimav what that means is that something is either wrong with your system, device, or ios_webkit_debug_proxy. If you're not able to connect to the remote debugger on your real device using those tools outside of Appium, then Appium won't be able to do it either. I'd recommend looking for help with the ios_webkit_debug_proxy maintainers.

@jlipps jlipps closed this as completed Sep 14, 2017
@skansar
Copy link

skansar commented Apr 12, 2018

Hello @masoodmd0786/ @imurchie / @jlipps , I am facing the similar issue with Appium v1.7.2 and Java_client 4.1.2, IOS 10.3(iphone 7s), mac OS Sierra, XCODE 9.2, ios_webkit_debug_proxy 1.8
Built with libimobiledevice v1.2.1, libplist v2.0.0 and safari 11.2.

WebViews are not recognized / shown with appium desktop as well through java client.

appium server
appium --webkit-debug-proxy-port 9222 (tried with OR 27753)
[Appium] Welcome to Appium v1.7.2
[Appium] Non-default server args:
[Appium] webkitDebugProxyPort: 9222 (OR 27753)
[Appium] Appium REST http interface listener started on 0.0.0.0:4723

wda
ios_webkit_debug_proxy
Listing devices on :9221 (OR 27753)
Connected :9222 to iPhone (470ab1f19c630548f76ed0b2f8a4a31614b2c847)

capabilities:
[Appium] Creating new XCUITestDriver (v2.64.0) session
[Appium] Capabilities:
[Appium] app: com.amazon.AmazonUK.Enterprise
[Appium] newCommandTimeout: 380
[Appium] platformVersion: 10.3
[Appium] xcodeOrgId: 94KV3E626L
[Appium] automationName: XCUITest
[Appium] autoWebview: false
[Appium] platformName: iOS
[Appium] udid: 470ab1f19c630548f76ed0b2f8a4a31614b2c847
[Appium] deviceName: IOSDevice
[Appium] xcodeSigningId: iPhone Developer

appium Log:
[debug] [MJSONWP] Calling AppiumDriver.getContexts() with args: ["e5be6ced-f4ac-4e21-8618-d97e1d9991c2"]
[debug] [XCUITest] Executing command 'getContexts'
[debug] [iOS] Getting list of available contexts
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: false
[debug] [RemoteDebugger] Getting WebKitRemoteDebugger pageArray: localhost, 27753
[debug] [RemoteDebugger] Sending request to: http://localhost:27753/json
[debug] [RemoteDebugger] Page element JSON: []
[debug] [iOS] No web frames found.
[debug] [MJSONWP] Responding to client with driver.getContexts() result: ["NATIVE_APP"]

Any help appreciated. Thank You.

@lock
Copy link

lock bot commented Apr 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Apr 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
XCUITest regarding xcuitest driver
Projects
None yet
Development

No branches or pull requests

6 participants