Closed krishtoautomate closed 3 years ago
I have face same issue Can you please help this issue
hm, WDA calls https://developer.apple.com/documentation/xctest/xcuiapplication/1500467-launch?language=objc at the end. So, probably Apple implemented to behave so. https://github.com/appium/WebDriverAgent/blob/a1824895274c60798b506f31054e4ce1e0400c71/WebDriverAgentLib/Routing/FBSession.m#L204
Btw, how about the system log?
Logs
[info] [35m[Appium][39m Welcome to Appium v1.19.1 [info] [35m[Appium][39m Non-default server args: [info] [35m[Appium][39m relaxedSecurityEnabled: true [info] [35m[Appium][39m allowInsecure: { [info] [35m[Appium][39m } [info] [35m[Appium][39m denyInsecure: { [info] [35m[Appium][39m } [info] [35m[Appium][39m Appium REST http interface listener started on 0.0.0.0:4723[info] [35m[HTTP][39m [37m-->[39m [37mDELETE[39m [37m/wd/hub/session/4fabe45d-9be4-400b-a059-c0e002aeb895[39m [info] [35m[HTTP][39m [90m{}[39m [debug] [35m[MJSONWP (4fabe45d)][39m Encountered internal error running command: NoSuchDriverError: A session is either terminated or not started [debug] [35m[MJSONWP (4fabe45d)][39m at asyncHandler (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:246:15) [debug] [35m[MJSONWP (4fabe45d)][39m at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:439:15 [debug] [35m[MJSONWP (4fabe45d)][39m at Layer.handle [as handle_request] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/layer.js:95:5) [debug] [35m[MJSONWP (4fabe45d)][39m at next (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/route.js:137:13) [debug] [35m[MJSONWP (4fabe45d)][39m at Route.dispatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/route.js:112:3) [debug] [35m[MJSONWP (4fabe45d)][39m at Layer.handle [as handle_request] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/layer.js:95:5) [debug] [35m[MJSONWP (4fabe45d)][39m at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:281:22 [debug] [35m[MJSONWP (4fabe45d)][39m at param (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:354:14) [debug] [35m[MJSONWP (4fabe45d)][39m at param (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:365:14) [debug] [35m[MJSONWP (4fabe45d)][39m at Function.process_params (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:410:3) [debug] [35m[MJSONWP (4fabe45d)][39m at next (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:275:10) [debug] [35m[MJSONWP (4fabe45d)][39m at logger (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/morgan/index.js:144:5) [debug] [35m[MJSONWP (4fabe45d)][39m at Layer.handle [as handle_request] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/layer.js:95:5) [debug] [35m[MJSONWP (4fabe45d)][39m at trim_prefix (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:317:13) [debug] [35m[MJSONWP (4fabe45d)][39m at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:284:7 [debug] [35m[MJSONWP (4fabe45d)][39m at Function.process_params (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:335:12) [debug] [35m[MJSONWP (4fabe45d)][39m at next (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:275:10) [debug] [35m[MJSONWP (4fabe45d)][39m at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/body-parser/lib/read.js:130:5 [debug] [35m[MJSONWP (4fabe45d)][39m at invokeCallback (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/raw-body/index.js:224:16) [debug] [35m[MJSONWP (4fabe45d)][39m at done (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/raw-body/index.js:213:7) [debug] [35m[MJSONWP (4fabe45d)][39m at IncomingMessage.onEnd (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/raw-body/index.js:273:7) [debug] [35m[MJSONWP (4fabe45d)][39m at IncomingMessage.emit (events.js:208:15) [debug] [35m[MJSONWP (4fabe45d)][39m at endReadableNT (_stream_readable.js:1168:12) [debug] [35m[MJSONWP (4fabe45d)][39m at processTicksAndRejections (internal/process/task_queues.js:77:11) [debug] [35m[MJSONWP (4fabe45d)][39m Destroying socket connection [info] [35m[HTTP][39m [37m<-- DELETE /wd/hub/session/4fabe45d-9be4-400b-a059-c0e002aeb895 [39m[33m404[39m [90m45 ms - 131[39m [info] [35m[HTTP][39m [90m[39m[info] [35m[HTTP][39m [37m-->[39m [37mPOST[39m [37m/wd/hub/session[39m [info] [35m[HTTP][39m [90m{"desiredCapabilities":{"autoLaunch":false,"automationName":"xcuitest","bundleId":"com.apple.Preferences","carrierConnectivityOnly":"true","deviceName":"AnyDevice","fullReset":"false","language":"en","mjpegServerPort":9100,"noReset":"true","platformName":"iOS","platformVersion":"12.2","simpleIsVisibleCheck":true,"udid":"auto","useJSONSource":true,"useNewWDA":true,"wdaStartupRetries":5,"wdaStartupRetryInterval":"1000","newCommandTimeout":0,"connectHardwareKeyboard":true}}[39m [debug] [35m[MJSONWP][39m Calling AppiumDriver.createSession() with args: [{"autoLaunch":false,"automationName":"xcuitest","bundleId":"com.apple.Preferences","carrierConnectivityOnly":"true","deviceName":"AnyDevice","fullReset":"false","language":"en","mjpegServerPort":9100,"noReset":"true","platformName":"iOS","platformVersion":"12.2","simpleIsVisibleCheck":true,"udid":"auto","useJSONSource":true,"useNewWDA":true,"wdaStartupRetries":5,"wdaStartupRetryInterval":"1000","newCommandTimeout":0,"connectHardwareKeyboard":true},null,null] [debug] [35m[BaseDriver][39m Event 'newSessionRequested' logged at 1614210652080 (18:50:52 GMT-0500 (Eastern Standard Time)) [info] [35m[Appium][39m Appium v1.19.1 creating new XCUITestDriver (v3.31.1) session [info] [35m[Appium][39m Applying relaxed security to 'XCUITestDriver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure [debug] [35m[BaseDriver][39m Creating session with MJSONWP desired capabilities: { [debug] [35m[BaseDriver][39m "autoLaunch": false, [debug] [35m[BaseDriver][39m "automationName": "xcuitest", [debug] [35m[BaseDriver][39m "bundleId": "com.apple.Preferences", [debug] [35m[BaseDriver][39m "carrierConnectivityOnly": "true", [debug] [35m[BaseDriver][39m "deviceName": "AnyDevice", [debug] [35m[BaseDriver][39m "fullReset": "false", [debug] [35m[BaseDriver][39m "language": "en", [debug] [35m[BaseDriver][39m "mjpegServerPort": 9100, [debug] [35m[BaseDriver][39m "noReset": "true", [debug] [35m[BaseDriver][39m "platformName": "iOS", [debug] [35m[BaseDriver][39m "platformVersion": "12.2", [debug] [35m[BaseDriver][39m "simpleIsVisibleCheck": true, [debug] [35m[BaseDriver][39m "udid": "auto", [debug] [35m[BaseDriver][39m "useJSONSource": true, [debug] [35m[BaseDriver][39m "useNewWDA": true, [debug] [35m[BaseDriver][39m "wdaStartupRetries": 5, [debug] [35m[BaseDriver][39m "wdaStartupRetryInterval": "1000", [debug] [35m[BaseDriver][39m "newCommandTimeout": 0, [debug] [35m[BaseDriver][39m "connectHardwareKeyboard": true [debug] [35m[BaseDriver][39m } [warn] [35m[BaseDriver][39m Capability 'noReset' changed from string to boolean. This may cause unexpected behavior [warn] [35m[BaseDriver][39m Capability 'fullReset' changed from string to boolean. This may cause unexpected behavior [warn] [35m[BaseDriver][39m Capability 'wdaStartupRetryInterval' changed from string ('1000') to integer (1000). This may cause unexpected behavior [warn] [35m[BaseDriver][39m The following capabilities were provided, but are not recognized by Appium: [warn] [35m[BaseDriver][39m carrierConnectivityOnly [info] [35m[BaseDriver][39m Session created with session id: 01f2bbda-6770-40d9-95bc-b1216106ec11 [debug] [35m[XCUITest][39m Current user: 'krish' [debug] [35m[XCUITest][39m Auto-detecting real device udid... [debug] [35m[XCUITest][39m Detected real device udid: '00008101-001C15A20AD2001E' [debug] [35m[XCUITest][39m Creating iDevice object with udid '00008101-001C15A20AD2001E' [info] [35m[XCUITest][39m Determining device to run tests on: udid: '00008101-001C15A20AD2001E', real device: true [debug] [35m[BaseDriver][39m Event 'xcodeDetailsRetrieved' logged at 1614210652116 (18:50:52 GMT-0500 (Eastern Standard Time)) [debug] [35m[BaseDriver][39m Event 'appConfigured' logged at 1614210652116 (18:50:52 GMT-0500 (Eastern Standard Time)) [debug] [35m[BaseDriver][39m Event 'resetStarted' logged at 1614210652117 (18:50:52 GMT-0500 (Eastern Standard Time)) [debug] [35m[XCUITest][39m Reset: fullReset not set. Leaving as is [debug] [35m[BaseDriver][39m Event 'resetComplete' logged at 1614210652117 (18:50:52 GMT-0500 (Eastern Standard Time)) [info] [35m[WebDriverAgent][39m Using WDA path: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent' [info] [35m[WebDriverAgent][39m Using WDA agent: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj'[debug] [35m[XCUITest][39m Crash reports root '/Users/krish/Library/Logs/CrashReporter/MobileDevice/iPhone 12 Pro' does not exist. Got nothing to gather. [debug] [35m[BaseDriver][39m Event 'logCaptureStarted' logged at 1614210652322 (18:50:52 GMT-0500 (Eastern Standard Time)) [info] [35m[XCUITest][39m Setting up real device[debug] [35m[WebDriverAgent][39m No obsolete cached processes from previous WDA sessions listening on port 8100 have been found [info] [35m[DevCon Factory][39m Requesting connection for device 00008101-001C15A20AD2001E on local port 8100, device port 8100 [debug] [35m[DevCon Factory][39m Cached connections count: 1 [info] [35m[DevCon Factory][39m Found cached connections on port #8100: ["00008101-001C15A20AD2001E:8100"] [warn] [35m[DevCon Factory][39m Port #8100 is busy. Did you quit the previous driver session(s) properly? [info] [35m[DevCon Factory][39m Trying to release the port [info] [35m[DevCon Factory][39m Releasing the listener for '00008101-001C15A20AD2001E:8100' [debug] [35m[iProxy@00008101:8100][39m Closing the connection [info] [35m[iProxy@00008101:8100][39m The connection has been closed [info] [35m[DevCon Factory][39m Port #8100 has been successfully released after 2ms [info] [35m[DevCon Factory][39m Successfully requested the connection for 00008101-001C15A20AD2001E:8100 [debug] [35m[XCUITest][39m Starting WebDriverAgent initialization with the synchronization key 'XCUITestDriver' [debug] [35m[XCUITest][39m Capability 'useNewWDA' set to true, so uninstalling WDA before proceeding [info] [35m[WebDriverAgent][39m Shutting down sub-processes[info] [35m[HTTP][39m [37m-->[39m [37mGET[39m [37m/wd/hub/sessions[39m [info] [35m[HTTP][39m [90m{}[39m [debug] [35m[GENERIC][39m Calling AppiumDriver.getSessions() with args: [] [debug] [35m[GENERIC][39m Responding to client with driver.getSessions() result: [] [info] [35m[HTTP][39m [37m<-- GET /wd/hub/sessions [39m[32m200[39m [90m2 ms - 40[39m [info] [35m[HTTP][39m [90m[39m[debug] [35m[WebDriverAgent][39m Uninstalling WDAs: 'com.facebook.WebDriverAgentRunner.xctrunner'[debug] [35m[BaseDriver][39m Event 'wdaUninstalled' logged at 1614210653176 (18:50:53 GMT-0500 (Eastern Standard Time)) [debug] [35m[XCUITest][39m Trying to start WebDriverAgent 5 times with 1000ms interval [debug] [35m[BaseDriver][39m Event 'wdaStartAttempted' logged at 1614210653177 (18:50:53 GMT-0500 (Eastern Standard Time)) [info] [35m[WebDriverAgent][39m Launching WebDriverAgent on the device [info] [35m[WebDriverAgent][39m Fetching dependencies [info] [35m[WebDriverAgent][39m Dependencies up-to-date [debug] [35m[WebDriverAgent][39m Killing running processes 'xcodebuild.*00008101-001C15A20AD2001E' for the device 00008101-001C15A20AD2001E...[debug] [35m[WebDriverAgent][39m Beginning test with command 'xcodebuild build-for-testing test-without-building -project /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=00008101-001C15A20AD2001E IPHONEOS_DEPLOYMENT_TARGET=12.2 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent' [debug] [35m[WebDriverAgent][39m Output from xcodebuild will only be logged if any errors are present there. To change this, use 'showXcodeLog' desired capability[debug] [35m[WebDriverAgent][39m Waiting up to 60000ms for WebDriverAgent to start [debug] [35m[WD Proxy][39m Matched '/status' to command name 'getStatus' [debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body [debug] [35m[iProxy@00008101:8100][39m Connection was refused to port 8100 [info] [35m[WD Proxy][39m socket hang up[debug] [35m[WD Proxy][39m Matched '/status' to command name 'getStatus' [debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body [debug] [35m[iProxy@00008101:8100][39m Connection was refused to port 8100 [info] [35m[WD Proxy][39m socket hang up[debug] [35m[WebDriverAgent][39m Log file for xcodebuild test: /Users/krish/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.02.24_18-50-56--0500.xcresult/Staging/2_Test/Diagnostics/WebDriverAgentRunner-258E56F0-38A9-4410-ADC8-7A70CF8BF1FA/WebDriverAgentRunner-210F53E2-48F8-4BB3-82E1-CBE29E383757/Session-WebDriverAgentRunner-2021-02-24_185056-NQYMMB.log [debug] [35m[WebDriverAgent][39m Parsed BUILD_DIR configuration value: '/Users/krish/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Build/Products' [debug] [35m[WebDriverAgent][39m Got derived data root: '/Users/krish/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp'[debug] [35m[WD Proxy][39m Matched '/status' to command name 'getStatus' [debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body [debug] [35m[iProxy@00008101:8100][39m Connection was refused to port 8100 [info] [35m[WD Proxy][39m socket hang up[debug] [35m[WD Proxy][39m Matched '/status' to command name 'getStatus' [debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body [debug] [35m[iProxy@00008101:8100][39m Connection was refused to port 8100 [info] [35m[WD Proxy][39m socket hang up[debug] [35m[WD Proxy][39m Matched '/status' to command name 'getStatus' [debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body [debug] [35m[WD Proxy][39m Got response with status 200: {"value":{"message":"WebDriverAgent is ready to accept commands","state":"success","os":{"testmanagerdVersion":28,"name":"iOS","sdkVersion":"14.2","version":"14.2.1"},"ios":{"ip":"169.254.97.199"},"ready":true,"build":{"upgradedAt":"1611943673417","time":"Feb 22 2021 15:23:03","productBundleIdentifier":"com.facebook.WebDriverAgentRunner"}},"sessionId":null} [debug] [35m[WebDriverAgent][39m WebDriverAgent information: [debug] [35m[WebDriverAgent][39m { [debug] [35m[WebDriverAgent][39m "message": "WebDriverAgent is ready to accept commands", [debug] [35m[WebDriverAgent][39m "state": "success", [debug] [35m[WebDriverAgent][39m "os": { [debug] [35m[WebDriverAgent][39m "testmanagerdVersion": 28, [debug] [35m[WebDriverAgent][39m "name": "iOS", [debug] [35m[WebDriverAgent][39m "sdkVersion": "14.2", [debug] [35m[WebDriverAgent][39m "version": "14.2.1" [debug] [35m[WebDriverAgent][39m }, [debug] [35m[WebDriverAgent][39m "ios": { [debug] [35m[WebDriverAgent][39m "ip": "169.254.97.199" [debug] [35m[WebDriverAgent][39m }, [debug] [35m[WebDriverAgent][39m "ready": true, [debug] [35m[WebDriverAgent][39m "build": { [debug] [35m[WebDriverAgent][39m "upgradedAt": "1611943673417", [debug] [35m[WebDriverAgent][39m "time": "Feb 22 2021 15:23:03", [debug] [35m[WebDriverAgent][39m "productBundleIdentifier": "com.facebook.WebDriverAgentRunner" [debug] [35m[WebDriverAgent][39m } [debug] [35m[WebDriverAgent][39m } [debug] [35m[WebDriverAgent][39m WebDriverAgent successfully started after 5579ms [debug] [35m[BaseDriver][39m Event 'wdaSessionAttempted' logged at 1614210659125 (18:50:59 GMT-0500 (Eastern Standard Time)) [debug] [35m[XCUITest][39m Sending createSession command to WDA [debug] [35m[WD Proxy][39m Matched '/session' to command name 'createSession' [debug] [35m[WD Proxy][39m Proxying [POST /session] to [POST http://127.0.0.1:8100/session] with body: {"capabilities":{"firstMatch":[{"arguments":["-AppleLanguages","(en)","-NSLanguages","(en)"],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":true,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}],"alwaysMatch":{}}}[debug] [35m[WD Proxy][39m Got response with status 200: {"value":{"sessionId":"AE8EB6FF-7B39-4711-AF0A-648D9218346C","capabilities":{"device":"iphone","browserName":" ","sdkVersion":"14.2.1","CFBundleIdentifier":"com.apple.springboard"}},"sessionId":"AE8EB6FF-7B39-4711-AF0A-648D9218346C"} [info] [35m[WD Proxy][39m Determined the downstream protocol as 'W3C' [debug] [35m[BaseDriver][39m Event 'wdaSessionStarted' logged at 1614210659222 (18:50:59 GMT-0500 (Eastern Standard Time)) [debug] [35m[BaseDriver][39m Event 'wdaStarted' logged at 1614210659222 (18:50:59 GMT-0500 (Eastern Standard Time)) [info] [35m[XCUITest][39m Skipping setting of the initial display orientation. Set the "orientation" capability to either "LANDSCAPE" or "PORTRAIT", if this is an undesired behavior. [debug] [35m[BaseDriver][39m Event 'orientationSet' logged at 1614210659222 (18:50:59 GMT-0500 (Eastern Standard Time)) [debug] [35m[WD Proxy][39m Matched '/appium/settings' to command name 'updateSettings' [debug] [35m[WD Proxy][39m Proxying [POST /appium/settings] to [POST http://127.0.0.1:8100/session/AE8EB6FF-7B39-4711-AF0A-648D9218346C/appium/settings] with body: {"settings":{"useJSONSource":true}} [debug] [35m[WD Proxy][39m Got response with status 200: {"value":{"boundElementsByIndex":false,"mjpegServerFramerate":10,"screenshotOrientation":"auto","reduceMotion":false,"elementResponseAttributes":"type,label","screenshotQuality":1,"mjpegScalingFactor":100,"keyboardPrediction":0,"defaultActiveApplication":"auto","mjpegServerScreenshotQuality":25,"defaultAlertAction":"","keyboardAutocorrection":0,"useFirstMatch":false,"shouldUseCompactResponses":true,"customSnapshotTimeout":15,"dismissAlertButtonSelector":"","activeAppDetectionPoint":"64.00,64.00","snapshotMaxDepth":50,"waitForIdleTimeout":10,"includeNonModalElements":false,"acceptAlertButtonSelector":"","animationCoolOffTimeout":2},"sessionId":"AE8EB6FF-7B39-4711-AF0A-648D9218346C"} [debug] [35m[BaseDriver][39m The value of 'elementResponseAttributes' setting did not change. Skipping the update for it [debug] [35m[BaseDriver][39m The value of 'shouldUseCompactResponses' setting did not change. Skipping the update for it [info] [35m[Appium][39m New XCUITestDriver session created successfully, session 01f2bbda-6770-40d9-95bc-b1216106ec11 added to master session list [debug] [35m[BaseDriver][39m Event 'newSessionStarted' logged at 1614210659232 (18:50:59 GMT-0500 (Eastern Standard Time)) [debug] [35m[MJSONWP (01f2bbda)][39m Cached the protocol value 'MJSONWP' for the new session 01f2bbda-6770-40d9-95bc-b1216106ec11 [debug] [35m[MJSONWP (01f2bbda)][39m Responding to client with driver.createSession() result: {"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"autoLaunch":false,"automationName":"xcuitest","bundleId":"com.apple.Preferences","carrierConnectivityOnly":"true","deviceName":"AnyDevice","fullReset":false,"language":"en","mjpegServerPort":9100,"noReset":true,"platformName":"iOS","platformVersion":"12.2","simpleIsVisibleCheck":true,"udid":"00008101-001C15A20AD2001E","useJSONSource":true,"useNewWDA":true,"wdaStartupRetries":5,"wdaStartupRetryInterval":1000,"newCommandTimeout":0,"connectHardwareKeyboard":true} [info] [35m[HTTP][39m [37m<-- POST /wd/hub/session [39m[32m200[39m [90m7155 ms - 734[39m [info] [35m[HTTP][39m [90m[39m[info] [35m[HTTP][39m [37m-->[39m [37mGET[39m [37m/wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/contexts[39m [info] [35m[HTTP][39m [90m{}[39m [debug] [35m[MJSONWP (01f2bbda)][39m Calling AppiumDriver.getContexts() with args: ["01f2bbda-6770-40d9-95bc-b1216106ec11"] [debug] [35m[XCUITest][39m Executing command 'getContexts' [debug] [35m[XCUITest][39m Getting list of available contexts [debug] [35m[iOS][39m Retrieving contexts and views [debug] [35m[XCUITest][39m Selecting by url: false [info] [35m[RemoteDebugger][39m Remote Debugger version 8.13.2 [debug] [35m[RemoteDebugger][39m useNewSafari --> false [debug] [35m[RemoteDebugger][39m Checking which communication style to use (non-Safari on platform version '12.2') [debug] [35m[RemoteDebugger][39m Platform version equal or higher than '12.2': true [warn] [35m[RemoteDebugger][39m Setting communication protocol: using Target-based communication [debug] [35m[RemoteDebugger][39m Sending connection key request [debug] [35m[RemoteDebugger][39m Sending '_rpc_reportIdentifier:' message (id: 0): 'setConnectionKey' [debug] [35m[RemoteDebugger][39m Sending to Web Inspector took 4ms [debug] [35m[RemoteDebugger][39m Sending connection key request [debug] [35m[RemoteDebugger][39m Sending '_rpc_reportIdentifier:' message (id: 2): 'setConnectionKey' [debug] [35m[RemoteDebugger][39m Sending to Web Inspector took 4ms [debug] [35m[RemoteDebugger][39m Selecting application [debug] [35m[RemoteDebugger][39m No applications currently connected. [debug] [35m[XCUITest][39m No web frames found. [debug] [35m[MJSONWP (01f2bbda)][39m Responding to client with driver.getContexts() result: ["NATIVE_APP"] [info] [35m[HTTP][39m [37m<-- GET /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/contexts [39m[32m200[39m [90m139 ms - 86[39m [info] [35m[HTTP][39m [90m[39m[info] [35m[HTTP][39m [37m-->[39m [37mGET[39m [37m/wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/context[39m [info] [35m[HTTP][39m [90m{}[39m [debug] [35m[MJSONWP (01f2bbda)][39m Calling AppiumDriver.getCurrentContext() with args: ["01f2bbda-6770-40d9-95bc-b1216106ec11"] [debug] [35m[XCUITest][39m Executing command 'getCurrentContext' [debug] [35m[MJSONWP (01f2bbda)][39m Responding to client with driver.getCurrentContext() result: "NATIVE_APP" [info] [35m[HTTP][39m [37m<-- GET /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/context [39m[32m200[39m [90m2 ms - 84[39m [info] [35m[HTTP][39m [90m[39m [info] [35m[HTTP][39m [37m-->[39m [37mGET[39m [37m/wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11[39m [info] [35m[HTTP][39m [90m{}[39m [debug] [35m[MJSONWP (01f2bbda)][39m Calling AppiumDriver.getSession() with args: ["01f2bbda-6770-40d9-95bc-b1216106ec11"] [debug] [35m[XCUITest][39m Executing command 'getSession' [debug] [35m[WD Proxy][39m Matched '/' to command name 'getSession' [debug] [35m[WD Proxy][39m Proxying [GET /] to [GET http://127.0.0.1:8100/session/AE8EB6FF-7B39-4711-AF0A-648D9218346C] with no body [debug] [35m[WD Proxy][39m Got response with status 200: {"value":{"sessionId":"AE8EB6FF-7B39-4711-AF0A-648D9218346C","capabilities":{"device":"iphone","browserName":" ","sdkVersion":"14.2.1","CFBundleIdentifier":"com.apple.springboard"}},"sessionId":"AE8EB6FF-7B39-4711-AF0A-648D9218346C"} [debug] [35m[WD Proxy][39m Proxying [GET /wda/screen] to [GET http://127.0.0.1:8100/session/AE8EB6FF-7B39-4711-AF0A-648D9218346C/wda/screen] with no body[debug] [35m[WD Proxy][39m Got response with status 200: {"value":{"statusBarSize":{"width":390,"height":47},"scale":3},"sessionId":"AE8EB6FF-7B39-4711-AF0A-648D9218346C"} [debug] [35m[WD Proxy][39m Proxying [GET /window/size] to [GET http://127.0.0.1:8100/session/AE8EB6FF-7B39-4711-AF0A-648D9218346C/window/size] with no body [debug] [35m[WD Proxy][39m Got response with status 200: {"value":{"width":390,"height":844},"sessionId":"AE8EB6FF-7B39-4711-AF0A-648D9218346C"} [info] [35m[XCUITest][39m Merging WDA caps over Appium caps for session detail response [debug] [35m[MJSONWP (01f2bbda)][39m Responding to client with driver.getSession() result: {"udid":"auto","autoLaunch":false,"automationName":"xcuitest","bundleId":"com.apple.Preferences","carrierConnectivityOnly":"true","deviceName":"AnyDevice","fullReset":false,"language":"en","mjpegServerPort":9100,"noReset":true,"platformName":"iOS","platformVersion":"12.2","simpleIsVisibleCheck":true,"useJSONSource":true,"useNewWDA":true,"wdaStartupRetries":5,"wdaStartupRetryInterval":1000,"newCommandTimeout":0,"connectHardwareKeyboard":true,"device":"iphone","browserName":" ","sdkVersion":"14.2.1","CFBundleIdentifier":"com.apple.springboard","pixelRatio":3,"statBarHeight":47,"viewportRect":{"left":0,"top":141,"width":1170,"height":2391}} [info] [35m[HTTP][39m [37m<-- GET /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11 [39m[32m200[39m [90m331 ms - 717[39m [info] [35m[HTTP][39m [90m[39m [info] [35m[HTTP][39m [37m-->[39m [37mGET[39m [37m/wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/window/current/size[39m [info] [35m[HTTP][39m [90m{}[39m [debug] [35m[MJSONWP (01f2bbda)][39m Calling AppiumDriver.getWindowSize() with args: ["current","01f2bbda-6770-40d9-95bc-b1216106ec11"] [debug] [35m[XCUITest][39m Executing command 'getWindowSize' [debug] [35m[WD Proxy][39m Proxying [GET /window/size] to [GET http://127.0.0.1:8100/session/AE8EB6FF-7B39-4711-AF0A-648D9218346C/window/size] with no body [debug] [35m[WD Proxy][39m Got response with status 200: {"value":{"width":390,"height":844},"sessionId":"AE8EB6FF-7B39-4711-AF0A-648D9218346C"} [debug] [35m[MJSONWP (01f2bbda)][39m Responding to client with driver.getWindowSize() result: {"width":390,"height":844} [info] [35m[HTTP][39m [37m<-- GET /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/window/current/size [39m[32m200[39m [90m63 ms - 98[39m [info] [35m[HTTP][39m [90m[39m [info] [35m[HTTP][39m [37m-->[39m [37mPOST[39m [37m/wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/execute[39m [info] [35m[HTTP][39m [90m{"script":"mobile:getContexts","args":[]}[39m [debug] [35m[MJSONWP (01f2bbda)][39m Calling AppiumDriver.execute() with args: ["mobile:getContexts",[],"01f2bbda-6770-40d9-95bc-b1216106ec11"] [debug] [35m[XCUITest][39m Executing command 'execute' [debug] [35m[XCUITest][39m Getting list of available contexts [debug] [35m[iOS][39m Retrieving contexts and views [debug] [35m[XCUITest][39m Selecting by url: false [debug] [35m[RemoteDebugger][39m Sending connection key request [debug] [35m[RemoteDebugger][39m Sending '_rpc_reportIdentifier:' message (id: 4): 'setConnectionKey' [debug] [35m[RemoteDebugger][39m Sending to Web Inspector took 3ms [debug] [35m[RemoteDebugger][39m Selecting application [debug] [35m[RemoteDebugger][39m No applications currently connected. [debug] [35m[XCUITest][39m No web frames found. [debug] [35m[XCUITest][39m No webviews found in 4ms [debug] [35m[MJSONWP (01f2bbda)][39m Responding to client with driver.execute() result: [{"id":"NATIVE_APP"}] [info] [35m[HTTP][39m [37m<-- POST /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/execute [39m[32m200[39m [90m5 ms - 93[39m [info] [35m[HTTP][39m [90m[39m [info] [35m[HTTP][39m [37m-->[39m [37mGET[39m [37m/wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/source[39m [info] [35m[HTTP][39m [90m{}[39m [debug] [35m[MJSONWP (01f2bbda)][39m Calling AppiumDriver.getPageSource() with args: ["01f2bbda-6770-40d9-95bc-b1216106ec11"] [debug] [35m[XCUITest][39m Executing command 'getPageSource' [debug] [35m[WD Proxy][39m Matched '/source?format=json' to command name 'getPageSource' [debug] [35m[WD Proxy][39m Proxying [GET /source?format=json] to [GET http://127.0.0.1:8100/session/AE8EB6FF-7B39-4711-AF0A-648D9218346C/source?format=json] with no body[debug] [35m[WD Proxy][39m Got response with status 200: {"value":{"isEnabled":"1","isVisible":"1","frame":"{{0, 0}, {390, 844}}","children":[{"isEnabled":"1","isVisible":"0","frame":"{{0, 0}, {390, 844}}","children":[{"isEnabled":"1","isVisible":"0","frame":"{{0, 0}, {390, 844}}","children":[{"isEnabled":"1","isVisible":"0","frame":"{{0, 0}, {390, 844}}","rect":{"y":0,"x":0,"width":390,"height":844},"value":null,"label":null,"type":"Other","name":null,"rawIdentifier":null}],"rect":{"y":0,"x":0,"width":390,"height":844},"value":null,"label":null,"type":"Other","name":null,"rawIdentifier":null},{"isEnabled":"1","isVisible":"0","frame":"{{0, 0}, {390, 844}}","rect":{"y":0,"x":0,"width":390,"height":844},"value":null,"label":null,"type":"Other","name":null,"rawIdentifier":null}],"rect":{"y":0,"x":0,"width":390,"height":844},"value":null,"label":null,"type":"Window","name":null,"rawIdentifier":null},{"isEnabled":"1","isVisible":"1","frame":"{{0, 0}, {390, 844}}","children":[{"isEnabled":"1","isVisible":"1","frame":"{{0, 0}, {390, 844}}","children":[{"isEnabled":"1",... [debug] [35m[MJSONWP (01f2bbda)][39m Responding to client with driver.getPageSource() result: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<AppiumAUT>\n <XCUIElementTypeApplication type=\"XCUIElementTypeApplication\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"390\" height=\"844\" name=\" \" label=\" \">\n <XCUIElementTypeWindow type=\"XCUIElementTypeWindow\" enabled=\"true\" visible=\"false\" x=\"0\" y=\"0\" width=\"390\" height=\"844\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"false\" x=\"0\" y=\"0\" width=\"390\" height=\"844\">\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"false\" x=\"0\" y=\"0\" width=\"390\" height=\"844\">\n </XCUIElementTypeOther>\n </XCUIElementTypeOther>\n <XCUIElementTypeOther type=\"XCUIElementTypeOther\" enabled=\"true\" visible=\"false\" x=\"0\" y=\"0\" width=\"390\" height=\"844\">\n </XCUIElementTypeOther>\n </XCUIElementTypeWindow>\n <XCUIElementTypeWindow type=\"XCUIElementTypeWindow\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\... [info] [35m[HTTP][39m [37m<-- GET /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/source [39m[32m200[39m [90m958 ms - 29589[39m [info] [35m[HTTP][39m [90m[39m [info] [35m[HTTP][39m [37m-->[39m [37mGET[39m [37m/wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/screenshot[39m [info] [35m[HTTP][39m [90m{}[39m [debug] [35m[MJSONWP (01f2bbda)][39m Calling AppiumDriver.getScreenshot() with args: ["01f2bbda-6770-40d9-95bc-b1216106ec11"] [debug] [35m[XCUITest][39m Executing command 'getScreenshot' [debug] [35m[XCUITest][39m Taking screenshot with WDA [debug] [35m[WD Proxy][39m Matched '/screenshot' to command name 'getScreenshot' [debug] [35m[WD Proxy][39m Proxying [GET /screenshot] to [GET http://127.0.0.1:8100/session/AE8EB6FF-7B39-4711-AF0A-648D9218346C/screenshot] with no body[debug] [35m[WD Proxy][39m Got response with status 200: {"value":"iVBORw0KGgoAAAANSUhEUgAABJIAAAnkCAIAAADZI9xUAAAAAXNSR0IArs4c6QAA\r\nAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKAC\r\nAAQAAAABAAAEkqADAAQAAAABAAAJ5AAAAADL9lqOAAAAHGlET1QAAAACAAAAAAAA\r\nBPIAAAAoAAAE8gAABPIAFj4VFpzfVgAAQABJREFUeAF83Yu2ZEeVpOt+rS5AytRd\r\n1OOdLkCAQHcJBNVnnJfpRspMpa71Gv2t+HObnEj6jOFjjuk2bZr7itjKvUy+IvZ/\r\n++rDXxr/+OAXTz959dmnj558/EpJuWh889njbz579eknv/rfH/1b4+tPf/X081e/\r\n+ctj8clnrxiQhvzZF4/kJc//+hrahlKN3375ulJTSHy0uiA1Iqy3Vb765JeSmBI0\r\nUmme7UqJfPe3N3DkxpY7t6FdY0iXYJrsaNsMRG6kj5lshGJIInKacqPecsxL/C+P\r\n/vHpL7/+/JVnf3385ItXJRCJASkHRoAYz//2uvHNl68ZpkUELQM1Vrp6P3v05PPH\r\nz/7yuiExvvnrG8+/fFMMiQCXpNO6FL79+xvWSqpcybBQnFa3tGnMNn9uUuN3//lm\r\nTFLGyCkHakETMW1jqyQ7QXjtMfW2IjAdIlYsB7Y3Cdm7ESdyIhBTo0WBdtLO5Wun\r\n1nIx4W1vm4QodTle6m//9pYhOQekt6DXP8LTL16LL1aF7P3q7UvEeze893FTBEhS\r\n01Ftidb97u9vS4w0RfwQpcgiHWAirSuG1IhgYDbkCO05GjWgazwJ8nQw2ycaJLXA\r\nO9mmShJMqxNJfMyJKAEbqYla6tW+zQwBav/+P99JpM3rghtbt0ZIjciY8sRV45ec\r\ngjjrlZhuUIBYoi4KrY5AAWjaQjVGg1RtxXa4xpZTQm5MNmZSKbtqSftpodq... [debug] [35m[MJSONWP (01f2bbda)][39m Responding to client with driver.getScreenshot() result: "iVBORw0KGgoAAAANSUhEUgAABJIAAAnkCAIAAADZI9xUAAAAAXNSR0IArs4c6QAA\r\nAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKAC\r\nAAQAAAABAAAEkqADAAQAAAABAAAJ5AAAAADL9lqOAAAAHGlET1QAAAACAAAAAAAA\r\nBPIAAAAoAAAE8gAABPIAFj4VFpzfVgAAQABJREFUeAF83Yu2ZEeVpOt+rS5AytRd\r\n1OOdLkCAQHcJBNVnnJfpRspMpa71Gv2t+HObnEj6jOFjjuk2bZr7itjKvUy+IvZ/\r\n++rDXxr/+OAXTz959dmnj558/EpJuWh889njbz579eknv/rfH/1b4+tPf/X081e/\r\n+ctj8clnrxiQhvzZF4/kJc//+hrahlKN3375ulJTSHy0uiA1Iqy3Vb765JeSmBI0\r\nUmme7UqJfPe3N3DkxpY7t6FdY0iXYJrsaNsMRG6kj5lshGJIInKacqPecsxL/C+P\r\n/vHpL7/+/JVnf3385ItXJRCJASkHRoAYz//2uvHNl68ZpkUELQM1Vrp6P3v05PPH\r\nz/7yuiExvvnrG8+/fFMMiQCXpNO6FL79+xvWSqpcybBQnFa3tGnMNn9uUuN3//lm\r\nTFLGyCkHakETMW1jqyQ7QXjtMfW2IjAdIlYsB7Y3Cdm7ESdyIhBTo0WBdtLO5Wun\r\n1nIx4W1vm4QodTle6m//9pYhOQekt6DXP8LTL16LL1aF7P3q7UvEeze893FTBEhS\r\n01Ftidb97u9vS4w0RfwQpcgiHWAirSuG1IhgYDbkCO05GjWgazwJ8nQw2ycaJLXA\r\nO9mmShJMqxNJfMyJKAEbqYla6tW+zQwBav/+P99JpM3rghtbt0ZIjciY8sRV45ec\r\ngjjrlZhuUIBYoi4KrY5AAWjaQjVGg1RtxXa4xpZTQm5MNmZSKbtqSftpodqX7/LT\r\n... [info] [35m[HTTP][39m [37m<-- GET /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/screenshot [39m[32m200[39m [90m495 ms - 4075002[39m [info] [35m[HTTP][39m [90m[39m
t = 392.27s Open com.apple.springboard
t = 392.27s Activate com.apple.springboard
t = 392.34s Wait for com.apple.springboard to become Running Foreground
2021-02-25 10:44:21.998017+0530 WebDriverAgentRunner-Runner[6989:1756967] Getting the most recent active application (out of 1 total items)
2021-02-25 10:44:22.001425+0530 WebDriverAgentRunner-Runner[6989:1756967] Getting the most recent active application (out of 1 total items)
t = 395.90s Setting device orientation to Portrait
t = 405.21s Open com.apple.mobilesafari
t = 405.21s Activate com.apple.mobilesafari
t = 405.37s Wait for com.apple.mobilesafari to become Running Foreground
2021-02-25 10:44:31.528048+0530 WebDriverAgentRunner-Runner[6989:1759117] Cannot request the screen point at {153.60000000000002, 153.60000000000002}
t = 405.43s Waiting 2.5s for Application 'com.apple.mobilesafari' to exist
t = 406.43s Checking Expect predicate
exists == 1for object Application 'com.apple.mobilesafari'
Please find stf Logs
2021-02-25T09:11:27.608Z VRB/wdaClient 61854 [f655b3fad5c2ce9b04f0f556fadf4d6f6bd872b5] Has been sent api request to WDA with data : {"method":"POST","uri":"http://192.168.0.4:20011/session/27230F57-B8CA-49E1-8100-AA3028351613/wda/apps/launch","body":{"bundleId":"com.apple.mobilesafari","arguments":["--U","https://www.youtube.com/"],"shouldWaitForQuiescence":true},"json":true}
Unhandled rejection TypeError: Cannot read property 'sessionId' of null
at handleRequest.then.response (/Users/veeraswamygajula/Projects/mcloud-ios/stf/lib/units/ios-device/plugins/wda/WdaClient.js:185:47)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)
From previous event:
at Promise (/Users/xxxxx/Projects/mcloud-ios/stf/lib/units/ios-device/plugins/wda/WdaClient.js:184:14)
From previous event:
at Object.openUrl (/Users/xxxx/Projects/mcloud-ios/stf/lib/units/ios-device/plugins/wda/WdaClient.js:177:16)
at Router.sub.on.wirerouter.on.on.on.on.on.on.on.on.on.on (/Users/xxxxx/Projects/mcloud-ios/stf/lib/units/ios-device/plugins/wda.js:62:19)
at Router.emit (/Users/xxxx/Projects/mcloud-ios/stf/node_modules/eventemitter3/index.js:118:35)
at Router.
For Simulator: It seems Safari behaves so. Please report it to Apple to change the behavior. It seems after opening the page with launching the safari process, iOS focuses on the search bar automatically.
For Real device:
Launching safari is expected behaviour. I think --U
argument does not work on the real device. You can report it to Apple.
(Although I don't know the argument is the official one.)
API: {{DEVICE_URL}}/session/{{SESSSION_ID}}/wda/apps/launch Body: {"bundleId" :"com.apple.mobilesafari", "arguments":["--U", "https://www.yahoo.ca"]}
Safari launches with loading "https://www.yahoo.ca" but reverts back to blank in 2-5 seconds.