appium / appium

Cross-platform automation framework for all kinds of apps, built on top of the W3C WebDriver protocol
http://appium.io/
Apache License 2.0
18.84k stars 6.08k forks source link

[IOS] After test fail on real device , Appium is throwing error. On simulator it works fine and continues testing #15199

Closed levank707 closed 3 years ago

levank707 commented 3 years ago

The problem

Environment

Details

If necessary, describe the problem you have been experiencing in more detail.

Link to Appium logs

https://gist.github.com/levank707/33ee1accbb66ba5f96796587c89ddb1c

levank707 commented 3 years ago

XCUIScreen screenshotDataForQuality:rect:error:]: unrecognized selector sent to instance 0x280219140 --- this is error

mykola-mokhnach commented 3 years ago

This is fixed in appium@beta

levank707 commented 3 years ago

This is fixed in appium@beta

I tried, first npm uninstall -g appium than npm install -g appium@beta. but it is throwing same error

levanikhvedelidze commented 3 years ago

This is fixed in appium@beta

I tried, first npm uninstall -g appium then npm install -g appium@beta. but it is throwing same error

mykola-mokhnach commented 3 years ago

Make sure you don't have any WebDriverAgent leftovers on the device and in the derived data folder

levanikhvedelidze commented 3 years ago

Make sure you don't have any WebDriverAgent leftovers on the device and in the derived data folder

you mean to clean derived data folder ?

mykola-mokhnach commented 3 years ago

yes. By default Appium cashes WDA runner on the device, so it makes sense to make sure there are no leftovers after server upgrade

levanikhvedelidze commented 3 years ago

yes. By default Appium cashes WDA runner on the device, so it makes sense to make sure there are no leftovers after server upgrade

I did that but now it is not installing WDA runner on the real device (on simulator yes) bruhhh

levanikhvedelidze commented 3 years ago

Command CodeSign failed with a nonzero exit code WebDriverAgentRunner: WebDriverAgentRunner-Runner encountered an error (Failed to install or launch the test runner. If you believe this error represents a bug, please attach the result bundle at /Users/macintosh/Library/Developer/Xcode/DerivedData/WebDriverAgent-fxmsedpwfaalxlbcwefbceeuodem/Logs/Test/Test-WebDriverAgentRunner-2021.03.19_00-20-00-+0400.xcresult. (Underlying Error: Executable Not Found. /Users/macintosh/Library/Developer/Xcode/DerivedData/WebDriverAgent-fxmsedpwfaalxlbcwefbceeuodem/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app is not a valid path to an executable file. Please rebuild the project to ensure that all required executables are created. Check your project settings to ensure that a valid executable will be built.))

levanikhvedelidze commented 3 years ago

I fixed below error but , still XCUIScreen screenshotDataForQuality:rect:error:]: unrecognized selector sent to instance 0x280219140 is appearing

rakurati7 commented 3 years ago

I tried using latest Appium Beta 1.21.0 beta.0 on Xcode 12.5

Issue still exist - logs

mykola-mokhnach commented 3 years ago

Issue still exist - logs

