webdriverio / webdriverio

Next-gen browser and mobile automation test framework for Node.js
http://webdriver.io
MIT License
8.99k stars 2.49k forks source link

[HELP] Test execution is pausing at the '**Finished to run "before" hook in 9181ms** #7423

Closed EINBOX closed 3 years ago

EINBOX commented 3 years ago

Hello,

while in test execution, After launching the application on mobile chrome browser, my test execution is pausing and saying as below , can you please help to fix this [0-0] 2021-09-14T10:55:43.383Z DEBUG @wdio/utils:shim: Finished to run "before" hook in 9181ms

what does it mean? earlier it was working fine like launching app and performing few actions.

can you please someone help to fix this?

[0-0] 2021-09-14T10:55:34.202Z INFO webdriver: COMMAND navigateTo("https://testsite.net/")
[0-0] 2021-09-14T10:55:34.203Z INFO webdriver: [POST] http://localhost:4723/session/8a60c77f-dde6-4cd4-8b6d-8a0f6c30e4aa/url
[0-0] 2021-09-14T10:55:34.203Z INFO webdriver: DATA { url: 'https://testsite.net/' }
[0-0] <<< BROWSER TESTS STARTED >>>https://testsite.net/
[0-0] 2021-09-14T10:55:43.383Z DEBUG @wdio/utils:shim: Finished to run "before" hook in 9181ms

after this ,manually I need to kill the session to run again.

christian-bromann commented 3 years ago

can you please someone help to fix this?

There is nothing to fix, it is a log message. Just ignore it if you are not interested in this information. You can also adjust the logLevel in your config.

EINBOX commented 3 years ago

its blocking my test execution, after this step nothing is executing, not at calling my spec files ,in my spec defined couple of methods to perform actions.but nothing is calling

christian-bromann commented 3 years ago

Maybe something is blocking within a different hook. I would to debug your hook usage and see if where this happens.

EINBOX commented 3 years ago

