facebookarchive / WebDriverAgent

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

iOS12 CAN NOT REFRESH SCREEN IN INSPECTOR #991

Open ekicham opened 6 years ago

ekicham commented 6 years ago

HELLO, I GET A EXCEPTION ERROR WHEN I REFRESH SCREEN IN "http://localhost:8100/inspector" HOW TO resolve this problem?Thanks!

environment

iOS:12 Mac os:10.13.6 XCODE: 10

LOGS:

2018-09-19 14:30:33.832571+0800 WebDriverAgentRunner-Runner[722:96732] +[CATransaction synchronize] called within transaction 2018-09-19 14:30:33.843147+0800 WebDriverAgentRunner-Runner[722:96732] Running tests... Test Suite 'All tests' started at 2018-09-19 14:30:37.191 Test Suite 'WebDriverAgentRunner.xctest' started at 2018-09-19 14:30:37.192 Test Suite 'UITestingUITests' started at 2018-09-19 14:30:37.192 Test Case '-[UITestingUITests testRunner]' started. t = 0.00s Start Test at 2018-09-19 14:30:37.193 t = 0.00s Set Up 2018-09-19 14:30:37.200189+0800 WebDriverAgentRunner-Runner[722:96732] Built at Sep 19 2018 14:29:54 2018-09-19 14:30:37.219119+0800 WebDriverAgentRunner-Runner[722:96732] ServerURLHere->http://10.166.99.72:8100<-ServerURLHere t = 33.22s Find the Application 'com.apple.springboard' t = 33.22s Snapshot accessibility hierarchy for app with pid 55 t = 33.40s Snapshot accessibility hierarchy for app with pid 55 t = 39.13s Find the Application 'com.apple.springboard' t = 39.14s Snapshot accessibility hierarchy for app with pid 55 t = 46.39s Find the Application 'com.tencent.xin' t = 46.40s Snapshot accessibility hierarchy for app with pid 726 t = 46.52s Snapshot accessibility hierarchy for app with pid 726 t = 46.85s Snapshot accessibility hierarchy for app with pid 726 2018-09-19 14:31:24.098650+0800 WebDriverAgentRunner-Runner[722:96926] [general] Exception caught during decoding of received reply to message '_XCT_fetchAttributes:forElement:reply:', dropping incoming message and calling failure block.