this is an issue - Apple has changed their private interfaces :(

mykola-mokhnach commented 3 years ago

@rakurati7 The fix has been pushed to appium@beta. Please try if it works for you

levank707 commented 3 years ago

The fix has been pushed to appium@beta. Please try if it works for you

there is same error for me :(

KazuCocoa commented 3 years ago

Was the WDA 3.5.0? (I wondered the previous one remained)

mykola-mokhnach commented 3 years ago

Closed because of no response

rakurati7 commented 3 years ago

@rakurati7 The fix has been pushed to appium@beta. Please try if it works for you

@mykola-mokhnach, apologies for not responding back immediately.

Yes I did tried in Appium latest beta 1.21.0 beta.0 and it works fine (Screenshot appears fine in appium desktop)

udaykittu commented 3 years ago

@mykola-mokhnach , Issue Still seen on 1.21.0-beta.0 version of appium

Restarted the machine, Deleted webdriveragent from ios devices, restarted devices and started execution

Xcode 12.4 Mac OS - Big Sur

Appium Logs https://gist.github.com/udaykittu/396c1b07d9813457ba53edebbf5afe2a

mykola-mokhnach commented 3 years ago

Something seems to be wrong with your deployment. Make sure the version of appium-webdriveragent component is at 3.7.1 +

udaykittu commented 3 years ago

"name": "appium-webdriveragent", "version": "3.7.1",

Checked the WDA version

its 3.7.1

KazuCocoa commented 3 years ago

What about removing /Users/udaykumarraju.s/Library/Developer/Xcode/DerivedData/ (xcodebuild's cache) once?

udaykittu commented 3 years ago

@KazuCocoa yes i have tried the same as well

KazuCocoa commented 3 years ago

Then, could you clone https://github.com/appium/WebDriverAgent on your local, run it on your machine, and open http://<your device IP>:<running port>/screenshot on your browser? Then, the browser prints the response. The body should have base64 screenshot data if it worked. e.g. https://github.com/appium/appium/issues/15244#issuecomment-812356974

If you could see something error on the browser, can you create a new issue? Probably your issue is different which we've seen then.

udaykittu commented 3 years ago

@KazuCocoa , Tried the above by creating a session manually using curl commands on the Testing app

Verified the screenshot response in the the url http://192.168.0.159:8100/session/7A1CE80A-BDA9-4953-A0A8-AE3EE9C3276A/screenshot

base64 is not found

tried with http://192.168.0.159:8100/screenshot as well

Started WebDriver Agent with below command

xcodebuild build-for-testing test-without-building -project /Users/udaykumarraju.s/Downloads/WebDriverAgent-master/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/udaykumarraju.s/Library/Developer/Xcode/DerivedData/WebDriverAgent-frfvpprtwztsdobbyagqynipceic -destination id=00008020-001A55192113802E IPHONEOS_DEPLOYMENT_TARGET=13.0 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO

Session initiated on the testing app using below

curl -i -X POST -H 'Content-Type: application/json' -d ' {"capabilities":{"firstMatch":[{"bundleId":"com.apple.store.Jolly","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true}],"alwaysMatch":{}}}' http://192.168.0.159:8100/session

Response from Screenshot url in the browser - from gist files

https://gist.github.com/udaykittu/d5b48ed39056497a1ddc97503788f197

KazuCocoa commented 3 years ago

Thanks. Then, your issue is not in screenshot. Could you create a new issue? Then, please add the full appium log with showIOSLog: true and showXcodeLog: true to see the detail

stefanisin commented 3 years ago

Hello, I have the same error, I installed xcode 12.5, iphone is updated to IOS 14.5. I installed appium version 1.20.2, but I am not able to get Screenshot. I am getting error [XCUIScreen screenshotDataForQuality:rect:error:]

Is there any solution. Thank you very much for answer. Radoslav

KazuCocoa commented 3 years ago

Please try the latest appium@rcor appium@beta out

stefanisin commented 3 years ago

Hello, Thank you very much :-) It works with 1.21.0-rc.4 version I installed appium@rc version by command npm install -g apppium@rc

Radoslav

ashish3090 commented 3 years ago

Hi @KazuCocoa @mykola-mokhnach I have the same error, I installed xcode Version 12.5 (12E262), iphone11 Pro Max version is iOS 14.4.2, Appium desktop version is v1.20.2 I've also installed appium version 1.21.0-rc.4, using npm install -g apppium@rc I've also removed the cache from : /Users/tomebhis/Library/Developer/Xcode/DerivedData/

Still, I am getting error [XCUIScreen screenshotDataForQuality:rect:error:] when I start the appium inspector. But executing tests are working fine on the same device.

Appreciate your help.

Ashish

stefanisin commented 3 years ago

Hello,

Desktop appium and console appium is two different project. When you use appium desktop version, the you use webdriveragent project on location /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent

but console appium version is located on /usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent.

You installed latest version of console appium version, but desktop version is still the old version1.20.2. You can add these capabilities to appium inspector "agentPath": "/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj", "bootStrapPath": "/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent",

what means that appium desktop will be use webdriveragent project from console version, but I don't know if this is solve your problem, because you still use old version of appium desktop.

Radoslav

ashish3090 commented 3 years ago

Hi @stefanisin

I agree with what you're saying. Appium desktop is still an old version comparing to console appium. Though, I've downloaded the pre - release Appium Desktop from --> https://github.com/appium/appium-desktop/releases/tag/v1.20.2-4

Well, thanks for the help. Your trick worked for me and can use appium desktop inspector session.

Hope in the next release of Appium Desktop, will solve the XCUIScreen screenshotDataForQuality:rect:error.

KazuCocoa commented 3 years ago

AD also provides a way to connect to local appium server (most use case is to connect to the latest but not in AD version or beta appium) as https://github.com/appium/appium-desktop#connect-to-local-appium-server

ashish3090 commented 3 years ago

@KazuCocoa tried the way mentioned in above link. Worked well too. Thanks

alexshim11 commented 3 years ago

Hello,

Desktop appium and console appium is two different project. When you use appium desktop version, the you use webdriveragent project on location /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent

but console appium version is located on /usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent.

You installed latest version of console appium version, but desktop version is still the old version1.20.2. You can add these capabilities to appium inspector "agentPath": "/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj", "bootStrapPath": "/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent",

what means that appium desktop will be use webdriveragent project from console version, but I don't know if this is solve your problem, because you still use old version of appium desktop.

Radoslav

i did all steps which helps @ashish3090, but I still can't receive a correct response

Got response with status 500: {"value":{"error":"unknown error","message":"-[XCUIScreen screenshotDataForQuality:rect:error:]: unrecognized selector sent to instance

Appium desktop 1.20.2-4 xcode 14.5 appium console version 1.21.0-rc.4, using npm install -g apppium@rc

Please, help to resolve it

Thanks in advance

stefanisin commented 3 years ago

AD also provides a way to connect to local appium server (most use case is to connect to the latest but not in AD version or beta appium) as https://github.com/appium/appium-desktop#connect-to-local-appium-server

@KazuCocoa - I didn't know that Appium desktop can connect to existing session created by console appium session. Thank you for this information

sonichanchal commented 3 years ago

Hey @KazuCocoa , I am not sure, I had reinstalled the WebDriverRunner with new Xcode 12.5

Also, downloaded the new Appium 21. Still its showing the same issue.

This is my screenshot code. And not sure why Cucumber report is also not generating, its showing with blank page. final byte[] screenshot = ((TakesScreenshot) driver) .getScreenshotAs(OutputType.BYTES);

           System.out.println(Myscenario);

           Myscenario.attach(screenshot, "image/png", "failedCase");

Can you just mentioned, whatever resolutions is possible, will try that out.

sonichanchal commented 3 years ago

@KazuCocoa , these are the initial logs..

This is the [W3C] Calling AppiumDriver.createSession() with args: [{"platformVersion":"14.5.1","xcodeOrgId":"schanchal852@alivecor.com","automationName":"XCUITest","bundleId":"com.alivecor.professional.aliveecg.daily","derivedDataPath":"/Users/schanchal852/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu","platformName":"IOS","udid":"c2c7d8234a9064832a7e45118f5ee18de6f512c6","deviceName":"iPhone","xcodeSigningId":"iPhone_Developer"},null,{"firstMatch":[{"appium:automationName":"XCUITest","appium:bundleId":"com.alivecor.professional.aliveecg.daily","derivedDataPath":"/Users/schanchal852/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu","appium:deviceName":"iPhone","platformName":"ios","appium:platformVersion":"14.5.1","appium:udid":"c2c7d8234a9064832a7e45118f5ee18de6f512c6","appium:xcodeOrgId":"schanchal852@alivecor.com","appium:xcodeSigningId":"iPhone_Developer"}]}] [BaseDriver] Event 'newSessionRequested' logged at 1621614479937 (21:57:59 GMT+0530 (India Standard Time)) [BaseDriver] The following capabilities are not standard capabilities and should have an extension prefix: [BaseDriver] derivedDataPath [Appium] Appium v1.21.0 creating new XCUITestDriver (v3.43.0) session [Appium] Applying relaxed security to 'XCUITestDriver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided [BaseDriver] Creating session with W3C capabilities: { [BaseDriver] "alwaysMatch": { [BaseDriver] "appium:derivedDataPath": "/Users/schanchal852/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu", [BaseDriver] "platformName": "ios", [BaseDriver] "appium:automationName": "XCUITest", [BaseDriver] "appium:bundleId": "com.alivecor.professional.aliveecg.daily", [BaseDriver] "appium:deviceName": "iPhone", [BaseDriver] "appium:platformVersion": "14.5.1", [BaseDriver] "appium:udid": "c2c7d8234a9064832a7e45118f5ee18de6f512c6", [BaseDriver] "appium:xcodeOrgId": "schanchal852@alivecor.com", [BaseDriver] "appium:xcodeSigningId": "iPhone_Developer" [BaseDriver] }, [BaseDriver] "firstMatch": [ [BaseDriver] {} [BaseDriver] ] [BaseDriver] } [BaseDriver] Session created with session id: 4854ce90-090a-4df7-8ebf-5a746b5d6bdc [XCUITest] Current user: 'SChanchal852' [XCUITest] Available devices: c2c7d8234a9064832a7e45118f5ee18de6f512c6 [XCUITest] Creating iDevice object with udid 'c2c7d8234a9064832a7e45118f5ee18de6f512c6' [XCUITest] Determining device to run tests on: udid: 'c2c7d8234a9064832a7e45118f5ee18de6f512c6', real device: true [XCUITest] Normalized platformVersion capability value '14.5.1' to '14.5' [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1621614480937 (21:58:00 GMT+0530 (India Standard Time)) [BaseDriver] Event 'appConfigured' logged at 1621614480938 (21:58:00 GMT+0530 (India Standard Time)) [BaseDriver] Event 'resetStarted' logged at 1621614480938 (21:58:00 GMT+0530 (India Standard Time)) [XCUITest] Reset: running ios real device reset flow [BaseDriver] Event 'resetComplete' logged at 1621614480938 (21:58:00 GMT+0530 (India Standard Time)) [WebDriverAgent] Using WDA path: '/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent' [WebDriverAgent] Using WDA agent: '/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj' [XCUITest] Crash reports root '/Users/SChanchal852/Library/Logs/CrashReporter/MobileDevice/iPhone' does not exist. Got nothing to gather. [BaseDriver] Event 'logCaptureStarted' logged at 1621614481170 (21:58:01 GMT+0530 (India Standard Time)) [XCUITest] Setting up real device [WebDriverAgent] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found [DevCon Factory] Requesting connection for device c2c7d8234a9064832a7e45118f5ee18de6f512c6 on local port 8100, device port 8100 [DevCon Factory] Cached connections count: 0 [DevCon Factory] Successfully requested the connection for c2c7d8234a9064832a7e45118f5ee18de6f512c6:8100 [XCUITest] Starting WebDriverAgent initialization with the synchronization key 'XCUITestDriver' [WD Proxy] Matched '/status' to command name 'getStatus' [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body [WD Proxy] Got response with status 200: {"value":{"message":"WebDriverAgent is ready to accept commands","state":"success","os":{"testmanagerdVersion":28,"name":"iOS","sdkVersion":"14.5","version":"14.5.1"},"ios":{"ip":"192.168.0.114"},"ready":true,"build":{"upgradedAt":"1620631774000","time":"May 20 2021 14:39:07","productBundleIdentifier":"com.facebook.WebDriverAgentRunner"}},"sessionId":"734FD5C7-4709-41AA-8D78-882C8E93EB2A"} [WebDriverAgent] Upgrade timestamp of the currently bundled WDA: 1620631774000 [WebDriverAgent] Upgrade timestamp of the WDA on the device: 1620631774000 [WebDriverAgent] Will reuse previously cached WDA instance at 'http://127.0.0.1:8100/' with 'com.facebook.WebDriverAgentRunner'. Set the wdaLocalPort capability to a value different from 8100 if this is an undesired behavior. [XCUITest] Trying to start WebDriverAgent 1 times with 10000ms interval [XCUITest] These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities [BaseDriver] Event 'wdaStartAttempted' logged at 1621614481510 (21:58:01 GMT+0530 (India Standard Time)) [WebDriverAgent] Using provided WebdriverAgent at 'http://127.0.0.1:8100/' [WD Proxy] Matched '/status' to command name 'getStatus' [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body [WD Proxy] Got response with status 200: {"value":{"message":"WebDriverAgent is ready to accept commands","state":"success","os":{"testmanagerdVersion":28,"name":"iOS","sdkVersion":"14.5","version":"14.5.1"},"ios":{"ip":"192.168.0.114"},"ready":true,"build":{"upgradedAt":"1620631774000","time":"May 20 2021 14:39:07","productBundleIdentifier":"com.facebook.WebDriverAgentRunner"}},"sessionId":"734FD5C7-4709-41AA-8D78-882C8E93EB2A"} [BaseDriver] Event 'wdaSessionAttempted' logged at 1621614481519 (21:58:01 GMT+0530 (India Standard Time)) [XCUITest] Sending createSession command to WDA [WD Proxy] Matched '/session' to command name 'createSession' [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8100/session] with body: {"capabilities":{"firstMatch":[{"bundleId":"com.alivecor.professional.aliveecg.daily","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"shouldTerminateApp":true}],"alwaysMatch":{}}} [WD Proxy] Got response with status 200: {"value":{"sessionId":"DDC81421-A6F2-42B4-AC54-5E209E3079CB","capabilities":{"device":"iphone","browserName":"Kardia Daily","sdkVersion":"14.5.1","CFBundleIdentifier":"com.alivecor.professional.aliveecg.daily"}},"sessionId":"DDC81421-A6F2-42B4-AC54-5E209E3079CB"} [WD Proxy] Determined the downstream protocol as 'W3C' [BaseDriver] Event 'wdaSessionStarted' logged at 1621614485264 (21:58:05 GMT+0530 (India Standard Time)) [BaseDriver] Event 'wdaStarted' logged at 1621614485265 (21:58:05 GMT+0530 (India Standard Time)) [XCUITest] Skipping setting of the initial display orientation. Set the "orientation" capability to either "LANDSCAPE" or "PORTRAIT", if this is an undesired behavior. [BaseDriver] Event 'orientationSet' logged at 1621614485265 (21:58:05 GMT+0530 (India Standard Time)) [BaseDriver] The value of 'elementResponseAttributes' setting did not change. Skipping the update for it [BaseDriver] The value of 'shouldUseCompactResponses' setting did not change. Skipping the update for it [Appium] New XCUITestDriver session created successfully, session 4854ce90-090a-4df7-8ebf-5a746b5d6bdc added to master session list [BaseDriver] Event 'newSessionStarted' logged at 1621614485266 (21:58:05 GMT+0530 (India Standard Time)) [W3C (4854ce90)] Cached the protocol value 'W3C' for the new session 4854ce90-090a-4df7-8ebf-5a746b5d6bdc [W3C (4854ce90)] Responding to client with driver.createSession() result: {"capabilities":{"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"platformName":"ios","derivedDataPath":"/Users/schanchal852/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu","automationName":"XCUITest","bundleId":"com.alivecor.professional.aliveecg.daily","deviceName":"iPhone","platformVersion":"14.5.1","udid":"c2c7d8234a9064832a7e45118f5ee18de6f512c6","xcodeOrgId":"schanchal852@alivecor.com","xcodeSigningId":"iPhone_Developer"}} [HTTP] <-- POST /wd/hub/session 200 5332 ms - 674 [HTTP] [HTTP] --> POST /wd/hub/session/4854ce90-090a-4df7-8ebf-5a746b5d6bdc/timeouts [HTTP] {"implicit":10000} [W3C (4854ce90)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,10000,"4854ce90-090a-4df7-8ebf-5a746b5d6bdc"] [XCUITest] Executing command 'timeouts' [BaseDriver] W3C timeout argument: {"implicit":10000}} [BaseDriver] Set implicit wait to 10000ms [W3C (4854ce90)] Responding to client with driver.timeouts() result: null [HTTP] <-- POST /wd/hub/session/4854ce90-090a-4df7-8ebf-5a746b5d6bdc/timeouts 200 2 ms - 14 [HTTP] [HTTP] --> GET /wd/hub/session/4854ce90-090a-4df7-8ebf-5a746b5d6bdc/context [HTTP] {} [W3C (4854ce90)] Calling AppiumDriver.getCurrentContext() with args: ["4854ce90-090a-4df7-8ebf-5a746b5d6bdc"] [XCUITest] Executing command 'getCurrentContext' [W3C (4854ce90)] Responding to client with driver.getCurrentContext() result: "NATIVE_APP" [HTTP] <-- GET /wd/hub/session/4854ce90-090a-4df7-8ebf-5a746b5d6bdc/context 200 4 ms - 22 [HTTP] [HTTP] --> POST /wd/hub/session/4854ce90-090a-4df7-8ebf-5a746b5d6bdc/element [HTTP] {"using":"xpath","value":"//XCUIElementTypeButton[@name=\"LOG IN\"]"} [W3C (4854ce90)] Calling AppiumDriver.findElement() with args: ["xpath","//XCUIElementTypeButton[@name=\"LOG IN\"]","4854ce90-090a-4df7-8ebf-5a746b5d6bdc"] [XCUITest] Executing command 'findElement' [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector [BaseDriver] Waiting up to 10000 ms for condition [WD Proxy] Matched '/element' to command name 'findElement' [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8100/session/DDC81421-A6F2-42B4-AC54-5E209E3079CB/element] with body: {"using":"xpath","value":"//XCUIElementTypeButton[@name=\"LOG IN\"]"} [WD Proxy] Got response with status 404: {"value":{"error":"no such element","message":"unable to find an element using 'xpath', value '//XCUIElementTypeButton[@name=\"LOG IN\"]'","traceback":"(\n\t0 WebDriverAgentLib 0x0000000104e59190 FBNoSuchElementErrorResponseForRequest + 312\n\t1 WebDriverAgentLib 0x0000000104e58f6c +[FBFindElementCommands handleFindElement:] + 352\n\t2 WebDriverAgentLib 0x0000000104e1e4a0 -[FBRoute_TargetAction mountRequest:intoResponse:] + 196\n\t3 WebDriverAgentLib 0x0000000104dff460 37-[FBWebServer registerRouteHandlers:]_block_invoke + 448\n\t4 WebDriverAgentLib 0x0000000104e3fe64 -[RoutingHTTPServer handleRoute:withRequest:response:] + 160\n\t5 WebDriverAgentLib 0x0000000104e408b0 72-[RoutingHTTPServer routeMethod:withPath:parameters:request:connection:]_block_invoke + 68\n\t6 libdispatch.dylib 0x0000000191f57298 16C9F613-7AE3-32CE-BA3A-B0DCF0464F0E + 397976\n\t7 libdispatch... [W3C] Matched W3C error code 'no such element' to NoSuchElementError [BaseDriver] Waited for 1040 ms so far [WD Proxy] Matched '/element' to command name 'findElement' [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8100/session/DDC81421-A6F2-42B4-AC54-5E209E3079CB/element] with body: {"using":"xpath","value":"//XCUIElementTypeButton[@name=\"LOG IN\"]"} [WD Proxy] Got response with status 404: {"value":{"error":"no such element","message":"unable to find an element using 'xpath', value '//XCUIElementTypeButton[@name=\"LOG IN\"]'","traceback":"(\n\t0 WebDriverAgentLib 0x0000000104e59190 FBNoSuchElementErrorResponseForRequest + 312\n\t1 WebDriverAgentLib 0x0000000104e58f6c +[FBFindElementCommands handleFindElement:] + 352\n\t2 WebDriverAgentLib 0x0000000104e1e4a0 -[FBRoute_TargetAction mountRequest:intoResponse:] + 196\n\t3 WebDriverAgentLib 0x0000000104dff460 37-[FBWebServer registerRouteHandlers:]_block_invoke + 448\n\t4 WebDriverAgentLib 0x0000000104e3fe64 -[RoutingHTTPServer handleRoute:withRequest:response:] + 160\n\t5 WebDriverAgentLib 0x0000000104e408b0 72-[RoutingHTTPServer routeMethod:withPath:parameters:request:connection:]_block_invoke + 68\n\t6 libdispatch.dylib 0x0000000191f57298 16C9F613-7AE3-32CE-BA3A-B0DCF0464F0E + 397976\n\t7 libdispatch... [W3C] Matched W3C error code 'no such element' to NoSuchElementError [BaseDriver] Waited for 2030 ms so far [WD Proxy] Matched '/element' to command name 'findElement' [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8100/session/DDC81421-A6F2-42B4-AC54-5E209E3079CB/element] with body: {"using":"xpath","value":"//XCUIElementTypeButton[@name=\"LOG IN\"]"} [WD Proxy] Got response with status 404: {"value":{"error":"no such element","message":"unable to find an element using 'xpath', value '//XCUIElementTypeButton[@name=\"LOG IN\"]'","traceback":"(\n\t0 WebDriverAgentLib 0x0000000104e59190 FBNoSuchElementErrorResponseForRequest + 312\n\t1 WebDriverAgentLib 0x0000000104e58f6c +[FBFindElementCommands handleFindElement:] + 352\n\t2 WebDriverAgentLib 0x0000000104e1e4a0 -[FBRoute_TargetAction mountRequest:intoResponse:] + 196\n\t3 WebDriverAgentLib 0x0000000104dff460 37-[FBWebServer registerRouteHandlers:]_block_invoke + 448\n\t4 WebDriverAgentLib 0x0000000104e3fe64 -[RoutingHTTPServer handleRoute:withRequest:response:] + 160\n\t5 WebDriverAgentLib 0x0000000104e408b0 72-[RoutingHTTPServer routeMethod:withPath:parameters:request:connection:]_block_invoke + 68\n\t6 libdispatch.dylib 0x0000000191f57298 16C9F613-7AE3-32CE-BA3A-B0DCF0464F0E + 397976\n\t7 libdispatch... [W3C] Matched W3C error code 'no such element' to NoSuchElementError [BaseDriver] Waited for 3032 ms so far [WD Proxy] Matched '/element' to command name 'findElement' [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8100/session/DDC81421-A6F2-42B4-AC54-5E209E3079CB/element] with body: {"using":"xpath","value":"//XCUIElementTypeButton[@name=\"LOG IN\"]"} [WD Proxy] Got response with status 404: {"value":{"error":"no such element","message":"unable to find an element using 'xpath', value '//XCUIElementTypeButton[@name=\"LOG IN\"]'","traceback":"(\n\t0 WebDriverAgentLib 0x0000000104e59190 FBNoSuchElementErrorResponseForRequest + 312\n\t1 WebDriverAgentLib 0x0000000104e58f6c +[FBFindElementCommands handleFindElement:] + 352\n\t2 WebDriverAgentLib 0x0000000104e1e4a0 -[FBRoute_TargetAction mountRequest:intoResponse:] + 196\n\t3 WebDriverAgentLib 0x0000000104dff460 37-[FBWebServer registerRouteHandlers:]_block_invoke + 448\n\t4 WebDriverAgentLib 0x0000000104e3fe64 -[RoutingHTTPServer handleRoute:withRequest:response:] + 160\n\t5 WebDriverAgentLib 0x0000000104e408b0 72-[RoutingHTTPServer routeMethod:withPath:parameters:request:connection:]_block_invoke + 68\n\t6 libdispatch.dylib 0x0000000191f57298 16C9F613-7AE3-32CE-BA3A-B0DCF0464F0E + 397976\n\t7 libdispatch... [W3C] Matched W3C error code 'no such element' to NoSuchElementError [BaseDriver] Waited for 4224 ms so far [WD Proxy] Matched '/element' to command name 'findElement' [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8100/session/DDC81421-A6F2-42B4-AC54-5E209E3079CB/element] with body: {"using":"xpath","value":"//XCUIElementTypeButton[@name=\"LOG IN\"]"} [WD Proxy] Got response with status 404: {"value":{"error":"no such element","message":"unable to find an element using 'xpath', value '//XCUIElementTypeButton[@name=\"LOG IN\"]'","traceback":"(\n\t0 WebDriverAgentLib 0x0000000104e59190 FBNoSuchElementErrorResponseForRequest + 312\n\t1 WebDriverAgentLib 0x0000000104e58f6c +[FBFindElementCommands handleFindElement:] + 352\n\t2 WebDriverAgentLib 0x0000000104e1e4a0 -[FBRoute_TargetAction mountRequest:intoResponse:] + 196\n\t3 WebDriverAgentLib 0x0000000104dff460 37-[FBWebServer registerRouteHandlers:]_block_invoke + 448\n\t4 WebDriverAgentLib 0x0000000104e3fe64 -[RoutingHTTPServer handleRoute:withRequest:response:] + 160\n\t5 WebDriverAgentLib 0x0000000104e408b0 72-[RoutingHTTPServer routeMethod:withPath:parameters:request:connection:]_block_invoke + 68\n\t6 libdispatch.dylib 0x0000000191f57298 16C9F613-7AE3-32CE-BA3A-B0DCF0464F0E + 397976\n\t7 libdispatch... [W3C] Matched W3C error code 'no such element' to NoSuchElementError [BaseDriver] Waited for 5278 ms so far [WD Proxy] Matched '/element' to command name 'findElement' [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8100/session/DDC81421-A6F2-42B4-AC54-5E209E3079CB/element] with body: {"using":"xpath","value":"//XCUIElementTypeButton[@name=\"LOG IN\"]"} [WD Proxy] Got response with status 404: {"value":{"error":"no such element","message":"unable to find an element using 'xpath', value '//XCUIElementTypeButton[@name=\"LOG IN\"]'","traceback":"(\n\t0 WebDriverAgentLib 0x0000000104e59190 FBNoSuchElementErrorResponseForRequest + 312\n\t1 WebDriverAgentLib 0x0000000104e58f6c +[FBFindElementCommands handleFindElement:] + 352\n\t2 WebDriverAgentLib 0x0000000104e1e4a0 -[FBRoute_TargetAction mountRequest:intoResponse:] + 196\n\t3 WebDriverAgentLib 0x0000000104dff460 37-[FBWebServer registerRouteHandlers:]_block_invoke + 448\n\t4 WebDriverAgentLib 0x0000000104e3fe64 -[RoutingHTTPServer handleRoute:withRequest:response:] + 160\n\t5 WebDriverAgentLib 0x0000000104e408b0 72-[RoutingHTTPServer routeMethod:withPath:parameters:request:connection:]_block_invoke + 68\n\t6 libdispatch.dylib 0x0000000191f57298 16C9F613-7AE3-32CE-BA3A-B0DCF0464F0E + 397976\n\t7 libdispatch... [W3C] Matched W3C error code 'no such element' to NoSuchElementError [BaseDriver] Waited for 6344 ms so far [WD Proxy] Matched '/element' to command name 'findElement' [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8100/session/DDC81421-A6F2-42B4-AC54-5E209E3079CB/element] with body: {"using":"xpath","value":"//XCUIElementTypeButton[@name=\"LOG IN\"]"} [WD Proxy] Got response with status 404: {"value":{"error":"no such element","message":"unable to find an element using 'xpath', value '//XCUIElementTypeButton[@name=\"LOG IN\"]'","traceback":"(\n\t0 WebDriverAgentLib 0x0000000104e59190 FBNoSuchElementErrorResponseForRequest + 312\n\t1 WebDriverAgentLib 0x0000000104e58f6c +[FBFindElementCommands handleFindElement:] + 352\n\t2 WebDriverAgentLib 0x0000000104e1e4a0 -[FBRoute_TargetAction mountRequest:intoResponse:] + 196\n\t3 WebDriverAgentLib 0x0000000104dff460 37-[FBWebServer registerRouteHandlers:]_block_invoke + 448\n\t4 WebDriverAgentLib 0x0000000104e3fe64 -[RoutingHTTPServer handleRoute:withRequest:response:] + 160\n\t5 WebDriverAgentLib 0x0000000104e408b0 72-[RoutingHTTPServer routeMethod:withPath:parameters:request:connection:]_block_invoke + 68\n\t6 libdispatch.dylib 0x0000000191f57298 16C9F613-7AE3-32CE-BA3A-B0DCF0464F0E + 397976\n\t7 libdispatch... [W3C] Matched W3C error code 'no such element' to NoSuchElementError [BaseDriver] Waited for 7432 ms so far [WD Proxy] Matched '/element' to command name 'findElement' [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8100/session/DDC81421-A6F2-42B4-AC54-5E209E3079CB/element] with body: {"using":"xpath","value":"//XCUIElementTypeButton[@name=\"LOG IN\"]"} [WD Proxy] Got response with status 404: {"value":{"error":"no such element","message":"unable to find an element using 'xpath', value '//XCUIElementTypeButton[@name=\"LOG IN\"]'","traceback":"(\n\t0 WebDriverAgentLib 0x0000000104e59190 FBNoSuchElementErrorResponseForRequest + 312\n\t1 WebDriverAgentLib 0x0000000104e58f6c +[FBFindElementCommands handleFindElement:] + 352\n\t2 WebDriverAgentLib 0x0000000104e1e4a0 -[FBRoute_TargetAction mountRequest:intoResponse:] + 196\n\t3 WebDriverAgentLib 0x0000000104dff460 37-[FBWebServer registerRouteHandlers:]_block_invoke + 448\n\t4 WebDriverAgentLib 0x0000000104e3fe64 -[RoutingHTTPServer handleRoute:withRequest:response:] + 160\n\t5 WebDriverAgentLib 0x0000000104e408b0 72-[RoutingHTTPServer routeMethod:withPath:parameters:request:connection:]_block_invoke + 68\n\t6 libdispatch.dylib 0x0000000191f57298 16C9F613-7AE3-32CE-BA3A-B0DCF0464F0E + 397976\n\t7 libdispatch... [W3C] Matched W3C error code 'no such element' to NoSuchElementError [BaseDriver] Waited for 8512 ms so far [WD Proxy] Matched '/element' to command name 'findElement' [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8100/session/DDC81421-A6F2-42B4-AC54-5E209E3079CB/element] with body: {"using":"xpath","value":"//XCUIElementTypeButton[@name=\"LOG IN\"]"} [WD Proxy] Got response with status 404: {"value":{"error":"no such element","message":"unable to find an element using 'xpath', value '//XCUIElementTypeButton[@name=\"LOG IN\"]'","traceback":"(\n\t0 WebDriverAgentLib 0x0000000104e59190 FBNoSuchElementErrorResponseForRequest + 312\n\t1 WebDriverAgentLib 0x0000000104e58f6c +[FBFindElementCommands handleFindElement:] + 352\n\t2 WebDriverAgentLib 0x0000000104e1e4a0 -[FBRoute_TargetAction mountRequest:intoResponse:] + 196\n\t3 WebDriverAgentLib 0x0000000104dff460 37-[FBWebServer registerRouteHandlers:]_block_invoke + 448\n\t4 WebDriverAgentLib 0x0000000104e3fe64 -[RoutingHTTPServer handleRoute:withRequest:response:] + 160\n\t5 WebDriverAgentLib 0x0000000104e408b0 72-[RoutingHTTPServer routeMethod:withPath:parameters:request:connection:]_block_invoke + 68\n\t6 libdispatch.dylib 0x0000000191f57298 16C9F613-7AE3-32CE-BA3A-B0DCF0464F0E + 397976\n\t7 libdispatch... [W3C] Matched W3C error code 'no such element' to NoSuchElementError [BaseDriver] Waited for 9549 ms so far [WD Proxy] Matched '/element' to command name 'findElement' [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8100/session/DDC81421-A6F2-42B4-AC54-5E209E3079CB/element] with body: {"using":"xpath","value":"//XCUIElementTypeButton[@name=\"LOG IN\"]"} [WD Proxy] Got response with status 404: {"value":{"error":"no such element","message":"unable to find an element using 'xpath', value '//XCUIElementTypeButton[@name=\"LOG IN\"]'","traceback":"(\n\t0 WebDriverAgentLib 0x0000000104e59190 FBNoSuchElementErrorResponseForRequest + 312\n\t1 WebDriverAgentLib 0x0000000104e58f6c +[FBFindElementCommands handleFindElement:] + 352\n\t2 WebDriverAgentLib 0x0000000104e1e4a0 -[FBRoute_TargetAction mountRequest:intoResponse:] + 196\n\t3 WebDriverAgentLib 0x0000000104dff460 37-[FBWebServer registerRouteHandlers:]_block_invoke + 448\n\t4 WebDriverAgentLib 0x0000000104e3fe64 -[RoutingHTTPServer handleRoute:withRequest:response:] + 160\n\t5 WebDriverAgentLib 0x0000000104e408b0 72-[RoutingHTTPServer routeMethod:withPath:parameters:request:connection:]_block_invoke + 68\n\t6 libdispatch.dylib 0x0000000191f57298 16C9F613-7AE3-32CE-BA3A-B0DCF0464F0E + 397976\n\t7 libdispatch... [W3C] Matched W3C error code 'no such element' to NoSuchElementError [W3C (4854ce90)] Encountered internal error running command: NoSuchElementError: An element could not be located on the page using the given search parameters. [W3C (4854ce90)] at XCUITestDriver.doNativeFind (/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/lib/commands/find.js:130:11) [W3C (4854ce90)] at runMicrotasks () [W3C (4854ce90)] at processTicksAndRejections (internal/process/task_queues.js:85:5) [HTTP] <-- POST /wd/hub/session/4854ce90-090a-4df7-8ebf-5a746b5d6bdc/element 404 10543 ms - 523 [HTTP] [HTTP] --> GET /wd/hub/session/4854ce90-090a-4df7-8ebf-5a746b5d6bdc/screenshot [HTTP] {} [W3C (4854ce90)] Calling AppiumDriver.getScreenshot() with args: ["4854ce90-090a-4df7-8ebf-5a746b5d6bdc"] [XCUITest] Executing command 'getScreenshot' [XCUITest] Taking screenshot with WDA [WD Proxy] Matched '/screenshot' to command name 'getScreenshot' [WD Proxy] Proxying [GET /screenshot] to [GET http://127.0.0.1:8100/session/DDC81421-A6F2-42B4-AC54-5E209E3079CB/screenshot] with no body [WD Proxy] Got response with status 500: {"value":{"error":"unknown error","message":"-[XCUIScreen screenshotDataForQuality:rect:error:]: unrecognized selector sent to instance 0x283f298c0","traceback":"(\n\t0 CoreFoundation 0x000000019231f13c 373EC2DD-3A29-3E74-B85D-BE4EE925167A + 1159484\n\t1 libobjc.A.dylib 0x00000001a6032480 objc_exception_throw + 56\n\t2 CoreFoundation 0x000000019222e138 373EC2DD-3A29-3E74-B85D-BE4EE925167A + 172344\n\t3 CoreFoundation 0x0000000192321784 373EC2DD-3A29-3E74-B85D-BE4EE925167A + 1169284\n\t4 CoreFoundation 0x00000001923239ac _CF_forwarding_prep_0 + 92\n\t5 WebDriverAgentLib 0x0000000104e501c4 -[XCUIDevice(FBHelpers) fb_rawScreenshotWithQuality:error:] + 156\n\t6 WebDriverAgentLib 0x0000000104e50090 -[XCUIDevice(FBHelpers) fb_screenshotWithError:] + 88\n\t7 WebDriverAgentLib 0x0000000104def104 +[FBScreenshotCommands handleGetScreenshot:] + 1... [W3C] Matched W3C error code 'unknown error' to UnknownError [XCUITest] Error getting screenshot: An unknown server-side error occurred while processing the command. Original error: -[XCUIScreen screenshotDataForQuality:rect:error:]: unrecognized selector sent to instance 0x283f298c0 [XCUITest] Taking screenshot with WDA [WD Proxy] Matched '/screenshot' to command name 'getScreenshot' [WD Proxy] Proxying [GET /screenshot] to [GET http://127.0.0.1:8100/session/DDC81421-A6F2-42B4-AC54-5E209E3079CB/screenshot] with no body [WD Proxy] Got response with status 500: {"value":{"error":"unknown error","message":"-[XCUIScreen screenshotDataForQuality:rect:error:]: unrecognized selector sent to instance 0x283ec3c00","traceback":"(\n\t0 CoreFoundation 0x000000019231f13c 373EC2DD-3A29-3E74-B85D-BE4EE925167A + 1159484\n\t1 libobjc.A.dylib 0x00000001a6032480 objc_exception_throw + 56\n\t2 CoreFoundation 0x000000019222e138 373EC2DD-3A29-3E74-B85D-BE4EE925167A + 172344\n\t3 CoreFoundation 0x0000000192321784 373EC2DD-3A29-3E74-B85D-BE4EE925167A + 1169284\n\t4 CoreFoundation 0x00000001923239ac _CF_forwarding_prep_0 + 92\n\t5 WebDriverAgentLib 0x0000000104e501c4 -[XCUIDevice(FBHelpers) fb_rawScreenshotWithQuality:error:] + 156\n\t6 WebDriverAgentLib 0x0000000104e50090 -[XCUIDevice(FBHelpers) fb_screenshotWithError:] + 88\n\t7 WebDriverAgentLib 0x0000000104def104 +[FBScreenshotCommands handleGetScreenshot:] + 1... [W3C] Matched W3C error code 'unknown error' to UnknownError [XCUITest] Taking screenshot with WDA [WD Proxy] Matched '/screenshot' to command name 'getScreenshot' [WD Proxy] Proxying [GET /screenshot] to [GET http://127.0.0.1:8100/session/DDC81421-A6F2-42B4-AC54-5E209E3079CB/screenshot] with no body [WD Proxy] Got response with status 500: {"value":{"error":"unknown error","message":"-[XCUIScreen screenshotDataForQuality:rect:error:]: unrecognized selector sent to instance 0x283ec1d80","traceback":"(\n\t0 CoreFoundation 0x000000019231f13c 373EC2DD-3A29-3E74-B85D-BE4EE925167A + 1159484\n\t1 libobjc.A.dylib 0x00000001a6032480 objc_exception_throw + 56\n\t2 CoreFoundation 0x000000019222e138 373EC2DD-3A29-3E74-B85D-BE4EE925167A + 172344\n\t3 CoreFoundation 0x0000000192321784 373EC2DD-3A29-3E74-B85D-BE4EE925167A + 1169284\n\t4 CoreFoundation 0x00000001923239ac _CF_forwarding_prep_0 + 92\n\t5 WebDriverAgentLib 0x0000000104e501c4 -[XCUIDevice(FBHelpers) fb_rawScreenshotWithQuality:error:] + 156\n\t6 WebDriverAgentLib 0x0000000104e50090 -[XCUIDevice(FBHelpers) fb_screenshotWithError:] + 88\n\t7 WebDriverAgentLib 0x0000000104def104 +[FBScreenshotCommands handleGetScreenshot:] + 1... [W3C] Matched W3C error code 'unknown error' to UnknownError [W3C (4854ce90)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: -[XCUIScreen screenshotDataForQuality:rect:error:]: unrecognized selector sent to instance 0x283ec1d80 [W3C (4854ce90)] at errorFromW3CJsonCode (/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:780:25) [W3C (4854ce90)] at ProxyRequestError.getActualError (/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:663:14) [W3C (4854ce90)] at JWProxy.command (/Applications/Appium 2.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:272:19) [W3C (4854ce90)] at runMicrotasks () [W3C (4854ce90)] at processTicksAndRejections (internal/process/task_queues.js:85:5) [HTTP] <-- GET /wd/hub/session/4854ce90-090a-4df7-8ebf-5a746b5d6bdc/screenshot 500 1068 ms - 1058 [HTTP] [HTTP] --> GET /wd/hub/session/4854ce90-090a-4df7-8ebf-5a746b5d6bdc/context [HTTP] {} [W3C (4854ce90)] Calling AppiumDriver.getCurrentContext() with args: ["4854ce90-090a-4df7-8ebf-5a746b5d6bdc"] [XCUITest] Executing command 'getCurrentContext' [W3C (4854ce90)] Responding to client with driver.getCurrentContext() result: "NATIVE_APP" [HTTP] <-- GET /wd/hub/session/4854ce90-090a-4df7-8ebf-5a746b5d6bdc/context 200 1 ms - 22 [HTTP] [HTTP] --> POST /wd/hub/session/4854ce90-090a-4df7-8ebf-5a746b5d6bdc/element [HTTP] {"using":"xpath","value":"//XCUIElementTypeStaticText[@name=\"Add a Care Plan Task\"]"} [W3C (4854ce90)] Calling AppiumDriver.findElement() with args: ["xpath","//XCUIElementTypeStaticText[@name=\"Add a Care Plan Task\"]","4854ce90-090a-4df7-8ebf-5a746b5d6bdc"] [XCUITest] Executing command 'findElement' [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector [BaseDriver] Waiting up to 10000 ms for condition [WD Proxy] Matched '/element' to command name 'findElement' [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8100/session/DDC81421-A6F2-42B4-AC54-5E209E3079CB/element] with body: {"using":"xpath","val

sonichanchal commented 3 years ago

@KazuCocoa , this is the screenshot error log: Calling AppiumDriver.getScreenshot() with args: ["4854ce90-090a-4df7-8ebf-5a746b5d6bdc"] [XCUITest] Executing command 'getScreenshot' [XCUITest] Taking screenshot with WDA [WD Proxy] Matched '/screenshot' to command name 'getScreenshot' [WD Proxy] Proxying [GET /screenshot] to [GET http://127.0.0.1:8100/session/DDC81421-A6F2-42B4-AC54-5E209E3079CB/screenshot] with no body [WD Proxy] Got response with status 500: {"value":{"error":"unknown error","message":"-[XCUIScreen screenshotDataForQuality:rect:error:]: unrecognized selector sent to instance 0x28308d900","traceback":"(\n\t0 CoreFoundation 0x000000019231f13c 373EC2DD-3A29-3E74-B85D-BE4EE925167A + 1159484\n\t1 libobjc.A.dylib 0x00000001a6032480 objc_exception_throw + 56\n\t2 CoreFoundation 0x000000019222e138 373EC2DD-3A29-3E74-B85D-BE4EE925167A + 172344\n\t3 CoreFoundation 0x0000000192321784 373EC2DD-3A29-3E74-B85D-BE4EE925167A + 1169284\n\t4 CoreFoundation 0x00000001923239ac _CF_forwarding_prep_0 + 92\n\t5 WebDriverAgentLib 0x0000000104e501c4 -[XCUIDevice(FBHelpers) fb_rawScreenshotWithQuality:error:] + 156\n\t6 WebDriverAgentLib 0x0000000104e50090 -[XCUIDevice(FBHelpers) fb_screenshotWithError:] + 88\n\t7 WebDriverAgentLib 0x0000000104def104 +[FBScreenshotCommands handleGetScreenshot:] + 1... [W3C] Matched W3C error code 'unknown error' to UnknownError [XCUITest] Error getting screenshot: An unknown server-side error occurred while processing the command. Original error: -[XCUIScreen screenshotDataForQuality:rect:error:]: unrecognized selector sent to instance 0x28308d900 [XCUITest] Taking screenshot with WDA

IlyassABALI commented 3 years ago

I have reseolved this problem by desintalling appium using npm and installing appium@beta using npm.

sonichanchal commented 3 years ago

@KazuCocoa, how to resolve the previously used WDA Instance cache

[WebDriverAgent] Upgrade timestamp of the WDA on the device: 1620631774000 [WebDriverAgent] Will reuse previously cached WDA instance at 'http://127.0.0.1:8100/' with. - how to remove the cached WDA.

sonichanchal commented 3 years ago

I have reseolved this problem by desintalling appium using npm and installing appium@beta using npm.

Okay, i downloaded the latest appium just now, 1.21.0, m not sure any beta version is available, can u help me with below question: - How to resolve cached WDA [WebDriverAgent] Upgrade timestamp of the WDA on the device: 1620631774000 [WebDriverAgent] Will reuse previously cached WDA instance at 'http://127.0.0.1:8100

IlyassABALI commented 3 years ago

I used these commands to download it :

When I want to inspect elements I launch Appium on my terminal. Let me know if I can help

sonichanchal commented 3 years ago

I used these commands to download it :

  • npm uninstall -g appium : To uninstall the last version
  • npm install -g appium@beta

When I want to inspect elements I launch Appium on my terminal. Let me know if I can help

Thankyou I did the same thing just now, still i m getting the issue.

Got response with status 500: {"value":{"error":"unknown error","message":"-[XCUIScreen screenshotDataForQuality:rect:error:]: unrecognized selector sent to instance 0x283a9ca80","traceback":"(\n\t0 CoreFoundation 0x000000019231f13c 373EC2DD-3A29-3E74-B85D-BE4EE925167A + 1159484\n\t1 libobjc.A.dylib 0x00000001a6032480 objc_exception_throw + 56\n\t2 CoreFoundation 0x000000019222e138 373EC2DD-3A29-3E74-B85D-BE4EE925167A + 172344\n\t3 CoreFoundation 0x0000000192321784 373EC2DD-3A29-3E74-B85D-BE4EE925167A + 1169284\n\t4 CoreFoundation 0x00000001923239ac _CF_forwarding_prep_0 + 92\n\t5 WebDriverAgentLib 0x0000000104e501c4 -[XCUIDevice(FBHelpers) fb_rawScreenshotWithQuality:error:] + 156\n\t6 WebDriverAgentLib 0x0000000104e50090 -[XCUIDevice(FBHelpers) fb_screenshotWithError:] + 88\n\t7 WebDriverAgentLib 0x0000000104def104 +[FBScreenshotCommands handleGetScreenshot:] + 1... [W3C] Matched W3C error code 'unknown error' to UnknownError [W3C (91e969d5)] Encountered internal error running command: Unkno

Also, this was working perfectly fine with 12.4 XCode, I am unable to understand whats triggering this issue.

IlyassABALI commented 3 years ago

Could you then delete the Xcode cache, then delete Carthage cache, then the deriveddata of the WBA.

Carthage cache : rm -rf ~/Library/Caches/org.carthage.CarthageKit

Xcode cache : ~/Library/Developer/Xcode/DerivedData

and let me know hope it works.

Me too I didn't understand why with this version we're getting this error.

sonichanchal commented 3 years ago

I can remove the xcode derived data, but i m passing one capability. If i remove the derived data, then my app wont work?

See below

cp.setCapability("derivedDataPath", "/Users/schanchal852/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu" );

Please suggest what to do

On Fri, May 21, 2021 at 11:12 PM IlyassABALI @.***> wrote:

Could you then delete the Xcode cache, then delete Carthage cache, then the deriveddata of the WBA.

Carthage cache : rm -rf ~/Library/Caches/org.carthage.CarthageKit

Xcode cache : ~/Library/Developer/Xcode/DerivedData

and let me know hope it works.

Me too I didn't understand why with this version we're getting this error.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/appium/appium/issues/15199#issuecomment-846129008, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATMDWX3ZHGQJIGTML4FFRUDTO2LRZANCNFSM4ZNDBUDQ .

KazuCocoa commented 3 years ago

Thanks IlyassABALI. As his comment, you should remove DerivedData once since it meant your xcodebuild referred to old data. The issue must not have been fixed. Once you remove it, xcodebuild generates the same path (as i remember...). Then, xcodebuild builds the build cache from the new WDA source code.

[BaseDriver] "appium:derivedDataPath": "/Users/schanchal852/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu",
sonichanchal commented 3 years ago

@KazuCocoa @IlyassABALI. I did the same thing removed the DriverData still m getting that screenshot error. I dont know now what to, please help

Matched '/screenshot' to command name 'getScreenshot' [WD Proxy] Proxying [GET /screenshot] to [GET http://127.0.0.1:8100/session/7C1D3827-B27D-4C53-B766-3BAD53B94C7F/screenshot] with no body [WD Proxy] Got response with status 500: {"value":{"error":"unknown error","message":"-[XCUIScreen screenshotDataForQuality:rect:error:]: unrecognized selector sent to instance 0x281740100","traceback":"(\n\t0 CoreFoundation 0x000000019231f13c 373EC2DD-3A29-3E74-B85D-BE4EE925167A + 1159484\n\t1 libobjc.A.dylib 0x00000001a6032480 objc_exception_throw + 56\n\t2 CoreFoundation 0x000000019222e138 373EC2DD-3A29-3E74-B85D-BE4EE925167A + 172344\n\t3 CoreFoundation 0x0000000192321784 373EC2DD-3A29-3E74-B85D-BE4EE925167A + 1169284\n\t4 CoreFoundation 0x00000001923239ac _CF_forwarding_prep_0 + 92\n\t5 WebDriverAgentLib 0x0000000106d941c4 -[XCUIDevice(FBHelpers) fb_rawScreenshotWithQuality:error:] + 156\n\t6 WebDriverAgentLib 0x0000000106d94090 -[XCUIDevice(FBHelpers) fb_screenshotWithError:] + 88\n\t7 WebDriverAgentLib 0x0000000106d33104 +[FBScreenshotCommands handleGetScreenshot:] + 1... [W3C] Matched W3C error code 'unknown error' to UnknownError [W3C (d0a10b04)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: -[XCUIScreen screenshotDataForQuality:rect:error:]: unrecognized selector sent to instance 0x281740100

KazuCocoa commented 3 years ago

Did you try https://github.com/appium/appium/issues/15309#issuecomment-846072608 out I commended on another issue for you?

sonichanchal commented 3 years ago

Did you try #15309 (comment) out I commended on another issue for you?

Yes have tried: 1- Installed latest beta Appium 1.22 2- Removed cache for xcode and Carthrage 3- Also, had webdriver from the iphone before running 3- Tried running appium in the local host server

Nothing helped.

KazuCocoa commented 3 years ago

No. The comment's root was:

Then, could you clone https://github.com/appium/WebDriverAgent on your local, run it on your machine, and open http://:/screenshot on your browser? Then, the browser prints the response. The body should have base64 screenshot data if it worked.

Not via Appium.