appium/appium-inspector

bug: <Appium inspector takes 2 or 3 minutes to load a page and sometimes hangs while loading a page>

AksharaGMS opened this issue · 12 comments

Is this an issue specifically with Appium Inspector?

  • I have verified that my issue does not occur with Appium, and should be investigated as an Appium Inspector issue

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Appium inspector App version: 2024.2.2
Platform: UWP
OS: Windows 10 pro

Current behavior: I am trying to simulate a native app using Appium Inspector, but the UI pages load very slowly. Sometimes, the loading process continues indefinitely, forcing me to close the inspector. This issue also occurs when I click the refresh button. When I attempt to load a specific page in Appium Inspector and click refresh, it either loads the page after a long delay or continues to load without success.

Expected Behavior

Appium Inspector should load the page quickly and the refresh button should refresh the page promptly.

Operating System

Windows

Appium Inspector Version

2024.2.2

Appium Version

2.4.1

Further Information

No response

Please provide your Appium server log.
Also I would advise to try again with version 2024.3.4, as it includes performance improvements specifically when retrieving the page source.

I am using version 2024.3.4 but still I am facing the same issue.

As mentioned above - please provide your Appium server log.

**As needed, this is the server log below. **

[AndroidUiautomator2Driver@7b50 (137df6af)] Driver proxy active, passing request on via HTTP proxy
[AndroidUiautomator2Driver@7b50 (137df6af)] Matched '/session/137df6af-c707-4977-a996-6cd431a500eb/source' to command name 'getPageSource'
[AndroidUiautomator2Driver@7b50 (137df6af)] Proxying [GET /session/137df6af-c707-4977-a996-6cd431a500eb/source] to [GET http://127.0.0.1:8200/session/1a489a08-8e80-4099-883d-de4198da1e95/source] with no body
[AndroidUiautomator2Driver@7b50 (137df6af)] Got response with status 404: {"sessionId":"1a489a08-8e80-4099-883d-de4198da1e95","value":{"error":"invalid session id","message":"The session identified by 1a489a08-8e80-4099-883d-de4198da1e95 is not known","stacktrace":"io.appium.uiautomator2.common.exceptions.NoSuchDriverException: The session identified by 1a489a08-8e80-4099-883d-de4198da1e95 is not known\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:54)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:259)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:253)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:77)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:3...
[W3C] Matched W3C error code 'invalid session id' to NoSuchDriverError
[HTTP] <-- GET /session/137df6af-c707-4977-a996-6cd431a500eb/source 404 67 ms - 3692

Screenshot of appium inspector keep on loading-
image

Your issue may be a duplicate of #1364. Try restarting both your device and the Appium server.

Your issue may be a duplicate of #1364. Try restarting both your device and the Appium server.

I have tried this several times, but it is not working, can you please suggest any other way?

It is keep on loading after lunching the application in emulator, this is the log below while loading

[HTTP] --> GET /session/3ed88efa-5645-4be7-bfbe-e72029c19d7d/timeouts
[HTTP] {}
[AndroidUiautomator2Driver@2cab (3ed88efa)] Calling AppiumDriver.getTimeouts() with args: ["3ed88efa-5645-4be7-bfbe-e72029c19d7d"]
[AndroidUiautomator2Driver@2cab (3ed88efa)] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[HTTP] <-- GET /session/3ed88efa-5645-4be7-bfbe-e72029c19d7d/timeouts 200 7 ms - 42
[HTTP]
[HTTP] --> GET /session/3ed88efa-5645-4be7-bfbe-e72029c19d7d/timeouts
[HTTP] {}
[AndroidUiautomator2Driver@2cab (3ed88efa)] Calling AppiumDriver.getTimeouts() with args: ["3ed88efa-5645-4be7-bfbe-e72029c19d7d"]
[AndroidUiautomator2Driver@2cab (3ed88efa)] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[HTTP] <-- GET /session/3ed88efa-5645-4be7-bfbe-e72029c19d7d/timeouts 304 8 ms - -

After entering the refresh button the log is as below,

Got response with status 404: {"sessionId":"392570b8-1ada-4727-8f63-a6203d20ed35","value":{"error":"invalid session id","message":"The session identified by 392570b8-1ada-4727-8f63-a6203d20ed35 is not known","stacktrace":"io.appium.uiautomator2.common.exceptions.NoSuchDriverException: The session identified by 392570b8-1ada-4727-8f63-a6203d20ed35 is not known\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:54)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:259)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:253)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:77)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:3...
[W3C] Matched W3C error code 'invalid session id' to NoSuchDriverError

Please provide the full log.

Please provide your Appium server log. Also I would advise to try again with version 2024.3.4, as it includes performance improvements specifically when retrieving the page source.

This version is working for me in terms of performance, thanks!

Please provide the full log.

Calling AppiumDriver.createSession() with args: [{"platformName":"Android","appium:platformVersion":"14","appium:deviceName":"Pixel_3a","appium:app":"C:\Users\Sambit Nayak\Downloads\athmanirbar.apk","appium:automationName":"UiAutomator2","appium:ensureWebviewsHavePages":true,"appium:nativeWebScreenshot":true,"appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},null,{"alwaysMatch":{"platformName":"Android","appium:platformVersion":"14","appium:deviceName":"Pixel_3a","appium:app":"C:\Users\Sambit Nayak\Downloads\athmanirbar.apk","appium:automationName":"UiAutomator2","appium:ensureWebviewsHavePages":true,"appium:nativeWebScreenshot":true,"appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},"firstMatch":[{}]}]
[AppiumDriver@25de] Event 'newSessionRequested' logged at 1716436586671 (09:26:26 GMT+0530 (India Standard Time))
[Appium] Attempting to find matching driver for automationName 'UiAutomator2' and platformName 'Android'
[Appium] The 'uiautomator2' driver was installed and matched caps.
[Appium] Will require it at C:\Users\Sambit Nayak\node_modules\appium-uiautomator2-driver
[Appium] Requiring driver at C:\Users\Sambit Nayak\node_modules\appium-uiautomator2-driver\build\index.js
[AppiumDriver@25de] Appium v2.5.4 creating new AndroidUiautomator2Driver (v3.5.0) session
[AppiumDriver@25de] Checking BaseDriver versions for Appium and AndroidUiautomator2Driver
[AppiumDriver@25de] Appium's BaseDriver version is 9.6.0
[AppiumDriver@25de] AndroidUiautomator2Driver's BaseDriver version is 9.6.0
[AndroidUiautomator2Driver@506b] Creating session with W3C capabilities: {
[AndroidUiautomator2Driver@506b] "alwaysMatch": {
[AndroidUiautomator2Driver@506b] "platformName": "Android",
[AndroidUiautomator2Driver@506b] "appium:platformVersion": "14",
[AndroidUiautomator2Driver@506b] "appium:deviceName": "Pixel_3a",
[AndroidUiautomator2Driver@506b] "appium:app": "C:\Users\Sambit Nayak\Downloads\athmanirbar.apk",
[AndroidUiautomator2Driver@506b] "appium:automationName": "UiAutomator2",
[AndroidUiautomator2Driver@506b] "appium:ensureWebviewsHavePages": true,
[AndroidUiautomator2Driver@506b] "appium:nativeWebScreenshot": true,
[AndroidUiautomator2Driver@506b] "appium:newCommandTimeout": 3600,
[AndroidUiautomator2Driver@506b] "appium:connectHardwareKeyboard": true
[AndroidUiautomator2Driver@506b] },
[AndroidUiautomator2Driver@506b] "firstMatch": [
[AndroidUiautomator2Driver@506b] {}
[AndroidUiautomator2Driver@506b] ]
[AndroidUiautomator2Driver@506b] }
[AndroidUiautomator2Driver@506b] The following provided capabilities were not recognized by this driver:
[AndroidUiautomator2Driver@506b] connectHardwareKeyboard
[AndroidUiautomator2Driver@506b (8a3b23ed)] Session created with session id: 8a3b23ed-2f19-4ec9-b471-205b224f298f
[ADB] Found 1 'build-tools' folders under 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk' (newest first):
[ADB] C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\build-tools\34.0.0
[ADB] Using 'adb.exe' from 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe'
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 start-server'
[AndroidUiautomator2Driver@506b (8a3b23ed)] Retrieving device list
[ADB] Trying to find connected Android devices
[ADB] Getting connected devices
[ADB] Connected devices: [{"udid":"emulator-5554","state":"device"}]
[AndroidUiautomator2Driver@506b (8a3b23ed)] Looking for a device with Android '14.0.0'
[ADB] Setting device id to emulator-5554
[ADB] Getting device platform version
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.release'
[ADB] Current device property 'ro.build.version.release': 14
[AndroidUiautomator2Driver@506b (8a3b23ed)] Using device: emulator-5554
[ADB] Using 'adb.exe' from 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe'
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 start-server'
[ADB] Setting device id to emulator-5554
[BaseDriver] Using local app 'C:\Users\Sambit Nayak\Downloads\athmanirbar.apk'
[AndroidUiautomator2Driver@506b (8a3b23ed)] Checking whether app is actually present
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk'
[ADB] Current device property 'ro.build.version.sdk': 34
[ADB] Getting device platform version
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.release'
[ADB] Current device property 'ro.build.version.release': 14
[ADB] Device API level: 34
[AndroidUiautomator2Driver@506b (8a3b23ed)] Relaxing hidden api policy
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'settings put global hidden_api_policy_pre_p_apps 1;settings put global hidden_api_policy_p_apps 1;settings put global hidden_api_policy 1''
[AndroidUiautomator2Driver@506b (8a3b23ed)] Parsing package and activity from app manifest
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 wait-for-device'
[ADB] Package name: 'com.elait.athmanirbar_mobile'
[ADB] Main activity name: 'com.elait.athmanirbar_mobile.MainActivity'
[AndroidUiautomator2Driver@506b (8a3b23ed)] Parsed package and activity are: com.elait.athmanirbar_mobile/com.elait.athmanirbar_mobile.MainActivity
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell echo ping'
[AndroidUiautomator2Driver@506b (8a3b23ed)] Pushing settings apk to the device...
[ADB] Getting package info for 'io.appium.settings'
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings'
[ADB] The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('5.8.1' >= '5.8.1')
[ADB] There is no need to install/upgrade 'C:\Users\Sambit Nayak\node_modules\appium-uiautomator2-driver\node_modules\io.appium.settings\apks\settings_apk-debug.apk'
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys activity services io.appium.settings'
[AndroidUiautomator2Driver@506b (8a3b23ed)] io.appium.settings is already running. There is no need to reset its permissions.
[Logcat] Starting logs capture with command: 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe' -P 5037 -s emulator-5554 logcat -v threadtime
[AndroidUiautomator2Driver@506b (8a3b23ed)] Forwarding UiAutomator2 Server port 6790 to local port 8200
[ADB] Forwarding system: 8200 to device: 6790
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward tcp:8200 tcp:6790'
[ADB] Getting package info for 'io.appium.uiautomator2.server'
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server'
[ADB] Getting install status for io.appium.uiautomator2.server.test
[ADB] Checking app cert for C:\Users\Sambit Nayak\Downloads\athmanirbar.apk
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell cmd package list packages'
[ADB] Using 'apksigner.jar' from 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\build-tools\34.0.0\lib\apksigner.jar'
[ADB] Starting apksigner: 'C:\Program Files\Java\jdk-20\bin\java.exe' -Xmx1024M -Xss1m -jar 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\build-tools\34.0.0\lib\apksigner.jar' verify --print-certs 'C:\Users\Sambit Nayak\Downloads\athmanirbar.apk'
[HTTP] --> GET /sessions
[HTTP] {}
[AppiumDriver@25de] Calling AppiumDriver.getSessions() with args: []
[AppiumDriver@25de] Responding to client with driver.getSessions() result: []
[HTTP] <-- GET /sessions 304 11 ms - -
[HTTP]
[ADB] 'io.appium.uiautomator2.server.test' is installed
[ADB] apksigner stdout: Signer #1 certificate DN: C=US, O=Android, CN=Android Debug
[ADB] Signer #1 certificate SHA-256 digest: 68e9cb029e0c9b64713d49988d7f2b7a6d92ec42f42665e1704a0b0d200577a1
[ADB] Signer #1 certificate SHA-1 digest: 362dab2d3cd3211b4ccd0058780072d0fd40bc27
[ADB] Signer #1 certificate MD5 digest: 7da074535af961b8931afff587887ae7
[ADB]
[ADB] 'C:\Users\Sambit Nayak\Downloads\athmanirbar.apk' is signed with a non-default certificate
[ADB] Getting package info for 'com.elait.athmanirbar_mobile'
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package com.elait.athmanirbar_mobile'
[ADB] The version name of the installed 'com.elait.athmanirbar_mobile' is greater or equal to the application version name ('1.0.0' >= '1.0.0')
[ADB] There is no need to install/upgrade 'C:\Users\Sambit Nayak\Downloads\athmanirbar.apk'
[AndroidUiautomator2Driver@506b (8a3b23ed)] Performing fast reset on 'com.elait.athmanirbar_mobile'
[ADB] Getting install status for com.elait.athmanirbar_mobile
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell cmd package list packages'
[ADB] 'com.elait.athmanirbar_mobile' is installed
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop com.elait.athmanirbar_mobile'
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm clear com.elait.athmanirbar_mobile'
[ADB] The version name of the installed 'io.appium.uiautomator2.server' is greater or equal to the application version name ('7.0.7' >= '7.0.7')
[AndroidUiautomator2Driver@506b (8a3b23ed)] Server packages status: [{"installState":"sameVersionInstalled","appPath":"C:\Users\Sambit Nayak\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v7.0.7.apk","appId":"io.appium.uiautomator2.server"},{"installState":"sameVersionInstalled","appPath":"C:\Users\Sambit Nayak\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk","appId":"io.appium.uiautomator2.server.test"}]
[AndroidUiautomator2Driver@506b (8a3b23ed)] Server packages are not going to be (re)installed
[AndroidUiautomator2Driver@506b (8a3b23ed)] Waiting up to 30000ms for services to be available
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm list instrumentation'
[AndroidUiautomator2Driver@506b (8a3b23ed)] Instrumentation target 'io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner' is available
[ADB] Adding packages ["io.appium.settings","io.appium.uiautomator2.server","io.appium.uiautomator2.server.test"] to Doze whitelist
[ADB] Got the following command chunks to execute: [["dumpsys","deviceidle","whitelist","+io.appium.settings",";","dumpsys","deviceidle","whitelist","+io.appium.uiautomator2.server",";","dumpsys","deviceidle","whitelist","+io.appium.uiautomator2.server.test",";"]]
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys deviceidle whitelist +io.appium.settings ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server ; dumpsys deviceidle whitelist +io.appium.uiautomator2.server.test ;'
[AndroidUiautomator2Driver@506b (8a3b23ed)] Performed fast reset on the installed 'com.elait.athmanirbar_mobile' application (stop and clear)
[AndroidUiautomator2Driver@506b (8a3b23ed)] Performing shallow cleanup of automation leftovers
[AndroidUiautomator2Driver@506b (8a3b23ed)] No obsolete sessions have been detected (timeout of 500ms exceeded)
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.uiautomator2.server.test'
[AndroidUiautomator2Driver@506b (8a3b23ed)] The io.appium.uiautomator2.server.test process might fail to stop within 3000ms timeout.
[AndroidUiautomator2Driver@506b (8a3b23ed)] Starting UIAutomator2 server 7.0.7
[AndroidUiautomator2Driver@506b (8a3b23ed)] Using UIAutomator2 server from 'C:\Users\Sambit Nayak\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v7.0.7.apk' and test from 'C:\Users\Sambit Nayak\node_modules\appium-uiautomator2-driver\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk'
[AndroidUiautomator2Driver@506b (8a3b23ed)] Waiting up to 30000ms for UiAutomator2 to be online...
[ADB] Creating ADB subprocess with args: ["-P","5037","-s","emulator-5554","shell","am","instrument","-w","-e","disableAnalytics","true","io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner"]
[AndroidUiautomator2Driver@506b (8a3b23ed)] Matched '/status' to command name 'getStatus'
[AndroidUiautomator2Driver@506b (8a3b23ed)] Proxying [GET /status] to [GET http://127.0.0.1:8200/status] with no body
[AndroidUiautomator2Driver@506b (8a3b23ed)] Got response with status 200: {"sessionId":"None","value":{"message":"UiAutomator2 Server is ready to accept commands","ready":true}}
[AndroidUiautomator2Driver@506b (8a3b23ed)] The initialization of the instrumentation process took 68ms
[AndroidUiautomator2Driver@506b (8a3b23ed)] Matched '/session' to command name 'createSession'
[AndroidUiautomator2Driver@506b (8a3b23ed)] Proxying [POST /session] to [POST http://127.0.0.1:8200/session] with body: {"capabilities":{"firstMatch":[{"platformName":"Android","platformVersion":"14","deviceName":"emulator-5554","app":"C:\Users\Sambit Nayak\Downloads\athmanirbar.apk","automationName":"UiAutomator2","ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"newCommandTimeout":3600,"connectHardwareKeyboard":true,"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","platformVersion":"14","deviceName":"Pixel_3a","app":"C:\Users\Sambit Nayak\Downloads\athmanirbar.apk","automationName":"UiAutomator2","ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"newCommandTimeout":3600,"connectHardwareKeyboard":true},"deviceUDID":"emulator-5554","appPackage":"com.elait.athmanirbar_mobile"}],"alwaysMatch":{}}}
[AndroidUiautomator2Driver@506b (8a3b23ed)] Got response with status 200: {"sessionId":"64f2f21d-7f8a-483b-bfc0-f64718d8c53b","value":{"capabilities":{"firstMatch":[{"platformName":"Android","platformVersion":"14","deviceName":"emulator-5554","app":"C:\Users\Sambit Nayak\Downloads\athmanirbar.apk","automationName":"UiAutomator2","ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"newCommandTimeout":3600,"connectHardwareKeyboard":true,"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","platformVersion":"14","deviceName":"Pixel_3a","app":"C:\Users\Sambit Nayak\Downloads\athmanirbar.apk","automationName":"UiAutomator2","ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"newCommandTimeout":3600,"connectHardwareKeyboard":true},"deviceUDID":"emulator-5554","appPackage":"com.elait.athmanirbar_mobile"}],"alwaysMatch":{}},"sessionId":"64f2f21d-7f8a-483b-bfc0-f64718d8c53b"}}
[AndroidUiautomator2Driver@506b (8a3b23ed)] Determined the downstream protocol as 'W3C'
[AndroidUiautomator2Driver@506b (8a3b23ed)] Proxying [GET /appium/device/pixel_ratio] to [GET http://127.0.0.1:8200/session/64f2f21d-7f8a-483b-bfc0-f64718d8c53b/appium/device/pixel_ratio] with no body
[AndroidUiautomator2Driver@506b (8a3b23ed)] Matched '/appium/device/system_bars' to command name 'getSystemBars'
[AndroidUiautomator2Driver@506b (8a3b23ed)] Proxying [GET /appium/device/system_bars] to [GET http://127.0.0.1:8200/session/64f2f21d-7f8a-483b-bfc0-f64718d8c53b/appium/device/system_bars] with no body
[AndroidUiautomator2Driver@506b (8a3b23ed)] Matched '/window/current/size' to command name 'getWindowSize'
[AndroidUiautomator2Driver@506b (8a3b23ed)] Proxying [GET /window/current/size] to [GET http://127.0.0.1:8200/session/64f2f21d-7f8a-483b-bfc0-f64718d8c53b/window/current/size] with no body
[AndroidUiautomator2Driver@506b (8a3b23ed)] Proxying [GET /appium/device/info] to [GET http://127.0.0.1:8200/session/64f2f21d-7f8a-483b-bfc0-f64718d8c53b/appium/device/info] with no body
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys window'
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys power'
[AndroidUiautomator2Driver@506b (8a3b23ed)] Got response with status 200: {"sessionId":"64f2f21d-7f8a-483b-bfc0-f64718d8c53b","value":{"statusBar":66}}
[AndroidUiautomator2Driver@506b (8a3b23ed)] Got response with status 200: {"sessionId":"64f2f21d-7f8a-483b-bfc0-f64718d8c53b","value":2.75}
[AndroidUiautomator2Driver@506b (8a3b23ed)] Got response with status 200: {"sessionId":"64f2f21d-7f8a-483b-bfc0-f64718d8c53b","value":{"height":2220,"width":1080}}
[AndroidUiautomator2Driver@506b (8a3b23ed)] Got response with status 200: {"sessionId":"64f2f21d-7f8a-483b-bfc0-f64718d8c53b","value":{"androidId":"dc403190cb167be1","apiVersion":"34","bluetooth":{"state":"ON"},"brand":"google","carrierName":"T-Mobile","displayDensity":440,"locale":"en_US","manufacturer":"Google","model":"sdk_gphone64_x86_64","networks":[{"capabilities":{"SSID":null,"linkDownBandwidthKbps":30000,"linkUpstreamBandwidthKbps":12000,"networkCapabilities":"NET_CAPABILITY_NOT_METERED,NET_CAPABILITY_INTERNET,NET_CAPABILITY_NOT_RESTRICTED,NET_CAPABILITY_TRUSTED,NET_CAPABILITY_NOT_VPN,NET_CAPABILITY_VALIDATED,NET_CAPABILITY_NOT_ROAMING,NET_CAPABILITY_FOREGROUND,NET_CAPABILITY_NOT_CONGESTED,NET_CAPABILITY_NOT_SUSPENDED","signalStrength":-50,"transportTypes":"TRANSPORT_WIFI"},"detailedState":"CONNECTED","extraInfo":"","isAvailable":true,"isConnected":true,"isFailover":false,"isRoaming":false,"state":"CONNECTED","subtype":-1,"subtypeName":"","type":1,"typeName":"WIFI"},{"capabilities":{"SSID":null,"linkDownBandwidthKbps":4300,"linkUpstreamBandwidthKbps":1800,"networkCapabil...
[AndroidUiautomator2Driver@506b (8a3b23ed)] Screen already unlocked, doing nothing
[AndroidUiautomator2Driver@506b (8a3b23ed)] Starting 'com.elait.athmanirbar_mobile/com.elait.athmanirbar_mobile.MainActivity and waiting for 'com.elait.athmanirbar_mobile/com.elait.athmanirbar_mobile.MainActivity'
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -W -n com.elait.athmanirbar_mobile/com.elait.athmanirbar_mobile.MainActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000'
[Instrumentation] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:
[ADB] Waiting up to 20000ms for activity matching pkg: 'com.elait.athmanirbar_mobile' and activity: 'com.elait.athmanirbar_mobile.MainActivity' to be focused
[ADB] Possible activities, to be checked: 'com.elait.athmanirbar_mobile.MainActivity', 'com.elait.athmanirbar_mobile.com.elait.athmanirbar_mobile.MainActivity'
[ADB] Getting focused package and activity
[ADB] Running 'C:\Users\Sambit Nayak\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys window displays'
[ADB] Found package: 'com.elait.athmanirbar_mobile' and fully qualified activity name : 'com.elait.athmanirbar_mobile.MainActivity'
[AppiumDriver@25de] New AndroidUiautomator2Driver session created successfully, session 8a3b23ed-2f19-4ec9-b471-205b224f298f added to master session list
[AppiumDriver@25de] Event 'newSessionStarted' logged at 1716436610117 (09:26:50 GMT+0530 (India Standard Time))
[AndroidUiautomator2Driver@506b (8a3b23ed)] Cached the protocol value 'W3C' for the new session 8a3b23ed-2f19-4ec9-b471-205b224f298f
[AndroidUiautomator2Driver@506b (8a3b23ed)] Responding to client with driver.createSession() result: {"capabilities":{"platformName":"Android","platformVersion":"14","deviceName":"emulator-5554","app":"C:\Users\Sambit Nayak\Downloads\athmanirbar.apk","automationName":"UiAutomator2","ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"newCommandTimeout":3600,"connectHardwareKeyboard":true,"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","platformVersion":"14","deviceName":"Pixel_3a","app":"C:\Users\Sambit Nayak\Downloads\athmanirbar.apk","automationName":"UiAutomator2","ensureWebviewsHavePages":true,"nativeWebScreenshot":true,"newCommandTimeout":3600,"connectHardwareKeyboard":true},"deviceUDID":"emulator-5554","appPackage":"com.elait.athmanirbar_mobile","pixelRatio":"2.75","statBarHeight":66,"viewportRect":{"left":0,"top":66,"width":1080,"height":2154},"deviceApiLevel":34,"deviceManufacturer":"Google","deviceModel"...
[HTTP] <-- POST /session 200 23453 ms - 1163
[HTTP]
[HTTP] --> GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/screenshot
[HTTP] {}
[AndroidUiautomator2Driver@506b (8a3b23ed)] Calling AppiumDriver.getScreenshot() with args: ["8a3b23ed-2f19-4ec9-b471-205b224f298f"]
[AndroidUiautomator2Driver@506b (8a3b23ed)] Matched '/screenshot' to command name 'getScreenshot'
[AndroidUiautomator2Driver@506b (8a3b23ed)] Proxying [GET /screenshot] to [GET http://127.0.0.1:8200/session/64f2f21d-7f8a-483b-bfc0-f64718d8c53b/screenshot] with no body
[AndroidUiautomator2Driver@506b (8a3b23ed)] socket hang up
[AndroidUiautomator2Driver@506b (8a3b23ed)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up
[AndroidUiautomator2Driver@506b (8a3b23ed)] at UIA2Proxy.command (C:\Users\Sambit Nayak\node_modules\appium-uiautomator2-driver\node_modules@appium\base-driver\lib\jsonwp-proxy\proxy.js:355:13)
[AndroidUiautomator2Driver@506b (8a3b23ed)] at processTicksAndRejections (node:internal/process/task_queues:95:5)
[AndroidUiautomator2Driver@506b (8a3b23ed)] at AndroidUiautomator2Driver.getScreenshot (C:\Users\Sambit Nayak\node_modules\appium-uiautomator2-driver\lib\commands\screenshot.js:42:5)
[HTTP] <-- GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/screenshot 500 41 ms - 790
[HTTP]
[HTTP] --> GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/window/rect
[HTTP] {}
[AndroidUiautomator2Driver@506b (8a3b23ed)] Calling AppiumDriver.getWindowRect() with args: ["8a3b23ed-2f19-4ec9-b471-205b224f298f"]
[AndroidUiautomator2Driver@506b (8a3b23ed)] Matched '/window/current/size' to command name 'getWindowSize'
[AndroidUiautomator2Driver@506b (8a3b23ed)] Proxying [GET /window/current/size] to [GET http://127.0.0.1:8200/session/64f2f21d-7f8a-483b-bfc0-f64718d8c53b/window/current/size] with no body
[AndroidUiautomator2Driver@506b (8a3b23ed)] socket hang up
[AndroidUiautomator2Driver@506b (8a3b23ed)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up
[AndroidUiautomator2Driver@506b (8a3b23ed)] at UIA2Proxy.command (C:\Users\Sambit Nayak\node_modules\appium-uiautomator2-driver\node_modules@appium\base-driver\lib\jsonwp-proxy\proxy.js:355:13)
[AndroidUiautomator2Driver@506b (8a3b23ed)] at processTicksAndRejections (node:internal/process/task_queues:95:5)
[AndroidUiautomator2Driver@506b (8a3b23ed)] at AndroidUiautomator2Driver.getWindowSize (C:\Users\Sambit Nayak\node_modules\appium-uiautomator2-driver\lib\commands\viewport.js:90:5)
[AndroidUiautomator2Driver@506b (8a3b23ed)] at AndroidUiautomator2Driver.getWindowRect (C:\Users\Sambit Nayak\node_modules\appium-uiautomator2-driver\lib\commands\viewport.js:61:27)
[HTTP] <-- GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/window/rect 500 20 ms - 938
[HTTP]
[HTTP] --> GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/source
[HTTP] {}
[AndroidUiautomator2Driver@506b (8a3b23ed)] Driver proxy active, passing request on via HTTP proxy
[AndroidUiautomator2Driver@506b (8a3b23ed)] Matched '/session/8a3b23ed-2f19-4ec9-b471-205b224f298f/source' to command name 'getPageSource'
[AndroidUiautomator2Driver@506b (8a3b23ed)] Proxying [GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/source] to [GET http://127.0.0.1:8200/session/64f2f21d-7f8a-483b-bfc0-f64718d8c53b/source] with no body
[AndroidUiautomator2Driver@506b (8a3b23ed)] socket hang up
[HTTP] <-- GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/source 400 15 ms - 1137
[HTTP]
[HTTP] --> GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts
[HTTP] {}
[AndroidUiautomator2Driver@506b (8a3b23ed)] Calling AppiumDriver.getTimeouts() with args: ["8a3b23ed-2f19-4ec9-b471-205b224f298f"]
[AndroidUiautomator2Driver@506b (8a3b23ed)] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[HTTP] <-- GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts 200 4 ms - 42
[HTTP]
[HTTP] --> GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts
[HTTP] {}
[AndroidUiautomator2Driver@506b (8a3b23ed)] Calling AppiumDriver.getTimeouts() with args: ["8a3b23ed-2f19-4ec9-b471-205b224f298f"]
[AndroidUiautomator2Driver@506b (8a3b23ed)] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[HTTP] <-- GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts 304 4 ms - -
[HTTP]
[HTTP] --> GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts
[HTTP] {}
[AndroidUiautomator2Driver@506b (8a3b23ed)] Calling AppiumDriver.getTimeouts() with args: ["8a3b23ed-2f19-4ec9-b471-205b224f298f"]
[AndroidUiautomator2Driver@506b (8a3b23ed)] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[HTTP] <-- GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts 304 3 ms - -
[HTTP]
[HTTP] --> GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts
[HTTP] {}
[AndroidUiautomator2Driver@506b (8a3b23ed)] Calling AppiumDriver.getTimeouts() with args: ["8a3b23ed-2f19-4ec9-b471-205b224f298f"]
[AndroidUiautomator2Driver@506b (8a3b23ed)] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[HTTP] <-- GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts 304 2 ms - -
[HTTP]
[HTTP] --> GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts
[HTTP] {}
[AndroidUiautomator2Driver@506b (8a3b23ed)] Calling AppiumDriver.getTimeouts() with args: ["8a3b23ed-2f19-4ec9-b471-205b224f298f"]
[AndroidUiautomator2Driver@506b (8a3b23ed)] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[HTTP] <-- GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts 304 2 ms - -
[HTTP]
[HTTP] --> GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts
[HTTP] {}
[AndroidUiautomator2Driver@506b (8a3b23ed)] Calling AppiumDriver.getTimeouts() with args: ["8a3b23ed-2f19-4ec9-b471-205b224f298f"]
[AndroidUiautomator2Driver@506b (8a3b23ed)] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[HTTP] <-- GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts 304 4 ms - -
[HTTP]
[HTTP] --> GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts
[HTTP] {}
[AndroidUiautomator2Driver@506b (8a3b23ed)] Calling AppiumDriver.getTimeouts() with args: ["8a3b23ed-2f19-4ec9-b471-205b224f298f"]
[AndroidUiautomator2Driver@506b (8a3b23ed)] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[HTTP] <-- GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts 304 6 ms - -
[HTTP]
[HTTP] --> GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts
[HTTP] {}
[AndroidUiautomator2Driver@506b (8a3b23ed)] Calling AppiumDriver.getTimeouts() with args: ["8a3b23ed-2f19-4ec9-b471-205b224f298f"]
[AndroidUiautomator2Driver@506b (8a3b23ed)] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[HTTP] <-- GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts 304 6 ms - -
[HTTP]
[HTTP] --> GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts
[HTTP] {}
[AndroidUiautomator2Driver@506b (8a3b23ed)] Calling AppiumDriver.getTimeouts() with args: ["8a3b23ed-2f19-4ec9-b471-205b224f298f"]
[AndroidUiautomator2Driver@506b (8a3b23ed)] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[HTTP] <-- GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts 304 7 ms - -
[HTTP]
[HTTP] --> GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts
[HTTP] {}
[AndroidUiautomator2Driver@506b (8a3b23ed)] Calling AppiumDriver.getTimeouts() with args: ["8a3b23ed-2f19-4ec9-b471-205b224f298f"]
[AndroidUiautomator2Driver@506b (8a3b23ed)] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[HTTP] <-- GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts 304 10 ms - -
[HTTP]
[HTTP] --> GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts
[HTTP] {}
[AndroidUiautomator2Driver@506b (8a3b23ed)] Calling AppiumDriver.getTimeouts() with args: ["8a3b23ed-2f19-4ec9-b471-205b224f298f"]
[AndroidUiautomator2Driver@506b (8a3b23ed)] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[HTTP] <-- GET /session/8a3b23ed-2f19-4ec9-b471-205b224f298f/timeouts 304 9 ms - -

This is the full log while the screenshot is kept on loading.

It seems like the connection between your emulator and the Appium server gets interrupted.

  • Does this issue also occur when running tests without the Inspector?
  • Is there perhaps a second active Appium session connected to this same emulator?
  • Please try to restart the emulator and try again

It seems like the connection between your emulator and the Appium server gets interrupted.

  • Does this issue also occur when running tests without the Inspector?
  • Is there perhaps a second active Appium session connected to this same emulator?
  • Please try to restart the emulator and try again

I have tried running without the inspector, but it fails. Could you please suggest a way to execute without an inspector?

  • I don't have any other active session connected to the same emulator.
  • I am trying this way (by restarting the emulator) as well, in result it gets succeeded sometimes but often fails.

If the issue also arises without the Inspector, then please report it at the main Appium repo and provide the above information.
Closing this as the original poster's issue has been resolved.