Exception: Exception while decoding argument 0 (#1 of invocation): <NSInvocation: 0x283f3e640> return value: {v} void target: {@?} 0x0 (block) argument 1: {@} 0x0 argument 2: {@} 0x0

Exception: value for key 'NS.objects' was of unexpected class 'XCAccessibilityElement'. Allowed classes are '{( NSNumber, NSData, NSDate, NSOrderedSet, NSSet, NSString, NSNull, NSArray, NSDictionary )}'. 2018-09-19 14:32:29.162657+0800 WebDriverAgentRunner-Runner[722:96732] Enqueue Failure: Hit testing Cell, {{0.0, 88.0}, {375.0, 68.0}}, label: 'pingcezu33,上午9:53,' at point {187.5, 122} returned (null) which is from the same process but cannot be mapped using AX data: Failed to lookup parent of element StaticText, {{0.0, 88.0}, {375.0, 68.0}}, label: 'pingcezu33,上午9:53,': Timeout waiting for fulfillment of promise for 'Fetching attributes 'XC_kAXXCAttributeParent' for AX element pid: 726, elementOrHash.elementID: 10779206080.43'. /Users/icos/sandbox/WebDriverAgent/WebDriverAgentRunner/UITestingUITests.m 37 1 t = 112.05s Snapshot accessibility hierarchy for app with pid 726 2018-09-19 14:32:29.328005+0800 WebDriverAgentRunner-Runner[722:97161] [general] Exception caught during decoding of received reply to message '_XCT_fetchAttributes:forElement:reply:', dropping incoming message and calling failure block.

Exception: Exception while decoding argument 0 (#1 of invocation): <NSInvocation: 0x283f25900> return value: {v} void target: {@?} 0x0 (block) argument 1: {@} 0x0 argument 2: {@} 0x0

Exception: value for key 'NS.objects' was of unexpected class 'XCAccessibilityElement'. Allowed classes are '{( NSNumber, NSData, NSDate, NSOrderedSet, NSSet, NSString, NSNull, NSArray, NSDictionary )}'. 2018-09-19 14:33:34.337842+0800 WebDriverAgentRunner-Runner[722:96732] Enqueue Failure: Hit testing Cell, {{0.0, 156.0}, {375.0, 68.0}}, label: 'pingcezu66,上午9:53,' at point {187.5, 190} returned (null) which is from the same process but cannot be mapped using AX data: Failed to lookup parent of element StaticText, {{0.0, 156.0}, {375.0, 68.0}}, label: 'pingcezu66,上午9:53,': Timeout waiting for fulfillment of promise for 'Fetching attributes 'XC_kAXXCAttributeParent' for AX element pid: 726, elementOrHash.elementID: 10779188416.61'. /Users/icos/sandbox/WebDriverAgent/WebDriverAgentRunner/UITestingUITests.m 37 1 t = 177.24s Snapshot accessibility hierarchy for app with pid 726 2018-09-19 14:33:34.521027+0800 WebDriverAgentRunner-Runner[722:97428] [general] Exception caught during decoding of received reply to message '_XCT_fetchAttributes:forElement:reply:', dropping incoming message and calling failure block.

Exception: Exception while decoding argument 0 (#1 of invocation): <NSInvocation: 0x283f1f3c0> return value: {v} void target: {@?} 0x0 (block) argument 1: {@} 0x0 argument 2: {@} 0x0

Exception: value for key 'NS.objects' was of unexpected class 'XCAccessibilityElement'. Allowed classes are '{( NSNumber, NSData, NSDate, NSOrderedSet, NSSet, NSString, NSNull, NSArray, NSDictionary )}'. 2018-09-19 14:34:39.530430+0800 WebDriverAgentRunner-Runner[722:96732] Enqueue Failure: Hit testing Cell, {{0.0, 224.0}, {375.0, 68.0}}, label: 'wechatTest01,上午9:53,' at point {187.5, 258} returned (null) which is from the same process but cannot be mapped using AX data: Failed to lookup parent of element StaticText, {{0.0, 224.0}, {375.0, 68.0}}, label: 'wechatTest01,上午9:53,': Timeout waiting for fulfillment of promise for 'Fetching attributes 'XC_kAXXCAttributeParent' for AX element pid: 726, elementOrHash.elementID: 10779194368.65'. /Users/icos/sandbox/WebDriverAgent/WebDriverAgentRunner/UITestingUITests.m 37 1 t = 242.67s Snapshot accessibility hierarchy for app with pid 726 2018-09-19 14:34:39.922456+0800 WebDriverAgentRunner-Runner[722:97520] [general] Exception caught during decoding of received reply to message '_XCT_fetchAttributes:forElement:reply:', dropping incoming message and calling failure block.

Exception: Exception while decoding argument 0 (#1 of invocation): <NSInvocation: 0x283ff2180> return value: {v} void target: {@?} 0x0 (block) argument 1: {@} 0x0 argument 2: {@} 0x0

Exception: value for key 'NS.objects' was of unexpected class 'XCAccessibilityElement'. Allowed classes are '{( NSNumber, NSData, NSDate, NSOrderedSet, NSSet, NSString, NSNull, NSArray, NSDictionary )}'. 2018-09-19 14:35:44.927693+0800 WebDriverAgentRunner-Runner[722:96732] Enqueue Failure: Hit testing Other, {{0.0, 495.7}, {375.0, 0.3}} at point {187.5, 495.83333333333337} returned (null) which is from the same process but cannot be mapped using AX data: Failed to lookup parent of element StaticText, {{0.0, 428.0}, {375.0, 68.0}}, label: '微信团队,1个未读消息,上午9:52,安全登录提醒': Timeout waiting for fulfillment of promise for 'Fetching attributes 'XC_kAXXCAttributeParent' for AX element pid: 726, elementOrHash.elementID: 10779143296.81'. /Users/icos/sandbox/WebDriverAgent/WebDriverAgentRunner/UITestingUITests.m 37 1 t = 307.84s Snapshot accessibility hierarchy for app with pid 726 2018-09-19 14:35:45.111798+0800 WebDriverAgentRunner-Runner[722:97516] [general] Exception caught during decoding of received reply to message '_XCT_fetchAttributes:forElement:reply:', dropping incoming message and calling failure block.

Exception: Exception while decoding argument 0 (#1 of invocation): <NSInvocation: 0x283fd06c0> return value: {v} void target: {@?} 0x0 (block) argument 1: {@} 0x0 argument 2: {@} 0x0

Exception: value for key 'NS.objects' was of unexpected class 'XCAccessibilityElement'. Allowed classes are '{( NSNumber, NSData, NSDate, NSOrderedSet, NSSet, NSString, NSNull, NSArray, NSDictionary )}'. 2018-09-19 14:36:50.119212+0800 WebDriverAgentRunner-Runner[722:96732] Enqueue Failure: Hit testing Other, {{0.0, 496.0}, {375.0, 883.0}} at point {187.5, 654} returned (null) which is from the same process but cannot be mapped using AX data: Failed to lookup parent of element Other, {{0.0, 0.0}, {375.0, 812.0}}: Timeout waiting for fulfillment of promise for 'Fetching attributes 'XC_kAXXCAttributeParent' for AX element pid: 726, elementOrHash.elementID: 4468247600.89'. /Users/icos/sandbox/WebDriverAgent/WebDriverAgentRunner/UITestingUITests.m 37 1 t = 372.99s Snapshot accessibility hierarchy for app with pid 726 2018-09-19 14:36:50.273608+0800 WebDriverAgentRunner-Runner[722:97739] [general] Exception caught during decoding of received reply to message '_XCT_fetchAttributes:forElement:reply:', dropping incoming message and calling failure block.

Exception: Exception while decoding argument 0 (#1 of invocation): <NSInvocation: 0x283fd5780> return value: {v} void target: {@?} 0x0 (block) argument 1: {@} 0x0 argument 2: {@} 0x0

Exception: value for key 'NS.objects' was of unexpected class 'XCAccessibilityElement'. Allowed classes are '{( NSNumber, NSData, NSDate, NSOrderedSet, NSSet, NSString, NSNull, NSArray, NSDictionary )}'. 2018-09-19 14:37:55.283119+0800 WebDriverAgentRunner-Runner[722:96732] Enqueue Failure: Hit testing Other, {{0.0, 495.5}, {375.0, 0.5}} at point {187.5, 495.75} returned (null) which is from the same process but cannot be mapped using AX data: Failed to lookup parent of element StaticText, {{0.0, 428.0}, {375.0, 68.0}}, label: '微信团队,1个未读消息,上午9:52,安全登录提醒': Timeout waiting for fulfillment of promise for 'Fetching attributes 'XC_kAXXCAttributeParent' for AX element pid: 726, elementOrHash.elementID: 10779143296.81'. /Users/icos/sandbox/WebDriverAgent/WebDriverAgentRunner/UITestingUITests.m 37 1 t = 438.88s Find the Application 'com.tencent.xin' t = 438.88s Snapshot accessibility hierarchy for app with pid 726 t = 439.04s Find the Application 'com.tencent.xin' t = 439.04s Snapshot accessibility hierarchy for app with pid 726 t = 439.10s Snapshot accessibility hierarchy for app with pid 726 t = 439.40s Snapshot accessibility hierarchy for app with pid 726 2018-09-19 14:37:56.648762+0800 WebDriverAgentRunner-Runner[722:97907] [general] Exception caught during decoding of received reply to message '_XCT_fetchAttributes:forElement:reply:', dropping incoming message and calling failure block.

Exception: Exception while decoding argument 0 (#1 of invocation): <NSInvocation: 0x283e7cb00> return value: {v} void target: {@?} 0x0 (block) argument 1: {@} 0x0 argument 2: {@} 0x0

Exception: value for key 'NS.objects' was of unexpected class 'XCAccessibilityElement'. Allowed classes are '{( NSNumber, NSData, NSDate, NSOrderedSet, NSSet, NSString, NSNull, NSArray, NSDictionary )}'. 2018-09-19 14:39:01.653504+0800 WebDriverAgentRunner-Runner[722:96732] Enqueue Failure: Hit testing Cell, {{0.0, 88.0}, {375.0, 68.0}}, label: 'pingcezu33,上午9:53,' at point {187.5, 122} returned (null) which is from the same process but cannot be mapped using AX data: Failed to lookup parent of element StaticText, {{0.0, 88.0}, {375.0, 68.0}}, label: 'pingcezu33,上午9:53,': Timeout waiting for fulfillment of promise for 'Fetching attributes 'XC_kAXXCAttributeParent' for AX element pid: 726, elementOrHash.elementID: 10779206080.43'. /Users/icos/sandbox/WebDriverAgent/WebDriverAgentRunner/UITestingUITests.m 37 1 t = 504.56s Snapshot accessibility hierarchy for app with pid 726 2018-09-19 14:39:01.818803+0800 WebDriverAgentRunner-Runner[722:97911] [general] Exception caught during decoding of received reply to message '_XCT_fetchAttributes:forElement:reply:', dropping incoming message and calling failure block.

Exception: Exception while decoding argument 0 (#1 of invocation): <NSInvocation: 0x283e62ec0> return value: {v} void target: {@?} 0x0 (block) argument 1: {@} 0x0 argument 2: {@} 0x0

Exception: value for key 'NS.objects' was of unexpected class 'XCAccessibilityElement'. Allowed classes are '{( NSNumber, NSData, NSDate, NSOrderedSet, NSSet, NSString, NSNull, NSArray, NSDictionary )}'.

SomeOneTY commented 5 years ago

xcode10.0 + iOS 11.4 i get the same issue.

lvxy-git commented 5 years ago

same for xcode10.0 +iOS 12.0

marekcirkos commented 5 years ago

Yeah I have seen this issue on Xcode 10 as well, unfortunately I didn't have much time to investigate. It looks like bug on Apple's side as they send unexpected object via XPC.

mykola-mokhnach commented 5 years ago

@marekcirkos I think this exception happens inside hitTest verification of XCElementSnapshot instance (used for visibility detection) for Xcode10 SDK. Thus we've replaced hitTest with lower lever primitives recently: https://github.com/appium/WebDriverAgent/commit/7fc54afc858c94b061d5983cbef02aca92c0a933

marekcirkos commented 5 years ago

You can see that error also on few of ours integrations tests. So it is not super consistent. So you might be right that we need to change the visibility logic, again :/

wuguifang commented 5 years ago

same for xcode10.0 +iOS 12.0

i am the same

carrypink commented 5 years ago

the same error when use

iproxy 8100 8100
http://localhost:8100/inspector
jineshqa commented 5 years ago

Bump...this is like a blocker. Is there a workaround or another branch that has the fix?

I found the workaround. Use appium's fork of the repo for now.

lvxy-git commented 5 years ago

Bump...this is like a blocker. Is there a workaround or another branch that has the fix?

I found the workaround. Use appium's fork of the repo for now.

hi, refresh screen is enable with using fork of the repo? can u tell more detail of operation?

jineshqa commented 5 years ago

@lyuxy could you elaborate?

lvxy-git commented 5 years ago

@jineshqa i meet same problem with refreshing . You said you fix it by using appium's fork of the repo. just fork appium to your repository and clone it ?

jineshqa commented 5 years ago

Appium has a fork of WDA repo. I used that.

lvxy-git commented 5 years ago

@jineshqa How long does refresh screen takes? i always spend 5-10 min to refresh my screen

jineshqa commented 5 years ago

@lyuxy about couple of minutes or less

jineshqa commented 5 years ago

@jineshqa How long does refresh screen takes? i always spend 5-10 min to refresh my screen

@Lyuxy Did it work for you?

jineshqa commented 5 years ago

@marekcirkos Has this come up in triage or to be dealt with later?

canberksevdeger commented 5 years ago

@jineshqa i try to use appium's fork for wda but i still can not get the page source.

[debug] [JSONWP Proxy] Got response with status 200: "{\n \"value\" : \"Cannot get 'xml' source of the current application\",\n \"sessionId\" : \"08A9E14A-9E05-4CFC-893E-9FD309C5043A\",\n \"status\" : 13\n}" [debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError [debug] [W3C] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot get 'xml' source of the current application [debug] [W3C] at errorFromMJSONWPStatusCode (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:789:10) [debug] [W3C] at ProxyRequestError.getActualError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:683:14) [debug] [W3C] at JWProxy.command$ (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:236:19) [debug] [W3C] at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40) [debug] [W3C] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22) [debug] [W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21) [debug] [W3C] at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37) [debug] [XCUITest] Connection to WDA timed out [debug] [iProxy] recv failed: Operation not permitted [BaseDriver] Shutting down because we waited 300 seconds for a command [debug] [XCUITest] Not clearing log files. Use clearSystemFiles capability to turn on. [debug] [iOSLog] Stopping iOS log capture [Appium] Closing session, cause was 'New Command Timeout of 300 seconds expired. Try customizing the timeout using the 'newCommandTimeout' desired capability' [Appium] Removing session 7a950e30-c591-404b-8972-7ef79ed67675 from our master session list

jineshqa commented 5 years ago

@canberksevdeger Could you please list all the steps you followed? I see some appium logs here and I am not using appium at all. My issue was with WDA itself not working.

ankit9289 commented 5 years ago

@jineshqa Can u please elaborate the steps what did u do to use fork of appium repo

canberksevdeger commented 5 years ago

@jineshqa I start like this;

after all this steps i just run my mobile test (java-appium) and try to get page source.

jineshqa commented 5 years ago

@jineshqa I start like this;

  • install npm with brew
  • install appium with npm
  • install carthage with brew
  • i add some paths to my .bash_profile like JAVA_HOME, ANDROID_HOME etc
  • cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/
  • open WebDriverAgent.xcodeproj with xcode and arrange auto signing with my apple account
  • mkdir -p Resources/WebDriverAgent.bundle
  • ./Scripts/bootstrap.sh -d
  • xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=MYUID' test

after all this steps i just run my mobile test (java-appium) and try to get page source.

@canberksevdeger I do not use appium for automation, I use XCUITest. Only use of WDA for me is to get proper locator of the elements on the screen. So I just forked appium's WDA repo and lauched it as per wiki.

CC: @ankit9289 Let me know if this does not answer your questions and also what are you trying to achieve?

jineshqa commented 5 years ago

Here are the steps that I followed, again I use WDA only for getting locators and not as a part of my project.

Paste below commands on terminal one by one: git clone https://github.com/appium/WebDriverAgent cd WebDriverAgent sh ./Scripts/bootstrap.sh xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'platform=iOS Simulator,name=iPhone X' test

notihs commented 5 years ago

Related #1013