Ошибка загрузки WebDriver: The HTTP request to the remote WebDriver server for URL http://127.0.0.1:3001/wd/hub/session timed out after 60 seconds.

Добрый день! В общем, у меня около 10 телефона автоматизировано через Appium, полгода все было нормально, и после перезагрузки ПК все перестало работать, у всех девайсов сыпятся такие ошибки:

Выполнение действия CSharp OwnCode: The HTTP request to the remote WebDriver server for URL http://127.0.0.1:3001/wd/hub/session timed out after 60 seconds.

Попробовал 1 телефон запустить, та же ошибка…
Подскажите плиз, как решить эту проблему?

Хаб-то запустили?

да, по команде adb devices все девайсы подключены, команды через adb посылаются

Ошибка выглядит так как будто Appium не запущен.
Appium сервер запущен на котором драйвер будет стартовать ?

Да, запущен, вот лог

[Appium] Welcome to Appium v1.18.3
[Appium] Non-default server args:
[Appium]   address: 127.0.0.1
[Appium]   port: 3030
[Appium]   bootstrapPort: 6030
[Appium]   sessionOverride: true
[Appium]   allowInsecure: {
[Appium]   }
[Appium]   denyInsecure: {
[Appium]   }
[Appium] Appium REST http interface listener started on 127.0.0.1:3030
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"deviceName":"Insta","udid":"4200239706fd95cd","platformVersion":"9.0.0","platformName":"Android","appPackage":"com.android.chrome","appActivity":"com.google.android.apps.chrome.Main","unicodeKeyboard":"true","noReset":"True","pageLoadStrategy":"normal","automationName":"UiAutomator2","systemPort":6030,"chromedriverPort":7030},"capabilities":{"firstMatch":[{"platformName":"Android","pageLoadStrategy":"normal"}]}}
[W3C] Calling AppiumDriver.createSession() with args: [{"deviceName":"Insta","udid":"4200239706fd95cd","platformVersion":"9.0.0","platformName":"Android","appPackage":"com.android.chrome","appActivity":"com.google.android.apps.chrome.Main","unicodeKeyboard":"true","noReset":"True","pageLoadStrategy":"normal","automationName":"UiAutomator2","systemPort":6030,"chromedriverPort":7030},null,{"firstMatch":[{"platformName":"Android","pageLoadStrategy":"normal"}]}]
[BaseDriver] Event 'newSessionRequested' logged at 1615579289322 (23:01:29 GMT+0300 (Москва, стандартное время))
[Appium] The following capabilities were provided in the JSONWP desired capabilities that are missing in W3C capabilities: ["deviceName","udid","platformVersion","appPackage","appActivity","unicodeKeyboard","noReset","automationName","systemPort","chromedriverPort"]
[Appium] Trying to fix W3C capabilities by merging them with JSONWP caps
[BaseDriver] The following capabilities are not standard capabilities and should have an extension prefix:
[BaseDriver]   deviceName
[BaseDriver]   udid
[BaseDriver]   platformVersion
[BaseDriver]   appPackage
[BaseDriver]   appActivity
[BaseDriver]   unicodeKeyboard
[BaseDriver]   noReset
[BaseDriver]   automationName
[BaseDriver]   systemPort
[BaseDriver]   chromedriverPort
[Appium] Could not parse fixed W3C capabilities: 'noReset' must be of type boolean. Falling back to JSONWP protocol
[Appium] Appium v1.18.3 creating new AndroidUiautomator2Driver (v1.56.1) session
[Appium] There are no active sessions for cleanup
[BaseDriver] Creating session with MJSONWP desired capabilities: {
[BaseDriver]   "deviceName": "Insta",
[BaseDriver]   "udid": "4200239706fd95cd",
[BaseDriver]   "platformVersion": "9.0.0",
[BaseDriver]   "platformName": "Android",
[BaseDriver]   "appPackage": "com.android.chrome",
[BaseDriver]   "appActivity": "com.google.android.apps.chrome.Main",
[BaseDriver]   "unicodeKeyboard": "true",
[BaseDriver]   "noReset": "True",
[BaseDriver]   "pageLoadStrategy": "normal",
[BaseDriver]   "automationName": "UiAutomator2",
[BaseDriver]   "systemPort": 6030,
[BaseDriver]   "chromedriverPort": 7030
[BaseDriver] }
[BaseDriver] Capability 'noReset' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] Capability 'unicodeKeyboard' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] Session created with session id: 562008d1-c572-434d-ae0d-eec905bf1b68
[UiAutomator2] Starting 'com.android.chrome' directly on the device
[ADB] Found 1 'build-tools' folders under 'C:\android-sdk' (newest first):
[ADB]     C:/android-sdk/build-tools/29.0.2
[ADB] Using 'adb.exe' from 'C:\android-sdk\platform-tools\adb.exe'
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 start-server'
[AndroidDriver] Retrieving device list
[ADB] Trying to find a connected android device
[ADB] Getting connected devices
[ADB] Connected devices: [{"udid":"42000b50906eb50b","state":"device"},{"udid":"42001879d3008567","state":"device"},{"udid":"4200239706fd95cd","state":"device"},{"udid":"42006cc2e4dc6587","state":"device"},{"udid":"4200b8ad07f8c5cf","state":"device"},{"udid":"4200d6ebd20916c1","state":"device"}]
[AndroidDriver] Using device: 4200239706fd95cd
[ADB] Using 'adb.exe' from 'C:\android-sdk\platform-tools\adb.exe'
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 start-server'
[ADB] Setting device id to 4200239706fd95cd
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell getprop ro.build.version.sdk'
[ADB] Current device property 'ro.build.version.sdk': 28
[ADB] Getting device platform version
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell getprop ro.build.version.release'
[ADB] Current device property 'ro.build.version.release': 9
[ADB] Device API level: 28
[UiAutomator2] Relaxing hidden api policy
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd 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''
[AndroidDriver] No app sent in, not parsing package/activity
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd wait-for-device'
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell echo ping'
[AndroidDriver] Pushing settings apk to device...
[ADB] Getting install status for io.appium.settings
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell dumpsys package io.appium.settings'
[ADB] 'io.appium.settings' is installed
[ADB] Getting package info for 'io.appium.settings'
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd 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 ('3.2.0' >= '3.2.0')
[ADB] There is no need to install/upgrade 'C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk'
[ADB] Getting IDs of all 'io.appium.settings' processes
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell 'pgrep --help; echo $?''
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell pgrep -f io\\.appium\\.settings'
[AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions.
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell appops set io.appium.settings android\:mock_location allow'
[Logcat] Starting logs capture with command: C:\\android-sdk\\platform-tools\\adb.exe -P 5037 -s 4200239706fd95cd logcat -v threadtime
[AndroidDriver] Enabling Unicode keyboard support
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell settings get secure default_input_method'
[AndroidDriver] Unsetting previous IME io.appium.settings/.UnicodeIME
[AndroidDriver] Setting IME to 'io.appium.settings/.UnicodeIME'
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell ime enable io.appium.settings/.UnicodeIME'
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell ime set io.appium.settings/.UnicodeIME'
[HTTP] <-- POST /wd/hub/session - - ms - -

Так у вас порт другой

да, портов кучи всякие, 3001, 3030, 7030 и так далее

У меня каждый девайс на разных порах работал полгода без проблем.

На порте по умолчанию та же ошибка

[Appium] Welcome to Appium v1.18.3
[Appium] Non-default server args:
[Appium]   address: 127.0.0.1
[Appium]   relaxedSecurityEnabled: true
[Appium]   allowInsecure: {
[Appium]   }
[Appium]   denyInsecure: {
[Appium]   }
[Appium] Appium REST http interface listener started on 127.0.0.1:4723
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"deviceName":"Insta","udid":"4200239706fd95cd","platformVersion":"9.0.0","platformName":"Android","appPackage":"com.android.chrome","appActivity":"com.google.android.apps.chrome.Main","unicodeKeyboard":"true","noReset":"True","pageLoadStrategy":"normal","automationName":"UiAutomator2"},"capabilities":{"firstMatch":[{"platformName":"Android","pageLoadStrategy":"normal"}]}}
[W3C] Calling AppiumDriver.createSession() with args: [{"deviceName":"Insta","udid":"4200239706fd95cd","platformVersion":"9.0.0","platformName":"Android","appPackage":"com.android.chrome","appActivity":"com.google.android.apps.chrome.Main","unicodeKeyboard":"true","noReset":"True","pageLoadStrategy":"normal","automationName":"UiAutomator2"},null,{"firstMatch":[{"platformName":"Android","pageLoadStrategy":"normal"}]}]
[BaseDriver] Event 'newSessionRequested' logged at 1615633371257 (14:02:51 GMT+0300 (Москва, стандартное время))
[Appium] The following capabilities were provided in the JSONWP desired capabilities that are missing in W3C capabilities: ["deviceName","udid","platformVersion","appPackage","appActivity","unicodeKeyboard","noReset","automationName"]
[Appium] Trying to fix W3C capabilities by merging them with JSONWP caps
[BaseDriver] The following capabilities are not standard capabilities and should have an extension prefix:
[BaseDriver]   deviceName
[BaseDriver]   udid
[BaseDriver]   platformVersion
[BaseDriver]   appPackage
[BaseDriver]   appActivity
[BaseDriver]   unicodeKeyboard
[BaseDriver]   noReset
[BaseDriver]   automationName
[Appium] Could not parse fixed W3C capabilities: 'noReset' must be of type boolean. Falling back to JSONWP protocol
[Appium] Appium v1.18.3 creating new AndroidUiautomator2Driver (v1.56.1) session
[Appium] Applying relaxed security to 'AndroidUiautomator2Driver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure
[BaseDriver] Creating session with MJSONWP desired capabilities: {
[BaseDriver]   "deviceName": "Insta",
[BaseDriver]   "udid": "4200239706fd95cd",
[BaseDriver]   "platformVersion": "9.0.0",
[BaseDriver]   "platformName": "Android",
[BaseDriver]   "appPackage": "com.android.chrome",
[BaseDriver]   "appActivity": "com.google.android.apps.chrome.Main",
[BaseDriver]   "unicodeKeyboard": "true",
[BaseDriver]   "noReset": "True",
[BaseDriver]   "pageLoadStrategy": "normal",
[BaseDriver]   "automationName": "UiAutomator2"
[BaseDriver] }
[BaseDriver] Capability 'noReset' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] Capability 'unicodeKeyboard' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] Session created with session id: 12b5e75e-384f-4669-a50e-535d965ddf3d
[UiAutomator2] Starting 'com.android.chrome' directly on the device
[ADB] Found 1 'build-tools' folders under 'C:\android-sdk' (newest first):
[ADB]     C:/android-sdk/build-tools/29.0.2
[ADB] Using 'adb.exe' from 'C:\android-sdk\platform-tools\adb.exe'
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 start-server'
[AndroidDriver] Retrieving device list
[ADB] Trying to find a connected android device
[ADB] Getting connected devices
[ADB] Connected devices: [{"udid":"42000b50906eb50b","state":"device"},{"udid":"42001879d3008567","state":"device"},{"udid":"4200239706fd95cd","state":"device"},{"udid":"42006cc2e4dc6587","state":"device"},{"udid":"4200d6ebd20916c1","state":"device"}]
[AndroidDriver] Using device: 4200239706fd95cd
[ADB] Using 'adb.exe' from 'C:\android-sdk\platform-tools\adb.exe'
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 start-server'
[ADB] Setting device id to 4200239706fd95cd
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell getprop ro.build.version.sdk'
[ADB] Current device property 'ro.build.version.sdk': 28
[ADB] Getting device platform version
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell getprop ro.build.version.release'
[ADB] Current device property 'ro.build.version.release': 9
[ADB] Device API level: 28
[UiAutomator2] Relaxing hidden api policy
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd 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''
[AndroidDriver] No app sent in, not parsing package/activity
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd wait-for-device'
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell echo ping'
[AndroidDriver] Pushing settings apk to device...
[ADB] Getting install status for io.appium.settings
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell dumpsys package io.appium.settings'
[ADB] 'io.appium.settings' is installed
[ADB] Getting package info for 'io.appium.settings'
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd 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 ('3.2.0' >= '3.2.0')
[ADB] There is no need to install/upgrade 'C:\Users\Anz\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk'
[ADB] Getting IDs of all 'io.appium.settings' processes
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell 'pgrep --help; echo $?''
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell pgrep -f io\\.appium\\.settings'
[AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions.
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell appops set io.appium.settings android\:mock_location allow'
[Logcat] Starting logs capture with command: C:\\android-sdk\\platform-tools\\adb.exe -P 5037 -s 4200239706fd95cd logcat -v threadtime
[AndroidDriver] Enabling Unicode keyboard support
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell settings get secure default_input_method'
[AndroidDriver] Unsetting previous IME io.appium.settings/.UnicodeIME
[AndroidDriver] Setting IME to 'io.appium.settings/.UnicodeIME'
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell ime enable io.appium.settings/.UnicodeIME'
[ADB] Running 'C:\android-sdk\platform-tools\adb.exe -P 5037 -s 4200239706fd95cd shell ime set io.appium.settings/.UnicodeIME'
[HTTP] <-- POST /wd/hub/session - - ms - -

А настраивал изначально кто, вы? Наверное что то настроили и забыли или еще бывает кучу всего настроишь но не понимаешь благодаря чему заработало и вычисляешь методом исключения. Поэтому после настройки всегда перезапуск всего надо тестить

1 лайк

Да, я. Просто полгода все 24часа в сутки работало и резко перестало. Даже 1 девайс не получается запустить

Хмм, ну да, вы стучитесь на 3001, хотя Апиум запущен на 3030.
Проверьте, не занят ли 3001 чем-то другим ? И 3030 тоже проверьте. Отключите файрвол - тоже проверьте.

1 лайк

Напишите метод который будет прибивать все процессы на тех портах на которых вы будете стартовать аппиум. Это будет гарантировать что никакой процесс не вмешивается.

1 лайк

Спасибо всем, кто откликнулся. Проблема решилась после установки новой версии Appium’а.

Вы всеравно добавьте очистку портов. Основное количество проблем в старте аппиума это порты.

1 лайк