appium / WebDriverAgent

A WebDriver server for iOS and tvOS
Other
1.21k stars 377 forks source link

Launch safari with url is opening provided url but changing back to blank page in safari #469

Closed krishtoautomate closed 3 years ago

krishtoautomate commented 3 years ago

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.

Veeru5c4 commented 3 years ago

I have face same issue Can you please help this issue

KazuCocoa commented 3 years ago

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?

krishtoautomate commented 3 years ago

Logs [info] [Appium] Welcome to Appium v1.19.1 [info] [Appium] Non-default server args: [info] [Appium] relaxedSecurityEnabled: true [info] [Appium] allowInsecure: { [info] [Appium] } [info] [Appium] denyInsecure: { [info] [Appium] } [info] [Appium] Appium REST http interface listener started on 0.0.0.0:4723[info] [HTTP] --> DELETE /wd/hub/session/4fabe45d-9be4-400b-a059-c0e002aeb895 [info] [HTTP] {} [debug] [MJSONWP (4fabe45d)] Encountered internal error running command: NoSuchDriverError: A session is either terminated or not started [debug] [MJSONWP (4fabe45d)] at asyncHandler (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:246:15) [debug] [MJSONWP (4fabe45d)] at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:439:15 [debug] [MJSONWP (4fabe45d)] 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] [MJSONWP (4fabe45d)] at next (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/route.js:137:13) [debug] [MJSONWP (4fabe45d)] at Route.dispatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/route.js:112:3) [debug] [MJSONWP (4fabe45d)] 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] [MJSONWP (4fabe45d)] at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:281:22 [debug] [MJSONWP (4fabe45d)] at param (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:354:14) [debug] [MJSONWP (4fabe45d)] at param (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:365:14) [debug] [MJSONWP (4fabe45d)] at Function.process_params (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:410:3) [debug] [MJSONWP (4fabe45d)] at next (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:275:10) [debug] [MJSONWP (4fabe45d)] at logger (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/morgan/index.js:144:5) [debug] [MJSONWP (4fabe45d)] 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] [MJSONWP (4fabe45d)] at trim_prefix (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:317:13) [debug] [MJSONWP (4fabe45d)] at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:284:7 [debug] [MJSONWP (4fabe45d)] at Function.process_params (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:335:12) [debug] [MJSONWP (4fabe45d)] at next (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/express/lib/router/index.js:275:10) [debug] [MJSONWP (4fabe45d)] at /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/body-parser/lib/read.js:130:5 [debug] [MJSONWP (4fabe45d)] at invokeCallback (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/raw-body/index.js:224:16) [debug] [MJSONWP (4fabe45d)] at done (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/raw-body/index.js:213:7) [debug] [MJSONWP (4fabe45d)] at IncomingMessage.onEnd (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/raw-body/index.js:273:7) [debug] [MJSONWP (4fabe45d)] at IncomingMessage.emit (events.js:208:15) [debug] [MJSONWP (4fabe45d)] at endReadableNT (_stream_readable.js:1168:12) [debug] [MJSONWP (4fabe45d)] at processTicksAndRejections (internal/process/task_queues.js:77:11) [debug] [MJSONWP (4fabe45d)] Destroying socket connection [info] [HTTP] <-- DELETE /wd/hub/session/4fabe45d-9be4-400b-a059-c0e002aeb895 404 45 ms - 131 [info] [HTTP] [info] [HTTP] --> POST /wd/hub/session [info] [HTTP] {"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}} [debug] [MJSONWP] 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] [BaseDriver] Event 'newSessionRequested' logged at 1614210652080 (18:50:52 GMT-0500 (Eastern Standard Time)) [info] [Appium] Appium v1.19.1 creating new XCUITestDriver (v3.31.1) session [info] [Appium] Applying relaxed security to 'XCUITestDriver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure [debug] [BaseDriver] Creating session with MJSONWP desired capabilities: { [debug] [BaseDriver] "autoLaunch": false, [debug] [BaseDriver] "automationName": "xcuitest", [debug] [BaseDriver] "bundleId": "com.apple.Preferences", [debug] [BaseDriver] "carrierConnectivityOnly": "true", [debug] [BaseDriver] "deviceName": "AnyDevice", [debug] [BaseDriver] "fullReset": "false", [debug] [BaseDriver] "language": "en", [debug] [BaseDriver] "mjpegServerPort": 9100, [debug] [BaseDriver] "noReset": "true", [debug] [BaseDriver] "platformName": "iOS", [debug] [BaseDriver] "platformVersion": "12.2", [debug] [BaseDriver] "simpleIsVisibleCheck": true, [debug] [BaseDriver] "udid": "auto", [debug] [BaseDriver] "useJSONSource": true, [debug] [BaseDriver] "useNewWDA": true, [debug] [BaseDriver] "wdaStartupRetries": 5, [debug] [BaseDriver] "wdaStartupRetryInterval": "1000", [debug] [BaseDriver] "newCommandTimeout": 0, [debug] [BaseDriver] "connectHardwareKeyboard": true [debug] [BaseDriver] } [warn] [BaseDriver] Capability 'noReset' changed from string to boolean. This may cause unexpected behavior [warn] [BaseDriver] Capability 'fullReset' changed from string to boolean. This may cause unexpected behavior [warn] [BaseDriver] Capability 'wdaStartupRetryInterval' changed from string ('1000') to integer (1000). This may cause unexpected behavior [warn] [BaseDriver] The following capabilities were provided, but are not recognized by Appium: [warn] [BaseDriver] carrierConnectivityOnly [info] [BaseDriver] Session created with session id: 01f2bbda-6770-40d9-95bc-b1216106ec11 [debug] [XCUITest] Current user: 'krish' [debug] [XCUITest] Auto-detecting real device udid... [debug] [XCUITest] Detected real device udid: '00008101-001C15A20AD2001E' [debug] [XCUITest] Creating iDevice object with udid '00008101-001C15A20AD2001E' [info] [XCUITest] Determining device to run tests on: udid: '00008101-001C15A20AD2001E', real device: true [debug] [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1614210652116 (18:50:52 GMT-0500 (Eastern Standard Time)) [debug] [BaseDriver] Event 'appConfigured' logged at 1614210652116 (18:50:52 GMT-0500 (Eastern Standard Time)) [debug] [BaseDriver] Event 'resetStarted' logged at 1614210652117 (18:50:52 GMT-0500 (Eastern Standard Time)) [debug] [XCUITest] Reset: fullReset not set. Leaving as is [debug] [BaseDriver] Event 'resetComplete' logged at 1614210652117 (18:50:52 GMT-0500 (Eastern Standard Time)) [info] [WebDriverAgent] Using WDA path: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent' [info] [WebDriverAgent] Using WDA agent: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj'[debug] [XCUITest] Crash reports root '/Users/krish/Library/Logs/CrashReporter/MobileDevice/iPhone 12 Pro' does not exist. Got nothing to gather. [debug] [BaseDriver] Event 'logCaptureStarted' logged at 1614210652322 (18:50:52 GMT-0500 (Eastern Standard Time)) [info] [XCUITest] Setting up real device[debug] [WebDriverAgent] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found [info] [DevCon Factory] Requesting connection for device 00008101-001C15A20AD2001E on local port 8100, device port 8100 [debug] [DevCon Factory] Cached connections count: 1 [info] [DevCon Factory] Found cached connections on port #8100: ["00008101-001C15A20AD2001E:8100"] [warn] [DevCon Factory] Port #8100 is busy. Did you quit the previous driver session(s) properly? [info] [DevCon Factory] Trying to release the port [info] [DevCon Factory] Releasing the listener for '00008101-001C15A20AD2001E:8100' [debug] [iProxy@00008101:8100] Closing the connection [info] [iProxy@00008101:8100] The connection has been closed [info] [DevCon Factory] Port #8100 has been successfully released after 2ms [info] [DevCon Factory] Successfully requested the connection for 00008101-001C15A20AD2001E:8100 [debug] [XCUITest] Starting WebDriverAgent initialization with the synchronization key 'XCUITestDriver' [debug] [XCUITest] Capability 'useNewWDA' set to true, so uninstalling WDA before proceeding [info] [WebDriverAgent] Shutting down sub-processes[info] [HTTP] --> GET /wd/hub/sessions [info] [HTTP] {} [debug] [GENERIC] Calling AppiumDriver.getSessions() with args: [] [debug] [GENERIC] Responding to client with driver.getSessions() result: [] [info] [HTTP] <-- GET /wd/hub/sessions 200 2 ms - 40 [info] [HTTP] [debug] [WebDriverAgent] Uninstalling WDAs: 'com.facebook.WebDriverAgentRunner.xctrunner'[debug] [BaseDriver] Event 'wdaUninstalled' logged at 1614210653176 (18:50:53 GMT-0500 (Eastern Standard Time)) [debug] [XCUITest] Trying to start WebDriverAgent 5 times with 1000ms interval [debug] [BaseDriver] Event 'wdaStartAttempted' logged at 1614210653177 (18:50:53 GMT-0500 (Eastern Standard Time)) [info] [WebDriverAgent] Launching WebDriverAgent on the device [info] [WebDriverAgent] Fetching dependencies [info] [WebDriverAgent] Dependencies up-to-date [debug] [WebDriverAgent] Killing running processes 'xcodebuild.*00008101-001C15A20AD2001E' for the device 00008101-001C15A20AD2001E...[debug] [WebDriverAgent] 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] [WebDriverAgent] Output from xcodebuild will only be logged if any errors are present there. To change this, use 'showXcodeLog' desired capability[debug] [WebDriverAgent] Waiting up to 60000ms for WebDriverAgent to start [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body [debug] [iProxy@00008101:8100] Connection was refused to port 8100 [info] [WD Proxy] socket hang up[debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body [debug] [iProxy@00008101:8100] Connection was refused to port 8100 [info] [WD Proxy] socket hang up[debug] [WebDriverAgent] 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] [WebDriverAgent] Parsed BUILD_DIR configuration value: '/Users/krish/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Build/Products' [debug] [WebDriverAgent] Got derived data root: '/Users/krish/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp'[debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body [debug] [iProxy@00008101:8100] Connection was refused to port 8100 [info] [WD Proxy] socket hang up[debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body [debug] [iProxy@00008101:8100] Connection was refused to port 8100 [info] [WD Proxy] socket hang up[debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body [debug] [WD Proxy] 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] [WebDriverAgent] WebDriverAgent information: [debug] [WebDriverAgent] { [debug] [WebDriverAgent] "message": "WebDriverAgent is ready to accept commands", [debug] [WebDriverAgent] "state": "success", [debug] [WebDriverAgent] "os": { [debug] [WebDriverAgent] "testmanagerdVersion": 28, [debug] [WebDriverAgent] "name": "iOS", [debug] [WebDriverAgent] "sdkVersion": "14.2", [debug] [WebDriverAgent] "version": "14.2.1" [debug] [WebDriverAgent] }, [debug] [WebDriverAgent] "ios": { [debug] [WebDriverAgent] "ip": "169.254.97.199" [debug] [WebDriverAgent] }, [debug] [WebDriverAgent] "ready": true, [debug] [WebDriverAgent] "build": { [debug] [WebDriverAgent] "upgradedAt": "1611943673417", [debug] [WebDriverAgent] "time": "Feb 22 2021 15:23:03", [debug] [WebDriverAgent] "productBundleIdentifier": "com.facebook.WebDriverAgentRunner" [debug] [WebDriverAgent] } [debug] [WebDriverAgent] } [debug] [WebDriverAgent] WebDriverAgent successfully started after 5579ms [debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1614210659125 (18:50:59 GMT-0500 (Eastern Standard Time)) [debug] [XCUITest] Sending createSession command to WDA [debug] [WD Proxy] Matched '/session' to command name 'createSession' [debug] [WD Proxy] 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] [WD Proxy] 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] [WD Proxy] Determined the downstream protocol as 'W3C' [debug] [BaseDriver] Event 'wdaSessionStarted' logged at 1614210659222 (18:50:59 GMT-0500 (Eastern Standard Time)) [debug] [BaseDriver] Event 'wdaStarted' logged at 1614210659222 (18:50:59 GMT-0500 (Eastern Standard Time)) [info] [XCUITest] Skipping setting of the initial display orientation. Set the "orientation" capability to either "LANDSCAPE" or "PORTRAIT", if this is an undesired behavior. [debug] [BaseDriver] Event 'orientationSet' logged at 1614210659222 (18:50:59 GMT-0500 (Eastern Standard Time)) [debug] [WD Proxy] Matched '/appium/settings' to command name 'updateSettings' [debug] [WD Proxy] 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] [WD Proxy] 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] [BaseDriver] The value of 'elementResponseAttributes' setting did not change. Skipping the update for it [debug] [BaseDriver] The value of 'shouldUseCompactResponses' setting did not change. Skipping the update for it [info] [Appium] New XCUITestDriver session created successfully, session 01f2bbda-6770-40d9-95bc-b1216106ec11 added to master session list [debug] [BaseDriver] Event 'newSessionStarted' logged at 1614210659232 (18:50:59 GMT-0500 (Eastern Standard Time)) [debug] [MJSONWP (01f2bbda)] Cached the protocol value 'MJSONWP' for the new session 01f2bbda-6770-40d9-95bc-b1216106ec11 [debug] [MJSONWP (01f2bbda)] 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] [HTTP] <-- POST /wd/hub/session 200 7155 ms - 734 [info] [HTTP] [info] [HTTP] --> GET /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/contexts [info] [HTTP] {} [debug] [MJSONWP (01f2bbda)] Calling AppiumDriver.getContexts() with args: ["01f2bbda-6770-40d9-95bc-b1216106ec11"] [debug] [XCUITest] Executing command 'getContexts' [debug] [XCUITest] Getting list of available contexts [debug] [iOS] Retrieving contexts and views [debug] [XCUITest] Selecting by url: false [info] [RemoteDebugger] Remote Debugger version 8.13.2 [debug] [RemoteDebugger] useNewSafari --> false [debug] [RemoteDebugger] Checking which communication style to use (non-Safari on platform version '12.2') [debug] [RemoteDebugger] Platform version equal or higher than '12.2': true [warn] [RemoteDebugger] Setting communication protocol: using Target-based communication [debug] [RemoteDebugger] Sending connection key request [debug] [RemoteDebugger] Sending '_rpc_reportIdentifier:' message (id: 0): 'setConnectionKey' [debug] [RemoteDebugger] Sending to Web Inspector took 4ms [debug] [RemoteDebugger] Sending connection key request [debug] [RemoteDebugger] Sending '_rpc_reportIdentifier:' message (id: 2): 'setConnectionKey' [debug] [RemoteDebugger] Sending to Web Inspector took 4ms [debug] [RemoteDebugger] Selecting application [debug] [RemoteDebugger] No applications currently connected. [debug] [XCUITest] No web frames found. [debug] [MJSONWP (01f2bbda)] Responding to client with driver.getContexts() result: ["NATIVE_APP"] [info] [HTTP] <-- GET /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/contexts 200 139 ms - 86 [info] [HTTP] [info] [HTTP] --> GET /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/context [info] [HTTP] {} [debug] [MJSONWP (01f2bbda)] Calling AppiumDriver.getCurrentContext() with args: ["01f2bbda-6770-40d9-95bc-b1216106ec11"] [debug] [XCUITest] Executing command 'getCurrentContext' [debug] [MJSONWP (01f2bbda)] Responding to client with driver.getCurrentContext() result: "NATIVE_APP" [info] [HTTP] <-- GET /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/context 200 2 ms - 84 [info] [HTTP]  [info] [HTTP] --> GET /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11 [info] [HTTP] {} [debug] [MJSONWP (01f2bbda)] Calling AppiumDriver.getSession() with args: ["01f2bbda-6770-40d9-95bc-b1216106ec11"] [debug] [XCUITest] Executing command 'getSession' [debug] [WD Proxy] Matched '/' to command name 'getSession' [debug] [WD Proxy] Proxying [GET /] to [GET http://127.0.0.1:8100/session/AE8EB6FF-7B39-4711-AF0A-648D9218346C] with no body [debug] [WD Proxy] 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] [WD Proxy] Proxying [GET /wda/screen] to [GET http://127.0.0.1:8100/session/AE8EB6FF-7B39-4711-AF0A-648D9218346C/wda/screen] with no body[debug] [WD Proxy] Got response with status 200: {"value":{"statusBarSize":{"width":390,"height":47},"scale":3},"sessionId":"AE8EB6FF-7B39-4711-AF0A-648D9218346C"} [debug] [WD Proxy] Proxying [GET /window/size] to [GET http://127.0.0.1:8100/session/AE8EB6FF-7B39-4711-AF0A-648D9218346C/window/size] with no body [debug] [WD Proxy] Got response with status 200: {"value":{"width":390,"height":844},"sessionId":"AE8EB6FF-7B39-4711-AF0A-648D9218346C"} [info] [XCUITest] Merging WDA caps over Appium caps for session detail response [debug] [MJSONWP (01f2bbda)] 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] [HTTP] <-- GET /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11 200 331 ms - 717 [info] [HTTP]  [info] [HTTP] --> GET /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/window/current/size [info] [HTTP] {} [debug] [MJSONWP (01f2bbda)] Calling AppiumDriver.getWindowSize() with args: ["current","01f2bbda-6770-40d9-95bc-b1216106ec11"] [debug] [XCUITest] Executing command 'getWindowSize' [debug] [WD Proxy] Proxying [GET /window/size] to [GET http://127.0.0.1:8100/session/AE8EB6FF-7B39-4711-AF0A-648D9218346C/window/size] with no body [debug] [WD Proxy] Got response with status 200: {"value":{"width":390,"height":844},"sessionId":"AE8EB6FF-7B39-4711-AF0A-648D9218346C"} [debug] [MJSONWP (01f2bbda)] Responding to client with driver.getWindowSize() result: {"width":390,"height":844} [info] [HTTP] <-- GET /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/window/current/size 200 63 ms - 98 [info] [HTTP]  [info] [HTTP] --> POST /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/execute [info] [HTTP] {"script":"mobile:getContexts","args":[]} [debug] [MJSONWP (01f2bbda)] Calling AppiumDriver.execute() with args: ["mobile:getContexts",[],"01f2bbda-6770-40d9-95bc-b1216106ec11"] [debug] [XCUITest] Executing command 'execute' [debug] [XCUITest] Getting list of available contexts [debug] [iOS] Retrieving contexts and views [debug] [XCUITest] Selecting by url: false [debug] [RemoteDebugger] Sending connection key request [debug] [RemoteDebugger] Sending '_rpc_reportIdentifier:' message (id: 4): 'setConnectionKey' [debug] [RemoteDebugger] Sending to Web Inspector took 3ms [debug] [RemoteDebugger] Selecting application [debug] [RemoteDebugger] No applications currently connected. [debug] [XCUITest] No web frames found. [debug] [XCUITest] No webviews found in 4ms [debug] [MJSONWP (01f2bbda)] Responding to client with driver.execute() result: [{"id":"NATIVE_APP"}] [info] [HTTP] <-- POST /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/execute 200 5 ms - 93 [info] [HTTP]  [info] [HTTP] --> GET /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/source [info] [HTTP] {} [debug] [MJSONWP (01f2bbda)] Calling AppiumDriver.getPageSource() with args: ["01f2bbda-6770-40d9-95bc-b1216106ec11"] [debug] [XCUITest] Executing command 'getPageSource' [debug] [WD Proxy] Matched '/source?format=json' to command name 'getPageSource' [debug] [WD Proxy] 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] [WD Proxy] 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] [MJSONWP (01f2bbda)] 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] [HTTP] <-- GET /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/source 200 958 ms - 29589 [info] [HTTP]  [info] [HTTP] --> GET /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/screenshot [info] [HTTP] {} [debug] [MJSONWP (01f2bbda)] Calling AppiumDriver.getScreenshot() with args: ["01f2bbda-6770-40d9-95bc-b1216106ec11"] [debug] [XCUITest] Executing command 'getScreenshot' [debug] [XCUITest] Taking screenshot with WDA [debug] [WD Proxy] Matched '/screenshot' to command name 'getScreenshot' [debug] [WD Proxy] Proxying [GET /screenshot] to [GET http://127.0.0.1:8100/session/AE8EB6FF-7B39-4711-AF0A-648D9218346C/screenshot] with no body[debug] [WD Proxy] 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] [MJSONWP (01f2bbda)] 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] [HTTP] <-- GET /wd/hub/session/01f2bbda-6770-40d9-95bc-b1216106ec11/screenshot 200 495 ms - 4075002 [info] [HTTP] 

Veeru5c4 commented 3 years ago

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 predicateexists == 1for object Application 'com.apple.mobilesafari'

Veeru5c4 commented 3 years ago

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. (/Users/xxx/Projects/mcloud-ios/stf/lib/wire/router.js:35:12) at emitTwo (events.js:131:20) at exports.Socket.emit (events.js:214:7) at exports.Socket.Socket._flushRead (/Users/xxxx/Projects/mcloud-ios/stf/node_modules/zmq/lib/index.js:638:15) at exports.Socket.Socket._flushReads (/Users/xxxx/Projects/mcloud-ios/stf/node_modules/zmq/lib/index.js:676:23) at Object._zmq.onReadReady (/Users/xxxx/Projects/mcloud-ios/stf/node_modules/zmq/lib/index.js:297:10)

KazuCocoa commented 3 years ago

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.)