its seems to be not able to identify the spec file ,am using …2 days back it was fine..is it having any issue with current version V7* "dependencies": { "@wdio/runner": "^7.9.1", "allure-commandline": "^2.13.8", "geckodriver": "^2.0.3", "react-device-detect": "^1.17.0", "selenium-standalone": "^7.1.0", "wd": "^1.14.0", "wdio-video-reporter": "^3.1.2", "webdriverio": "^7.9.1" }, "devDependencies": { "@babel/cli": "^7.14.8", "@babel/core": "^7.15.0", "@babel/preset-env": "^7.15.0", "@babel/register": "^7.15.3", "@wdio/allure-reporter": "^7.9.1", "@wdio/appium-service": "^7.8.0", "@wdio/cli": "^7.9.1", "@wdio/dot-reporter": "^7.9.0", "@wdio/firefox-profile-service": "^7.10.1", "@wdio/local-runner": "^7.11.0", "@wdio/mocha-framework": "^7.11.0", "@wdio/selenium-standalone-service": "^7.10.1", "@wdio/spec-reporter": "^7.10.1", "appium": "^1.21.0", "chai": "^4.3.4", "chromedriver": "^92.0.1", "mocha": "^9.1.0", "wdio-chromedriver-service": "^7.2.0", "wdio-geckodriver-service": "^2.0.3"

EINBOX commented 3 years ago

Its really making me to feel panic , lot of issues with WebdriverIO , no proper logs , 2 days worked script ..today its not at all able to find spec files. I think need to think now before going to show POC many issues…I dont think we do not a stable build of WebdriverIO

christian-bromann commented 3 years ago

From the information you have provided it is unfortunately not obvious where in WebdriverIO there could be a bug. I am not sure where you are seeing many issues here and it is also unclear if these are related to WebdriverIO or just improper use of the framework. This way it is difficult to help you.

EINBOX commented 3 years ago

one thing sure that its not identifying spec files so that my tests are not running and I dont see any reason in the logs ,can you check please

[debug] [ADB] Trying to find 'Nexus_5X_API_31' emulator
[debug] [ADB] Getting connected emulators
[debug] [ADB] Getting connected devices
[debug] [ADB] Connected devices: [{"udid":"emulator-5554","state":"authorizing"}]
[debug] [ADB] 1 emulator connected
[debug] [ADB] Overriding /Users/<username>/.emulator_console_auth_token with an empty string to avoid telnet authentication for emulator commands
[debug] [ADB] Executing Emulator console command: avd name
[debug] [ADB] Found emulator 'Nexus_5X_API_31' on port 5554
[debug] [ADB] Setting device id to emulator-5554
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 wait-for-device'
[AndroidDriver] Using device: emulator-5554
[ADB] Using 'adb' from '/Users/<username>/Library/Android/sdk/platform-tools/adb'
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 start-server'
[debug] [ADB] Setting device id to emulator-5554
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk'
[debug] [ADB] Current device property 'ro.build.version.sdk': 31
[ADB] Getting device platform version
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell getprop ro.build.version.release'
[debug] [ADB] Current device property 'ro.build.version.release': 12
[debug] [ADB] Device API level: 31
[UiAutomator2] Relaxing hidden api policy
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -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''
[AndroidDriver] No app sent in, not parsing package/activity
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 wait-for-device'
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell echo ping'
[debug] [AndroidDriver] Pushing settings apk to device...
[debug] [ADB] Getting install status for io.appium.settings
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings'
[debug] [ADB] 'io.appium.settings' is installed
[debug] [ADB] Getting package info for 'io.appium.settings'
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings'
[debug] [ADB] The version name of the installed 'io.appium.settings' is greater or equal to the application version name ('3.3.0' >= '3.3.0')
[debug] [ADB] There is no need to install/upgrade '/Users/<username>/Downloads/WDIOTest-fix-script/node_modules/appium/node_modules/io.appium.settings/apks/settings_apk-debug.apk'
[debug] [ADB] Getting IDs of all 'io.appium.settings' processes
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell 'pgrep --help; echo $?''
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell pgrep -f \(\[\[:blank:\]\]\|\^\)io\.appium\.settings\(\[\[:blank:\]\]\|\$\)'
[debug] [AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions.
[debug] [Logcat] Starting logs capture with command: /Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 logcat -v threadtime
[debug] [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to local port 8200
[debug] [ADB] Forwarding system: 8200 to device: 6790
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 forward tcp:8200 tcp:6790'
[debug] [ADB] Getting install status for io.appium.uiautomator2.server
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server'
[debug] [ADB] 'io.appium.uiautomator2.server' is installed
[debug] [ADB] Getting package info for 'io.appium.uiautomator2.server'
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server'
[debug] [ADB] The version name of the installed 'io.appium.uiautomator2.server' is greater or equal to the application version name ('4.21.1' >= '4.21.1')
[debug] [UiAutomator2] io.appium.uiautomator2.server installation state: sameVersionInstalled
[debug] [ADB] Checking app cert for /Users/<username>/Downloads/WDIOTest-fix-script/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.21.1.apk
[ADB] Using 'apksigner.jar' from '/Users/<username>/Library/Android/sdk/build-tools/31.0.0/lib/apksigner.jar'
[debug] [ADB] Starting apksigner: /Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/bin/java -Xmx1024M -Xss1m -jar /Users/<username>/Library/Android/sdk/build-tools/31.0.0/lib/apksigner.jar verify --print-certs /Users/<username>/Downloads/WDIOTest-fix-script/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.21.1.apk
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
[debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
[debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
[debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
[debug] [ADB] 
[debug] [ADB] sha256 hash did match for 'appium-uiautomator2-server-v4.21.1.apk'
[ADB] '/Users/<username>/Downloads/WDIOTest-fix-script/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.21.1.apk' is signed with the default certificate
[debug] [ADB] Getting install status for io.appium.uiautomator2.server.test
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server.test'
[debug] [ADB] 'io.appium.uiautomator2.server.test' is installed
[debug] [ADB] Checking app cert for /Users/<username>/Downloads/WDIOTest-fix-script/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk
[debug] [ADB] Starting apksigner: /Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/bin/java -Xmx1024M -Xss1m -jar /Users/<username>/Library/Android/sdk/build-tools/31.0.0/lib/apksigner.jar verify --print-certs /Users/<username>/Downloads/WDIOTest-fix-script/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk
[debug] [ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
[debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
[debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
[debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
[debug] [ADB] 
[debug] [ADB] sha256 hash did match for 'appium-uiautomator2-server-debug-androidTest.apk'
[ADB] '/Users/<username>/Downloads/WDIOTest-fix-script/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk' is signed with the default certificate
[UiAutomator2] Server packages are not going to be (re)installed
[debug] [UiAutomator2] Waiting up to 30000ms for services to be available
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell pm list instrumentation'
[debug] [UiAutomator2] 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
[debug] [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",";"]]
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -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 ;'
[debug] [UiAutomator2] No app capability. Assuming it is already on the device
[debug] [ADB] Getting install status for com.android.chrome
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package com.android.chrome'
[debug] [ADB] 'com.android.chrome' is installed
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop com.android.chrome'
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell pm clear com.android.chrome'
[debug] [AndroidDriver] Performed fast reset on the installed 'com.android.chrome' application (stop and clear)
[debug] [UiAutomator2] Performing shallow cleanup of automation leftovers
[debug] [UiAutomator2] No obsolete sessions have been detected (socket hang up)
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop io.appium.uiautomator2.server.test'
[UiAutomator2] Starting UIAutomator2 server 4.21.1
[UiAutomator2] Using UIAutomator2 server from '/Users/<username>/Downloads/WDIOTest-fix-script/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v4.21.1.apk' and test from '/Users/<username>/Downloads/WDIOTest-fix-script/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk'
[UiAutomator2] Waiting up to 30000ms for UiAutomator2 to be online...
[debug] [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"]
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body
[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:8200/wd/hub/status] with no body
[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:8200/wd/hub/status] with no body
[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:8200/wd/hub/status] with no body
[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:8200/wd/hub/status] with no body
[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:8200/wd/hub/status] with no body
[WD Proxy] socket hang up
[debug] [Instrumentation] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8200/wd/hub/status] with no body
[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:8200/wd/hub/status] with no body
[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:8200/wd/hub/status] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"None","value":{"message":"UiAutomator2 Server is ready to accept commands","ready":true}}
[debug] [UiAutomator2] The initialization of the instrumentation process took 8317ms
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8200/wd/hub/session] with body: {"capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","browserName":"chrome","acceptInsecureCerts":true,"log":{"level":"trace"},"automationName":"uiautomator2","deviceName":"Nexus_5X_API_31","platformVersion":"12","deviceOrientation":"portriat","avd":"Nexus_5X_API_31","commandTimeout":90000,"newCommandTimeout":90000},"platformName":"Android","browserName":"chrome","acceptInsecureCerts":true,"log":{"level":"trace"},"automationName":"uiautomator2","deviceName":"emulator-5554","platformVersion":"12","deviceOrientation":"portriat","avd":"Nexus_5X_API_31","commandTimeout":90000,"newCommandTimeout":90000,"appPackage":"com.android.chrome","appActivity":"com.google.android.apps.chrome.Main","deviceUDID":"emulator-5554"}],"alwaysMatch":{}}}
[debug] [WD Proxy] Got response with status 200: {"sessionId":"01e409e8-91ee-4400-bc84-0bb845d4e0ea","value":{"capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","browserName":"chrome","acceptInsecureCerts":true,"log":{"level":"trace"},"automationName":"uiautomator2","deviceName":"Nexus_5X_API_31","platformVersion":"12","deviceOrientation":"portriat","avd":"Nexus_5X_API_31","commandTimeout":90000,"newCommandTimeout":90000},"platformName":"Android","browserName":"chrome","acceptInsecureCerts":true,"log":{"level":"trace"},"automationName":"uiautomator2","deviceName":"emulator-5554","platformVersion":"12","deviceOrientation":"portriat","avd":"Nexus_5X_API_31","commandTimeout":90000,"newCommandTimeout":90000,"appPackage":"com.android.chrome","appActivity":"com.google.android.apps.chrome.Main","deviceUDID":"emulator-5554"}],"alwaysMatch":{}},"sessionId":...
[WD Proxy] Determined the downstream protocol as 'W3C'
[debug] [WD Proxy] Proxying [GET /appium/device/info] to [GET http://127.0.0.1:8200/wd/hub/session/01e409e8-91ee-4400-bc84-0bb845d4e0ea/appium/device/info] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"01e409e8-91ee-4400-bc84-0bb845d4e0ea","value":{"androidId":"30197ffac21c7d85","apiVersion":"31","bluetooth":{"state":"OFF"},"brand":"google","carrierName":"T-Mobile","displayDensity":420,"locale":"en_US","manufacturer":"Google","model":"sdk_gphone64_x86_64","networks":[{"capabilities":{"SSID":null,"linkDownBandwidthKbps":30000,"linkUpstreamBandwidthKbps":15000,"networkCapabilities":"NET_CAPABILITY_MMS,NET_CAPABILITY_SUPL,NET_CAPABILITY_DUN,NET_CAPABILITY_FOTA,NET_CAPABILITY_IMS,NET_CAPABILITY_CBS,NET_CAPABILITY_INTERNET,NET_CAPABILITY_NOT_RESTRICTED,NET_CAPABILITY_TRUSTED,NET_CAPABILITY_NOT_VPN,NET_CAPABILITY_NOT_ROAMING,NET_CAPABILITY_NOT_CONGESTED,NET_CAPABILITY_NOT_SUSPENDED","signalStrength":-2147483648,"transportTypes":"TRANSPORT_CELLULAR"},"detailedState":"CONNECTED","extraInfo":"epc.tmobile.com","isAvailable":true,"isConnected":true,"isFailover":false,"isRoaming":false,"state":"CONNECTED","subtype":13,"subtypeName":"LTE","type":0,"typeName":"MOBILE"},{"capabilities":{"SSID":null,"linkD...
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys window'
[AndroidDriver] Screen already unlocked, doing nothing
[AndroidDriver] Starting a chrome-based browser session
[debug] [AndroidDriver] A port was not given, using random free port: 8000
[debug] [AndroidDriver] Precalculated Chromedriver capabilities: {
[debug] [AndroidDriver]   "androidPackage": "com.android.chrome",
[debug] [AndroidDriver]   "androidDeviceSerial": "emulator-5554"
[debug] [AndroidDriver] }
[debug] [AndroidDriver] Before starting chromedriver, androidPackage is 'com.android.chrome'
[debug] [Chromedriver] Changed state to 'starting'
[debug] [Chromedriver] Using the static Chromedriver->Chrome mapping
[debug] [Chromedriver] The most recent known Chrome version: 89.0.4389
[debug] [Chromedriver] Found 2 executables in '/Users/<username>/Downloads/WDIOTest-fix-script/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac'
[debug] [Chromedriver] The following Chromedriver executables were found:
[debug] [Chromedriver]     '/Users/<username>/Downloads/WDIOTest-fix-script/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver_mac64_v91.0.4472.101' (version '91.0.4472.101', minimum Chrome version '91')
[debug] [Chromedriver]     '/Users/<username>/Downloads/WDIOTest-fix-script/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver_mac64_v91.0.4472.19' (version '91.0.4472.19', minimum Chrome version '91')
[Chromedriver] Found 2 Chromedrivers, which are missing in the list of known versions: {"91.0.4472.101":"91","91.0.4472.19":"91"}
[debug] [ADB] Getting package info for 'com.android.chrome'
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package com.android.chrome'
[debug] [Chromedriver] Found Chrome bundle 'com.android.chrome' version '91.0.4472'
[debug] [Chromedriver] Found 2 executables capable of automating Chrome '91.0.4472'.
[debug] [Chromedriver] Choosing the most recent, '/Users/<username>/Downloads/WDIOTest-fix-script/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver_mac64_v91.0.4472.101'.
[debug] [Chromedriver] If a specific version is required, specify it with the `chromedriverExecutable`desired capability.
[Chromedriver] Set chromedriver binary as: /Users/<username>/Downloads/WDIOTest-fix-script/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver_mac64_v91.0.4472.101
[debug] [Chromedriver] Killing any old chromedrivers, running: pkill -15 -f "/Users/<username>/Downloads/WDIOTest-fix-script/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver_mac64_v91.0.4472.101.*--port=8000"
[Chromedriver] No old chromedrivers seem to exist
[debug] [Chromedriver] Cleaning this device's adb forwarded port socket connections: emulator-5554
[debug] [ADB] List forwarding ports
[debug] [ADB] Running '/Users/<username>/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 forward --list'
[Chromedriver] Spawning chromedriver with: /Users/<username>/Downloads/WDIOTest-fix-script/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver_mac64_v91.0.4472.101 --url-base=wd/hub --port=8000 --adb-port=5037 --verbose
[debug] [Chromedriver] Chromedriver version: '91.0.4472.101'
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8000/wd/hub/status] with no body
[WD Proxy] connect ECONNREFUSED 127.0.0.1:8000
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8000/wd/hub/status] with no body
[debug] [WD Proxy] Got response with status 200: {"value":{"build":{"version":"91.0.4472.101 (af52a90bf87030dd1523486a1cd3ae25c5d76c9b-refs/branch-heads/4472@{#1462})"},"message":"ChromeDriver ready for new sessions.","os":{"arch":"x86_64","name":"Mac OS X","version":"10.15.7"},"ready":true}}
[Chromedriver] Starting W3C Chromedriver session with capabilities: {
[Chromedriver]   "capabilities": {
[Chromedriver]     "alwaysMatch": {
[Chromedriver]       "goog:chromeOptions": {
[Chromedriver]         "androidPackage": "com.android.chrome",
[Chromedriver]         "androidDeviceSerial": "emulator-5554"
[Chromedriver]       },
[Chromedriver]       "goog:loggingPrefs": {
[Chromedriver]         "browser": "ALL"
[Chromedriver]       }
[Chromedriver]     }
[Chromedriver]   }
[Chromedriver] }
[debug] [WD Proxy] Matched '/session' to command name 'createSession'
[debug] [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"capabilities":{"alwaysMatch":{"goog:chromeOptions":{"androidPackage":"com.android.chrome","androidDeviceSerial":"emulator-5554"},"goog:loggingPrefs":{"browser":"ALL"}}}}
[debug] [Chromedriver] Webview version: 'Chrome/91.0.4472.114'
[debug] [WD Proxy] Got response with status 200: {"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"91.0.4472.114","chrome":{"chromedriverVersion":"91.0.4472.101 (af52a90bf87030dd1523486a1cd3ae25c5d76c9b-refs/branch-heads/4472@{#1462})"},"goog:chromeOptions":{"debuggerAddress":"localhost:50534"},"pageLoadStrategy":"normal","platformName":"android","proxy":{},"setWindowRect":false,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify","webauthn:extension:largeBlob":false,"webauthn:virtualAuthenticators":false},"sessionId":"940e4cf0993852eb47a77054d8a5c8ea"}}
[WD Proxy] Determined the downstream protocol as 'W3C'
[debug] [Chromedriver] Changed state to 'online'
[debug] [WD Proxy] Proxying [GET /appium/device/pixel_ratio] to [GET http://127.0.0.1:8200/wd/hub/session/01e409e8-91ee-4400-bc84-0bb845d4e0ea/appium/device/pixel_ratio] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"01e409e8-91ee-4400-bc84-0bb845d4e0ea","value":2.625}
[debug] [WD Proxy] Matched '/appium/device/system_bars' to command name 'getSystemBars'
[debug] [WD Proxy] Proxying [GET /appium/device/system_bars] to [GET http://127.0.0.1:8200/wd/hub/session/01e409e8-91ee-4400-bc84-0bb845d4e0ea/appium/device/system_bars] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"01e409e8-91ee-4400-bc84-0bb845d4e0ea","value":{"statusBar":63}}
[debug] [WD Proxy] Matched '/window/current/size' to command name 'getWindowSize'
[debug] [WD Proxy] Proxying [GET /window/current/size] to [GET http://127.0.0.1:8200/wd/hub/session/01e409e8-91ee-4400-bc84-0bb845d4e0ea/window/current/size] with no body
[debug] [WD Proxy] Got response with status 200: {"sessionId":"01e409e8-91ee-4400-bc84-0bb845d4e0ea","value":{"height":1794,"width":1080}}
[Appium] New AndroidUiautomator2Driver session created successfully, session b28ece48-37aa-4dd7-aa9c-e25ddc75e2e3 added to master session list
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1631705579210 (17:02:59 GMT+0530 (India Standard Time))
[debug] [W3C (b28ece48)] Cached the protocol value 'W3C' for the new session b28ece48-37aa-4dd7-aa9c-e25ddc75e2e3
[debug] [W3C (b28ece48)] Responding to client with driver.createSession() result: {"capabilities":{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","browserName":"chrome","acceptInsecureCerts":true,"log":{"level":"trace"},"automationName":"uiautomator2","deviceName":"Nexus_5X_API_31","platformVersion":"12","deviceOrientation":"portriat","avd":"Nexus_5X_API_31","commandTimeout":90000,"newCommandTimeout":90000},"platformName":"Android","browserName":"chrome","acceptInsecureCerts":true,"log":{"level":"trace"},"automationName":"uiautomator2","deviceName":"emulator-5554","platformVersion":"12","deviceOrientation":"portriat","avd":"Nexus_5X_API_31","commandTimeout":90000,"newCommandTimeout":90000,"appPackage":"com.android.chrome","appActivity":"com.google.android.apps.chrome.Main","deviceUDID":"emulator-5554","deviceApiLevel":31,"deviceScreenSize":"1080x1920","deviceScreenDensity":420,"deviceModel":"sdk_gphone64_x8...
[HTTP] <-- POST /session 200 28337 ms - 1219
[HTTP] 
[HTTP] --> POST /session/b28ece48-37aa-4dd7-aa9c-e25ddc75e2e3/url
[HTTP] {"url":"https://webtestsite.net/"}
[W3C (b28ece48)] Driver proxy active, passing request on via HTTP proxy
[debug] [WD Proxy] Matched '/session/b28ece48-37aa-4dd7-aa9c-e25ddc75e2e3/url' to command name 'setUrl'
[debug] [WD Proxy] Proxying [POST /session/b28ece48-37aa-4dd7-aa9c-e25ddc75e2e3/url] to [POST http://127.0.0.1:8000/wd/hub/session/940e4cf0993852eb47a77054d8a5c8ea/url] with body: {"url":"https://webtestsite.net/"}
[HTTP] <-- POST /session/b28ece48-37aa-4dd7-aa9c-e25ddc75e2e3/url - - ms - -
[HTTP] 
[HTTP] --> POST /session/b28ece48-37aa-4dd7-aa9c-e25ddc75e2e3/url
[HTTP] {"url":"https://webtestsite.net/"}
[W3C (b28ece48)] Driver proxy active, passing request on via HTTP proxy
[debug] [WD Proxy] Got response with status 200: {"value":null}
[debug] [WD Proxy] Matched '/session/b28ece48-37aa-4dd7-aa9c-e25ddc75e2e3/url' to command name 'setUrl'
[debug] [WD Proxy] Proxying [POST /session/b28ece48-37aa-4dd7-aa9c-e25ddc75e2e3/url] to [POST http://127.0.0.1:8000/wd/hub/session/940e4cf0993852eb47a77054d8a5c8ea/url] with body: {"url":"https://webtestsite.net/"}
[debug] [WD Proxy] Got response with status 200: {"value":null}
[HTTP] <-- POST /session/b28ece48-37aa-4dd7-aa9c-e25ddc75e2e3/url 200 88000 ms - 14
[HTTP] 
EINBOX commented 3 years ago

when I run wdio,js its saying

2021-09-15T16:15:50.709Z WARN @wdio/config:ConfigParser: pattern ./test/specs/test.js did not match any file
2021-09-15T16:15:50.709Z ERROR @wdio/cli:launcher: No specs found to run, exiting with failure
2021-09-15T16:15:50.963Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2021-09-15T16:15:50.964Z INFO @wdio/local-runner: shutting down

is there any work around for this? no change in my code, 2 days back worked fine.

wswebcreation commented 3 years ago

Can you share your project folder setup, the error message is pretty clear

pattern ./test/specs/test.js did not match any file

EINBOX commented 3 years ago

@wswebcreation , @christian-bromann I have shared the project here issue: what we defined in the config file 'before' hook ,the browser launched on mobile android and later script sitting idle …we need to kill forcibly to kill the session

https://github.com/EINBOX/WDIOTest

am not sure what went wrong, feeling strange but definitely together we can solve this issue.

wswebcreation commented 3 years ago

@EINBOX

This code is breaking in multiple places, let me create a PR to make this work

EINBOX commented 3 years ago

sure @wswebcreation

wswebcreation commented 3 years ago

@EINBOX

I've created a PR, please check the files.

The issue for this to hang (maybe also good for @christian-bromann to know) was the allure reporter.

You had this config option in the reporter useCucumberStepReporter: true. That one is only needed when you use Cucumber as a framework. You are using Mocha so you or don't need to provide that option, or put it to false.

With the proposed changes your set up will work again

christian-bromann commented 3 years ago

With the proposed changes your set up will work again

Thanks for investigating @wswebcreation ! Why was this halting the execution? Usually a reporter should not be able to do that?

wswebcreation commented 3 years ago

I think the reporter was hanging here https://github.com/webdriverio/webdriverio/blob/7415f3126e15a733b51721492e4995ceafae6046/packages/wdio-allure-reporter/src/index.ts#L89 due to the incorrect option value. Not sure if this is a bug or just a not correct usage of the arguments.

christian-bromann commented 3 years ago

The question is why it would hang there. It is an event emitter function and should not cause other executions to hang.

EINBOX commented 3 years ago

@wswebcreation thank you very much your support and time , I will do modification accordingly and let you know the status.

once again thank you sir, its working ..just because of one line …created stage situation

sir, can you assist the way to do debugging in wdio, my BG is selenium java there its easy to do debug..here really am sure how to do exactly help me to save my time , definitely debugger is going to save anyones life.

EINBOX commented 3 years ago

@wswebcreation as you suggested , I have reduced waitTimeout and but getting now timeout issues mochaOpts: { ui: 'bdd', defaultTimeoutInterval: 60000, // => you had 1200000 which is tooooo long Timeout of 10000ms exceeded. The execution in the test "My Login application" took too long. Try to reduce the run time or increase your timeout for test specs I have declared 10000ms anywhere from where it is picking? is there anything line .sync method until need to wait for an elment in case if elment exists within defined ,it shud come out. where exactly I need to increase time ? is this mocha framework level or spec level or browserconfig level?

increased mochaOpts: {
         ui: 'bdd',
         defaultTimeoutInterval: 120000, 

Though I have increase spec level, still getting the same issue

describe('My Login application', () => {
    beforeEach(async () => {
        await browser.url('./');
        console.log('yes,before each')
        //browser.debug()
        await browser.setTimeout({'script': 999999999})

    });
 it('test pages', async () =>{
        console.log('yes, testing page test case:')
        const view=await $('#View')
        await view.waitForExist(50000)
        console.log('yes,view object wait 1:')
        const isview=await view.isExisting(50000);
        console.log('isview exist:'+isview)
})
})
wswebcreation commented 3 years ago

Hi @EINBOX

More information about timeouts can be found here https://webdriver.io/docs/timeouts/

Secondly, if you want to overwrite the timeout for a specific function that you should use the arguments are provided in the docs, see for example your await view.waitForExist(50000) in the code above. That should be await view.waitForExist({timeout :50000})

EINBOX commented 3 years ago

@wswebcreation thank you for your guidance/suggestions , for Debugging : I have tried configuring node js like in the picture but when I try to run its giving error message but using rpm run androindBrowser ..no issues do I need to do any setup for debugging purpose image

though I have installed wdio-appium-service, its throwing error as below error

2021-09-16T17:35:54.741Z INFO @wdio/local-runner: Shutting down spawned worker
2021-09-16T17:35:54.733Z ERROR @wdio/utils:initialiseServices: Error: Couldn't find plugin "appium" service, neither as wdio scoped package "@wdio/appium-service" nor as community package "wdio-appium-service". Please make sure you have it installed!
2021-09-16T17:35:54.738Z WARN @wdio/config:ConfigParser: pattern ./test/specs/**/*.js did not match any file
2021-09-16T17:35:54.739Z WARN @wdio/config:ConfigParser: pattern ./test/specs/**/fontsize.spec.js did not match any file
2021-09-16T17:35:54.739Z ERROR @wdio/cli:launcher: No specs found to run, exiting with failure
2021-09-16T17:35:54.993Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2021-09-16T17:35:54.994Z INFO @wdio/local-runner: shutting down

please suggest me best setup for debugging.

christian-bromann commented 3 years ago

2021-09-16T17:35:54.738Z WARN @wdio/config:ConfigParser: pattern ./test/specs/*/.js did not match any file 2021-09-16T17:35:54.739Z WARN @wdio/config:ConfigParser: pattern ./test/specs/**/fontsize.spec.js did not match any file 2021-09-16T17:35:54.739Z ERROR @wdio/cli:launcher: No specs found to run, exiting with failure

It seems that your spec files are not existing at the given path.

EINBOX commented 3 years ago

with the same path ,no issue while running rpm run fontsizetes its throwing error only when i tried above way

in debug mode ,we can build our test very fast but run mode its difficult