appium / java-client

Java language binding for writing Appium Tests, conforms to W3C WebDriver Protocol
Apache License 2.0
1.22k stars 760 forks source link

io.appium.java_client.remote.AppiumCommandExecutor$1 lambda$0 #1286

Open cigvikas opened 4 years ago

cigvikas commented 4 years ago

My Code:

`import java.io.File; import java.net.MalformedURLException; import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.android.AndroidDriver; import io.appium.java_client.android.AndroidElement; import io.appium.java_client.remote.MobileCapabilityType;

public class Base {

public static AndroidDriver<AndroidElement> capabilities() throws MalformedURLException{

    File f = new File("src");
    File fs  = new File (f, "ApiDemos-debug.apk");
    DesiredCapabilities cap = new DesiredCapabilities();
    cap.setCapability(MobileCapabilityType.DEVICE_NAME, "vikas");
    cap.setCapability(MobileCapabilityType.APP, fs.getAbsolutePath() );
    AndroidDriver<AndroidElement> driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), cap);
    return driver;  

}

} import java.net.MalformedURLException; import java.util.List; import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By; import org.openqa.selenium.WebElement;

import io.appium.java_client.android.AndroidDriver; import io.appium.java_client.android.AndroidElement;

public class Basics extends Base { public static void main(String[] args) throws MalformedURLException, InterruptedException { AndroidDriver driver = capabilities(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

driver.findElementByXPath("//android.widget.TextView[@text='Preference']").click();

}

}`

Eclipse console error:

io.appium.java_client.remote.AppiumCommandExecutor$1 lambda$0 INFO: Detected dialect: W3C Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils at io.appium.java_client.HasSessionDetails.lambda$0(HasSessionDetails.java:52) at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174) at com.google.common.collect.CollectSpliterators$1.lambda$forEachRemaining$1(CollectSpliterators.java:117) at java.util.Iterator.forEachRemaining(Iterator.java:116) at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) at com.google.common.collect.CollectSpliterators$1.forEachRemaining(CollectSpliterators.java:117) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) at io.appium.java_client.HasSessionDetails.getSessionDetails(HasSessionDetails.java:55) at io.appium.java_client.HasSessionDetails.getSessionDetail(HasSessionDetails.java:59) at io.appium.java_client.HasSessionDetails.getPlatformName(HasSessionDetails.java:68) at io.appium.java_client.internal.JsonToMobileElementConverter.<init>(JsonToMobileElementConverter.java:49) at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:91) at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:96) at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:94) at Base.capabilities(Base.java:20) at Basics.main(Basics.java:15) Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 20 more

Appium log:

C:\Users\E004612>appium [Appium] Welcome to Appium v1.16.0 [Appium] Appium REST http interface listener started on 0.0.0.0:4723 [HTTP] --> POST /wd/hub/session [HTTP] {"desiredCapabilities":{"app":"C:\All_Automation\Tutorial\src\ApiDemos-debug.apk","platformName":"Android","deviceName":"vikas"},"capabilities":{"firstMatch":[{"appium:app":"C:\All_Automation\Tutorial\src\ApiDemos-debug.apk","appium:deviceName":"vikas","platformName":"android"}]}} [debug] [W3C] Calling AppiumDriver.createSession() with args: [{"app":"C:\All_Automation\Tutorial\src\ApiDemos-debug.apk","platformName":"Android","deviceName":"vikas"},null,{"firstMatch":[{"appium:app":"C:\All_Automation\Tutorial\src\ApiDemos-debug.apk","appium:deviceName":"vikas","platformName":"android"}]}] [debug] [BaseDriver] Event 'newSessionRequested' logged at 1577352508603 (14:58:28 GMT+0530 (India Standard Time)) [Appium] [Appium] ====================================================================== [Appium] DEPRECATION WARNING: [Appium] [Appium] The 'automationName' capability was not provided in the desired [Appium] capabilities for this Android session [Appium] [Appium] Setting 'automationName=UiAutomator2' by default and using the [Appium] UiAutomator2 Driver [Appium] [Appium] The next major version of Appium (2.x) will require the [Appium] 'automationName' capability to be set for all sessions on all [Appium] platforms [Appium] [Appium] In previous versions (Appium <= 1.13.x), the default was [Appium] 'automationName=UiAutomator1' [Appium] [Appium] If you wish to use that automation instead of UiAutomator2, please [Appium] add 'automationName=UiAutomator1' to your desired capabilities [Appium] [Appium] For more information about drivers, please visit [Appium] http://appium.io/docs/en/about-appium/intro/ and explore the [Appium] 'Drivers' menu [Appium] [Appium] ====================================================================== [Appium] [Appium] Appium v1.16.0 creating new AndroidUiautomator2Driver (v1.40.0) session [debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided [debug] [BaseDriver] Creating session with W3C capabilities: { [debug] [BaseDriver] "alwaysMatch": { [debug] [BaseDriver] "platformName": "android", [debug] [BaseDriver] "appium:app": "C:\All_Automation\Tutorial\src\ApiDemos-debug.apk", [debug] [BaseDriver] "appium:deviceName": "vikas" [debug] [BaseDriver] }, [debug] [BaseDriver] "firstMatch": [ [debug] [BaseDriver] {} [debug] [BaseDriver] ] [debug] [BaseDriver] } [BaseDriver] Session created with session id: 33934f35-701a-4fdf-a366-f6bd40ae8da3 [BaseDriver] Using local app 'C:\All_Automation\Tutorial\src\ApiDemos-debug.apk' [debug] [UiAutomator2] Checking whether app is actually present [ADB] Found 1 'build-tools' folders under 'C:\Users\E004612\AppData\Local\Android\Sdk' (newest first): [ADB] C:/Users/E004612/AppData/Local/Android/Sdk/build-tools/29.0.2 [ADB] Using 'adb.exe' from 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe' [AndroidDriver] Retrieving device list [debug] [ADB] Trying to find a connected android device [debug] [ADB] Getting connected devices... [debug] [ADB] Connected devices: [{"udid":"emulator-5554","state":"device"}] [AndroidDriver] Using device: emulator-5554 [ADB] Using 'adb.exe' from 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe' [debug] [ADB] Setting device id to emulator-5554 [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk' [debug] [ADB] Current device property 'ro.build.version.sdk': 28 [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.release' [debug] [ADB] Current device property 'ro.build.version.release': 9 [debug] [ADB] Device API level: 28 [UiAutomator2] Relaxing hidden api policy [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings put global hidden_api_policy_pre_p_apps 1' [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings put global hidden_api_policy_p_apps 1' [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings put global hidden_api_policy 1' [debug] [AndroidDriver] Parsing package and activity from app manifest [ADB] Package name: 'io.appium.android.apis' [ADB] Main activity name: 'ApiDemos' [debug] [AndroidDriver] Parsed package and activity are: io.appium.android.apis/ApiDemos [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 wait-for-device' [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -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 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -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 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -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 ('2.15.0' >= '2.15.0') [debug] [ADB] There is no need to install/upgrade 'C:\Users\E004612\AppData\Roaming\npm\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 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'pgrep --help; echo $?'' [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pgrep -f io\.appium\.settings' [debug] [AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions. [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell appops set io.appium.settings android\:mock_location allow' [debug] [Logcat] Starting logcat capture [debug] [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to 8201 [debug] [ADB] Forwarding system: 8201 to device: 6790 [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward tcp\:8201 tcp\:6790' [debug] [ADB] Getting install status for io.appium.uiautomator2.server [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -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 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -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.5.2' >= '4.5.2') [debug] [UiAutomator2] io.appium.uiautomator2.server installation state: sameVersionInstalled [debug] [ADB] Checking app cert for C:\Users\E004612\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.5.2.apk [ADB] Using 'apksigner.bat' from 'C:\Users\E004612\AppData\Local\Android\Sdk\build-tools\29.0.2\apksigner.bat' [debug] [ADB] Starting 'C:\Users\E004612\AppData\Local\Android\Sdk\build-tools\29.0.2\apksigner.bat' with args '["verify","--print-certs","C:\Users\E004612\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.5.2.apk"]' [debug] [ADB] apksigner stdout: Signer appium/appium#1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US [debug] [ADB] Signer appium/appium#1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc [debug] [ADB] Signer appium/appium#1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81 [debug] [ADB] Signer appium/appium#1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87 [debug] [ADB] [debug] [ADB] 'C:\Users\E004612\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.5.2.apk' is already signed. [debug] [ADB] Getting install status for io.appium.uiautomator2.server.test [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -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 C:\Users\E004612\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk [debug] [ADB] Starting 'C:\Users\E004612\AppData\Local\Android\Sdk\build-tools\29.0.2\apksigner.bat' with args '["verify","--print-certs","C:\Users\E004612\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk"]' [debug] [ADB] apksigner stdout: Signer appium/appium#1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US [debug] [ADB] Signer appium/appium#1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc [debug] [ADB] Signer appium/appium#1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81 [debug] [ADB] Signer appium/appium#1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87 [debug] [ADB] [debug] [ADB] 'C:\Users\E004612\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' is already signed. [UiAutomator2] Server packages are not going to be (re)installed [debug] [UiAutomator2] Waiting up to 30000ms for services to be available [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm list instrumentation' [debug] [UiAutomator2] Instrumentation target 'io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner' is available [debug] [ADB] Checking app cert for C:\All_Automation\Tutorial\src\ApiDemos-debug.apk [debug] [ADB] Starting 'C:\Users\E004612\AppData\Local\Android\Sdk\build-tools\29.0.2\apksigner.bat' with args '["verify","--print-certs","C:\All_Automation\Tutorial\src\ApiDemos-debug.apk"]' [debug] [ADB] apksigner stdout: Signer appium/appium#1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US [debug] [ADB] Signer appium/appium#1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc [debug] [ADB] Signer appium/appium#1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81 [debug] [ADB] Signer appium/appium#1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87 [debug] [ADB] [debug] [ADB] 'C:\All_Automation\Tutorial\src\ApiDemos-debug.apk' is already signed. [debug] [ADB] Getting install status for io.appium.android.apis [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.android.apis' [debug] [ADB] 'io.appium.android.apis' is installed [debug] [ADB] Getting package info for 'io.appium.android.apis' [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.android.apis' [ADB] Cannot read version codes of 'C:\All_Automation\Tutorial\src\ApiDemos-debug.apk' and/or 'io.appium.android.apis' [ADB] Cannot read version names of 'C:\All_Automation\Tutorial\src\ApiDemos-debug.apk' and/or 'io.appium.android.apis' [debug] [ADB] The current install state of 'C:\All_Automation\Tutorial\src\ApiDemos-debug.apk' is unknown. Installing anyway [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell 'ls -t -1 /data/local/tmp/appium_cache 2>&1 || echo ERROR'' [debug] [ADB] The count of applications in the cache: 4 [ADB] The application at 'C:\All_Automation\Tutorial\src\ApiDemos-debug.apk' is already cached to '/data/local/tmp/appium_cache/a7c3d3f518bf906dfd994f6290dfc7e6c703ccae.apk' [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm install -r /data/local/tmp/appium_cache/a7c3d3f518bf906dfd994f6290dfc7e6c703ccae.apk' [ADB] The installation of 'ApiDemos-debug.apk' took 2.419s [debug] [ADB] Install command stdout: Success [AndroidDriver] Performing fast reset on 'io.appium.android.apis' [debug] [ADB] Getting install status for io.appium.android.apis [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.android.apis' [debug] [ADB] 'io.appium.android.apis' is installed [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.android.apis' [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm clear io.appium.android.apis' [debug] [AndroidDriver] Performed fast reset on the installed 'io.appium.android.apis' application (stop and clear) [debug] [UiAutomator2] Performing shallow cleanup of automation leftovers [debug] [UiAutomator2] No obsolete sessions have been detected (Error: socket hang up) [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.uiautomator2.server.test' [UiAutomator2] Starting UIAutomator2 server 4.5.2 [UiAutomator2] Using UIAutomator2 server from 'C:\Users\E004612\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.5.2.apk' and test from 'C:\Users\E004612\AppData\Roaming\npm\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","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:8201/wd/hub/status] with no body [WD Proxy] Got an unexpected response with status undefined: {"code":"ECONNRESET"} [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [WD Proxy] Got an unexpected response with status undefined: {"code":"ECONNRESET"} [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [WD Proxy] Got an unexpected response with status undefined: {"code":"ECONNRESET"} [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [WD Proxy] Got an unexpected response with status undefined: {"code":"ECONNRESET"} [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [WD Proxy] Got an unexpected response with status undefined: {"code":"ECONNRESET"} [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [WD Proxy] Got an unexpected response with status undefined: {"code":"ECONNRESET"} [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [WD Proxy] Got an unexpected response with status undefined: {"code":"ECONNRESET"} [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [WD Proxy] Got an unexpected response with status undefined: {"code":"ECONNRESET"} [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [WD Proxy] Got an unexpected response with status undefined: {"code":"ECONNRESET"} [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [WD Proxy] Got an unexpected response with status undefined: {"code":"ECONNRESET"} [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:8201/wd/hub/status] with no body [WD Proxy] Got an unexpected response with status undefined: {"code":"ECONNRESET"} [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [WD Proxy] Got an unexpected response with status undefined: {"code":"ECONNRESET"} [debug] [WD Proxy] Matched '/status' to command name 'getStatus' [debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8201/wd/hub/status] with no body [debug] [WD Proxy] Got response with status 200: {"sessionId":"None","value":{"ready":true,"message":"UiAutomator2 Server is ready to accept commands"}} [debug] [UiAutomator2] The initialization of the instrumentation process took 13362ms [debug] [WD Proxy] Matched '/session' to command name 'createSession' [debug] [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8201/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","app":"C:\All_Automation\Tutorial\src\ApiDemos-debug.apk","deviceName":"vikas"},"platformName":"android","app":"C:\All_Automation\Tutorial\src\ApiDemos-debug.apk","deviceName":"emulator-5554","deviceUDID":"emulator-5554","appPackage":"io.appium.android.apis"}],"alwaysMatch":{}}} [debug] [WD Proxy] Got response with status 200: {"sessionId":"d1bf611f-8f7c-42bc-a7e3-d06ddbfd1a38","value":{"sessionId":"d1bf611f-8f7c-42bc-a7e3-d06ddbfd1a38","capabilities":{"firstMatch":[{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android","app":"C:\All_Automation\Tutorial\src\ApiDemos-debug.apk","deviceName":"vikas"},"platformName":"android","app":"C:\All_Automation\Tutorial\src\ApiDemos-debug.apk","deviceName":"emulator-5554","deviceUDID":"emulator-5554","appPackage":"io.appium.android.apis"}],"alwaysMatch":{}}}} [WD Proxy] Determined the downstream protocol as 'W3C' [debug] [WD Proxy] Proxying [GET /appium/device/info] to [GET http://127.0.0.1:8201/wd/hub/session/d1bf611f-8f7c-42bc-a7e3-d06ddbfd1a38/appium/device/info] with no body [debug] [WD Proxy] Got response with status 200: {"sessionId":"d1bf611f-8f7c-42bc-a7e3-d06ddbfd1a38","value":{"androidId":"8354ed000443ee6a","manufacturer":"Google","model":"AOSP on IA Emulator","brand":"google","apiVersion":"28","platformVersion":"9","carrierName":"Android","realDisplaySize":"1080x2220","displayDensity":440,"networks":[{"type":0,"typeName":"MOBILE","subtype":13,"subtypeName":"LTE","isConnected":true,"detailedState":"CONNECTED","state":"CONNECTED","extraInfo":"epc.tmobile.com","isAvailable":true,"isFailover":false,"isRoaming":false,"capabilities":{"transportTypes":"TRANSPORT_CELLULAR","networkCapabilities":"NET_CAPABILITY_MMS,NET_CAPABILITY_SUPL,NET_CAPABILITY_DUN,NET_CAPABILITY_FOTA,NET_CAPABILITY_IMS,NET_CAPABILITY_CBS,NET_CAPABILITY_IA,NET_CAPABILITY_INTERNET,NET_CAPABILITY_NOT_RESTRICTED,NET_CAPABILITY_TRUSTED,NET_CAPABILITY_NOT_VPN,NET_CAPABILITY_VALIDATED,NET_CAPABILITY_NOT_ROAMING,NET_CAPABILITY_NOT_CONGESTED,NET_CAPABILITY_NOT_SUSPENDED","linkUpstreamBandwidthKbps":51200,"linkDownBandwidthKbps":102400,"signalStrength":-2147483648... [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys window' [AndroidDriver] Screen already unlocked, doing nothing [UiAutomator2] Starting 'io.appium.android.apis/ApiDemos and waiting for 'io.appium.android.apis/ApiDemos' [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -W -n io.appium.android.apis/ApiDemos -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000' [debug] [ADB] We tried to start an activity that doesn't exist, retrying with '.ApiDemos' activity name [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -W -n io.appium.android.apis/.ApiDemos -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000' [debug] [ADB] Waiting up to 20000ms for activity matching pkg: 'io.appium.android.apis' and activity: 'ApiDemos' to be focused [debug] [ADB] Possible activities, to be checked: 'ApiDemos', 'io.appium.android.apis.ApiDemos' [debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'C:\Users\E004612\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys window windows' [debug] [ADB] Found package: 'io.appium.android.apis' and fully qualified activity name : 'io.appium.android.apis.ApiDemos' [debug] [WD Proxy] Proxying [GET /appium/device/pixel_ratio] to [GET http://127.0.0.1:8201/wd/hub/session/d1bf611f-8f7c-42bc-a7e3-d06ddbfd1a38/appium/device/pixel_ratio] with body: {} [debug] [WD Proxy] Got response with status 200: {"sessionId":"d1bf611f-8f7c-42bc-a7e3-d06ddbfd1a38","value":2.75} [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:8201/wd/hub/session/d1bf611f-8f7c-42bc-a7e3-d06ddbfd1a38/appium/device/system_bars] with body: {} [debug] [WD Proxy] Got response with status 200: {"sessionId":"d1bf611f-8f7c-42bc-a7e3-d06ddbfd1a38","value":{"statusBar":66}} [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:8201/wd/hub/session/d1bf611f-8f7c-42bc-a7e3-d06ddbfd1a38/window/current/size] with body: {} [debug] [WD Proxy] Got response with status 200: {"sessionId":"d1bf611f-8f7c-42bc-a7e3-d06ddbfd1a38","value":{"height":2088,"width":1080}} [Appium] New AndroidUiautomator2Driver session created successfully, session 33934f35-701a-4fdf-a366-f6bd40ae8da3 added to master session list [debug] [BaseDriver] Event 'newSessionStarted' logged at 1577352555565 (14:59:15 GMT+0530 (India Standard Time)) [debug] [W3C (33934f35)] Cached the protocol value 'W3C' for the new session 33934f35-701a-4fdf-a366-f6bd40ae8da3 [debug] [W3C (33934f35)] 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","app":"C:\All_Automation\Tutorial\src\ApiDemos-debug.apk","deviceName":"vikas"},"platformName":"android","app":"C:\All_Automation\Tutorial\src\ApiDemos-debug.apk","deviceName":"emulator-5554","deviceUDID":"emulator-5554","appPackage":"io.appium.android.apis","deviceApiLevel":28,"platformVersion":"9","deviceScreenSize":"1080x2220","deviceScreenDensity":440,"deviceModel":"AOSP on IA Emulator","deviceManufacturer":"Google","pixelRatio":2.75,"statBarHeight":66,"viewportRect":{"left":0,"top":66,"width":1080,"height":2022}}} [HTTP] <-- POST /wd/hub/session 200 46989 ms - 840 [HTTP] [HTTP] --> GET /wd/hub/session/33934f35-701a-4fdf-a366-f6bd40ae8da3 [HTTP] {} [debug] [W3C (33934f35)] Calling AppiumDriver.getSession() with args: ["33934f35-701a-4fdf-a366-f6bd40ae8da3"] [debug] [UiAutomator2] Getting session details from server to mix in [debug] [WD Proxy] Matched '/' to command name 'getSession' [debug] [WD Proxy] Proxying [GET /] to [GET http://127.0.0.1:8201/wd/hub/session/d1bf611f-8f7c-42bc-a7e3-d06ddbfd1a38] with body: {} [debug] [WD Proxy] Got response with status 200: {"sessionId":"d1bf611f-8f7c-42bc-a7e3-d06ddbfd1a38","value":{}} [debug] [W3C (33934f35)] Responding to client with driver.getSession() result: {"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android","app":"C:\All_Automation\Tutorial\src\ApiDemos-debug.apk","deviceName":"vikas"},"platformName":"android","app":"C:\All_Automation\Tutorial\src\ApiDemos-debug.apk","deviceName":"emulator-5554","deviceUDID":"emulator-5554","appPackage":"io.appium.android.apis","deviceApiLevel":28,"platformVersion":"9","deviceScreenSize":"1080x2220","deviceScreenDensity":440,"deviceModel":"AOSP on IA Emulator","deviceManufacturer":"Google","pixelRatio":2.75,"statBarHeight":66,"viewportRect":{"left":0,"top":66,"width":1080,"height":2022}} [HTTP] <-- GET /wd/hub/session/33934f35-701a-4fdf-a366-f6bd40ae8da3 200 34 ms - 772 [HTTP] 1

cigvikas commented 4 years ago

@mykola-mokhnach Any update on his, please?

valfirst commented 4 years ago

@cigvikas

java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils

This error means that dependency org.apache.commons:commons-lang3:3.9 is missing in your classpath

Satyam-Kumar1 commented 4 years ago

@cigvikas Please let us know how you had fixed this issue because I am also facing the same issue after running the script.

valfirst commented 4 years ago

@Satyam-Kumar1 have you tried this solution: https://github.com/appium/java-client/issues/1286#issuecomment-570574811 ?

Satyam-Kumar1 commented 4 years ago

@valfirst I have started the appium from the scratch level can you guide me how and where I have to add this dependency

mrk-han commented 4 years ago

This issue should probably be renamed to something like: "Exception: java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils"

elisiajoseph commented 4 years ago

any update on this issue? Adding the org.apache.commons:commons-lang3:3.9 dependency did not resolve it for me

valfirst commented 4 years ago

@elisiajoseph How have you added the dependency? And which error do you see after that?

elisiajoseph commented 4 years ago

@valfirst I added it as a maven dependency in my pom file. On running my appium tests I see the error: io.appium.java_client.remote.AppiumCommandExecutor$1 lambda$0 My tests then fail with a null pointer exception

part of appium logs: [XCUITest] Merging WDA caps over Appium caps for session detail response [W3C (61c21fa4)] Responding to client with driver.getSession() result: {"udid":"f9b3fd1a1c999f2f7c87d7d260237691e6a4c421","platformName":"ios","app":"/Users/user/Downloads/xyz.app","autoAcceptAlerts":true,"automationName":"XCUITest","deviceName":"Dummy","newCommandTimeout":75,"orientation":"LANDSCAPE","platformVersion":"11.4","updatedWDABundleId":"com.facebook.WebDriverAgentRunner","xcodeOrgId":"XXXXXXXXXX","xcodeSigningId":"iPhone Developer","device":"iphone","browserName":"xyz","sdkVersion":"11.4","CFBundleIdentifier":"com.xyz.abc","pixelRatio":2,"statBarHeight":20,"viewportRect":{"left":0,"top":40,"width":828,"height":1432}} [HTTP] <-- GET /wd/hub/session/61c21fa4-668b-4f83-8997-f18f57a46ff5 200 408 ms - 601 [HTTP] [HTTP] --> GET /wd/hub/session/61c21fa4-668b-4f83-8997-f18f57a46ff5 [HTTP] {} [W3C (61c21fa4)] Calling AppiumDriver.getSession() with args: ["61c21fa4-668b-4f83-8997-f18f57a46ff5"] [XCUITest] Executing command 'getSession' [XCUITest] Merging WDA caps over Appium caps for session detail response [W3C (61c21fa4)] Responding to client with driver.getSession() result: {"udid":"f9b3fd1a1c999f2f7c87d7d260237691e6a4c421","platformName":"ios","app":"/Users/user/Downloads/xyz.app","autoAcceptAlerts":true,"automationName":"XCUITest","deviceName":"Dummy","newCommandTimeout":75,"orientation":"LANDSCAPE","platformVersion":"11.4","updatedWDABundleId":"com.facebook.WebDriverAgentRunner","xcodeOrgId":"XXXXXXXXXX","xcodeSigningId":"iPhone Developer","device":"iphone","browserName":"xyz","sdkVersion":"11.4","CFBundleIdentifier":"com.xyz.abc","pixelRatio":2,"statBarHeight":20,"viewportRect":{"left":0,"top":40,"width":828,"height":1432}} [HTTP] <-- GET /wd/hub/session/61c21fa4-668b-4f83-8997-f18f57a46ff5 200 2 ms - 601 [HTTP] [BaseDriver] Shutting down because we waited 75 seconds for a command [Appium] Closing session, cause was 'New Command Timeout of 75 seconds expired. Try customizing the timeout using the 'newCommandTimeout' desired capability' [Appium] Removing session 61c21fa4-668b-4f83-8997-f18f57a46ff5 from our master session list [DevCon Factory] Releasing connections for f9b3fd1a1c999f2f7c87d7d260237691e6a4c421 device on any port number [DevCon Factory] Found cached connections to release: ["f9b3fd1a1c999f2f7c87d7d260237691e6a4c421:8100"] [DevCon Factory] Releasing the listener for 'f9b3fd1a1c999f2f7c87d7d260237691e6a4c421:8100'

valfirst commented 4 years ago

@eliasnogueira please post full error that you see on the client side

elisiajoseph commented 4 years ago

full logs: [Appium] Welcome to Appium v1.17.0 [Appium] Appium REST http interface listener started on 0.0.0.0:4723 [HTTP] --> GET /wd/hub/status [HTTP] {} [debug] [GENERIC] Calling AppiumDriver.getStatus() with args: [] [debug] [GENERIC] Responding to client with driver.getStatus() result: {"build":{"version":"1.17.0"}} [HTTP] <-- GET /wd/hub/status 200 6 ms - 68 [HTTP] Appium started service now with desired caps[HTTP] --> POST /wd/hub/session [HTTP] {"desiredCapabilities":{"app":"com.apps.testapp","xcodeOrgId":"XXXXXXXXXX","locationServicesEnabled":true,"deviceName":"Dummy","updatedWDABundleId":"com.facebook.WebDriverAgentRunner","xcodeSigningId":"iPhone Developer","showXcodeLog":true,"newCommandTimeout":75,"platformVersion":"11.4","automationName":"XCUITest","platformName":"iOS","udid":"f9b3fd1a1c999f2f7c87d7d260237691e6a4c421","autoAcceptAlerts":true},"capabilities":{"firstMatch":[{"appium:app":"com.apps.testapp","appium:autoAcceptAlerts":true,"appium:automationName":"XCUITest","appium:deviceName":"Dummy","appium:locationServicesEnabled":true,"appium:newCommandTimeout":75,"platformName":"ios","appium:platformVersion":"11.4","appium:showXcodeLog":true,"appium:udid":"f9b3fd1a1c999f2f7c87d7d260237691e6a4c421","appium:updatedWDABundleId":"com.facebook.WebDriverAgentRunner","appium:xcodeOrgId":"XXXXXXXXXX","appium:xcodeSigningId":"iPhone Developer"}]}} [debug] [W3C] Calling AppiumDriver.createSession() with args: [{"app":"com.apps.testapp","xcodeOrgId":"XXXXXXXXXX","locationServicesEnabled":true,"deviceName":"Dummy","updatedWDABundleId":"com.facebook.WebDriverAgentRunner","xcodeSigningId":"iPhone Developer","showXcodeLog":true,"newCommandTimeout":75,"platformVersion":"11.4","automationName":"XCUITest","platformName":"iOS","udid":"f9b3fd1a1c999f2f7c87d7d260237691e6a4c421","autoAcceptAlerts":true},null,{"firstMatch":[{"appium:app":"com.apps.testapp","appium:autoAcceptAlerts":true,"appium:automationName":"XCUITest","appium:deviceName":"Dummy","appium:locationServicesEnabled":true,"appium:newCommandTimeout":75,"platformName":"ios","appium:platformVersion":"11.4","appium:showXcodeLog":true,"appium:udid":"f9b3fd1a1c999f2f7c87d7d260237691e6a4c421","appium:updatedWDABundleId":"com.facebook.WebDriverAgentRunner","appium:xcodeOrgId":"XXXXXXXXXX","appium:xcodeSigningId":"iPhone Developer"}]}] [debug] [BaseDriver] Event 'newSessionRequested' logged at 1585537243185 (23:00:43 GMT-0400 (Eastern Daylight Time)) [Appium] Appium v1.17.0 creating new XCUITestDriver (v3.17.0) session [debug] [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided [debug] [BaseDriver] Creating session with W3C capabilities: { [debug] [BaseDriver] "alwaysMatch": { [debug] [BaseDriver] "platformName": "ios", [debug] [BaseDriver] "appium:app": "com.apps.testapp", [debug] [BaseDriver] "appium:autoAcceptAlerts": true, [debug] [BaseDriver] "appium:automationName": "XCUITest", [debug] [BaseDriver] "appium:deviceName": "Dummy", [debug] [BaseDriver] "appium:locationServicesEnabled": true, [debug] [BaseDriver] "appium:newCommandTimeout": 75, [debug] [BaseDriver] "appium:platformVersion": "11.4", [debug] [BaseDriver] "appium:showXcodeLog": true, [debug] [BaseDriver] "appium:udid": "f9b3fd1a1c999f2f7c87d7d260237691e6a4c421", [debug] [BaseDriver] "appium:updatedWDABundleId": "com.facebook.WebDriverAgentRunner", [debug] [BaseDriver] "appium:xcodeOrgId": "XXXXXXXXXX", [debug] [BaseDriver] "appium:xcodeSigningId": "iPhone Developer" [debug] [BaseDriver] }, [debug] [BaseDriver] "firstMatch": [ [debug] [BaseDriver] {} [debug] [BaseDriver] ] [debug] [BaseDriver] } [BaseDriver] Session created with session id: 404b0c26-3286-456a-92b4-ef18f17d3f52 [debug] [XCUITest] Current user: 'ejoseph' [debug] [XCUITest] Available devices: f9b3fd1a1c999f2f7c87d7d260237691e6a4c421 [debug] [XCUITest] Creating iDevice object with udid 'f9b3fd1a1c999f2f7c87d7d260237691e6a4c421' [XCUITest] Determining device to run tests on: udid: 'f9b3fd1a1c999f2f7c87d7d260237691e6a4c421', real device: true [debug] [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1585537243616 (23:00:43 GMT-0400 (Eastern Daylight Time)) [debug] [XCUITest] App is an iOS bundle, will attempt to run as pre-existing [debug] [BaseDriver] Event 'appConfigured' logged at 1585537243617 (23:00:43 GMT-0400 (Eastern Daylight Time)) [debug] [BaseDriver] Event 'resetStarted' logged at 1585537243617 (23:00:43 GMT-0400 (Eastern Daylight Time)) [debug] [XCUITest] Reset: running ios real device reset flow [debug] [BaseDriver] Event 'resetComplete' logged at 1585537243618 (23:00:43 GMT-0400 (Eastern Daylight Time)) [debug] [XCUITest] Crash reports root '/Users/ejoseph/Library/Logs/CrashReporter/MobileDevice/Dummy' does not exist. Got nothing to gather. [debug] [BaseDriver] Event 'logCaptureStarted' logged at 1585537243820 (23:00:43 GMT-0400 (Eastern Daylight Time)) [XCUITest] Setting up real device [WebDriverAgent] Using WDA path: '/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent' [WebDriverAgent] Using WDA agent: '/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj' [debug] [WebDriverAgent] Error: Command 'lsof -ti tcp\:8100' exited with code 1 [debug] [WebDriverAgent] at ChildProcess.proc.on.code (/usr/local/lib/node_modules/appium/node_modules/teen_process/lib/exec.js:113:19) [debug] [WebDriverAgent] at ChildProcess.emit (events.js:188:13) [debug] [WebDriverAgent] at maybeClose (internal/child_process.js:978:16) [debug] [WebDriverAgent] at Socket.stream.socket.on (internal/child_process.js:395:11) [debug] [WebDriverAgent] at Socket.emit (events.js:188:13) [debug] [WebDriverAgent] at Pipe._handle.close (net.js:609:12) [debug] [WebDriverAgent] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found [DevCon Factory] Requesting connection for device f9b3fd1a1c999f2f7c87d7d260237691e6a4c421 on local port 8100, device port 8100 [debug] [DevCon Factory] Cached connections count: 0 [DevCon Factory] Successfully requested the connection for f9b3fd1a1c999f2f7c87d7d260237691e6a4c421:8100 [debug] [WebDriverAgent] Parsed BUILD_DIR configuration value: '/Users/ejoseph/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu/Build/Products' [debug] [WebDriverAgent] Got derived data root: '/Users/ejoseph/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu' [debug] [XCUITest] Starting WebDriverAgent initialization with the synchronization key '/Users/ejoseph/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu' [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: { [debug] [WD Proxy] "value" : { [debug] [WD Proxy] "message" : "WebDriverAgent is ready to accept commands", [debug] [WD Proxy] "state" : "success", [debug] [WD Proxy] "os" : { [debug] [WD Proxy] "name" : "iOS", [debug] [WD Proxy] "version" : "11.4", [debug] [WD Proxy] "sdkVersion" : "13.0" [debug] [WD Proxy] }, [debug] [WD Proxy] "ios" : { [debug] [WD Proxy] "simulatorVersion" : "11.4", [debug] [WD Proxy] "ip" : "192.168.0.11" [debug] [WD Proxy] }, [debug] [WD Proxy] "ready" : true, [debug] [WD Proxy] "build" : { [debug] [WD Proxy] "upgradedAt" : "1585526795320", [debug] [WD Proxy] "time" : "Mar 29 2020 21:47:34", [debug] [WD Proxy] "productBundleIdentifier" : "com.facebook.WebDriverAgentRunner" [debug] [WD Proxy] } [debug] [WD Proxy] }, [debug] [WD Proxy] "sessionId" : "694A0CF6-F2B7-4F41-8F40-110FC5CA6256" [debug] [WD Proxy] } [debug] [WebDriverAgent] Upgrade timestamp of the currently bundled WDA: 1585526795320 [debug] [WebDriverAgent] Upgrade timestamp of the WDA on the device: 1585526795320 [WebDriverAgent] Will reuse previously cached WDA instance at 'http://127.0.0.1:8100/' with 'com.facebook.WebDriverAgentRunner'. Set the wdaLocalPort capability to a value different from 8100 if this is an undesired behavior. [debug] [XCUITest] Trying to start WebDriverAgent 1 times with 10000ms interval [debug] [XCUITest] These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities [debug] [BaseDriver] Event 'wdaStartAttempted' logged at 1585537246095 (23:00:46 GMT-0400 (Eastern Daylight Time)) [WebDriverAgent] Using provided WebdriverAgent at 'http://127.0.0.1:8100/' [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: { [debug] [WD Proxy] "value" : { [debug] [WD Proxy] "message" : "WebDriverAgent is ready to accept commands", [debug] [WD Proxy] "state" : "success", [debug] [WD Proxy] "os" : { [debug] [WD Proxy] "name" : "iOS", [debug] [WD Proxy] "version" : "11.4", [debug] [WD Proxy] "sdkVersion" : "13.0" [debug] [WD Proxy] }, [debug] [WD Proxy] "ios" : { [debug] [WD Proxy] "simulatorVersion" : "11.4", [debug] [WD Proxy] "ip" : "192.168.0.11" [debug] [WD Proxy] }, [debug] [WD Proxy] "ready" : true, [debug] [WD Proxy] "build" : { [debug] [WD Proxy] "upgradedAt" : "1585526795320", [debug] [WD Proxy] "time" : "Mar 29 2020 21:47:34", [debug] [WD Proxy] "productBundleIdentifier" : "com.facebook.WebDriverAgentRunner" [debug] [WD Proxy] } [debug] [WD Proxy] }, [debug] [WD Proxy] "sessionId" : "694A0CF6-F2B7-4F41-8F40-110FC5CA6256" [debug] [WD Proxy] } [debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1585537246111 (23:00:46 GMT-0400 (Eastern Daylight 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":[{"bundleId":"com.apps.testapp","arguments":[],"environment":{},"eventloopIdleDelaySec":0,"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true,"defaultAlertAction":"accept"}],"alwaysMatch":{}}} [debug] [WD Proxy] Got response with status 200: {"value":{"sessionId":"8C1EDB97-0A89-43AB-B3C8-35400D0FD49E","capabilities":{"device":"iphone","browserName":"testapp","sdkVersion":"11.4","CFBundleIdentifier":"com.apps.testapp"}},"sessionId":"8C1EDB97-0A89-43AB-B3C8-35400D0FD49E"} [WD Proxy] Determined the downstream protocol as 'W3C' [debug] [BaseDriver] Event 'wdaSessionStarted' logged at 1585537249178 (23:00:49 GMT-0400 (Eastern Daylight Time)) [debug] [BaseDriver] Event 'wdaStarted' logged at 1585537249178 (23:00:49 GMT-0400 (Eastern Daylight Time)) [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 1585537249179 (23:00:49 GMT-0400 (Eastern Daylight Time)) [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 [Appium] New XCUITestDriver session created successfully, session 404b0c26-3286-456a-92b4-ef18f17d3f52 added to master session list [debug] [BaseDriver] Event 'newSessionStarted' logged at 1585537249181 (23:00:49 GMT-0400 (Eastern Daylight Time)) [debug] [W3C (404b0c26)] Cached the protocol value 'W3C' for the new session 404b0c26-3286-456a-92b4-ef18f17d3f52 [debug] [W3C (404b0c26)] Responding to client with driver.createSession() result: {"capabilities":{"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"platformName":"ios","app":"com.apps.testapp","autoAcceptAlerts":true,"automationName":"XCUITest","deviceName":"Dummy","locationServicesEnabled":true,"newCommandTimeout":75,"platformVersion":"11.4","showXcodeLog":true,"udid":"f9b3fd1a1c999f2f7c87d7d260237691e6a4c421","updatedWDABundleId":"com.facebook.WebDriverAgentRunner","xcodeOrgId":"XXXXXXXXXX","xcodeSigningId":"iPhone Developer"}} [HTTP] <-- POST /wd/hub/session 200 6000 ms - 671 [HTTP] Mar 29, 2020 11:00:49 PM io.appium.java_client.remote.AppiumCommandExecutor$1 lambda$0 INFO: Detected dialect: W3C [HTTP] --> GET /wd/hub/session/404b0c26-3286-456a-92b4-ef18f17d3f52 [HTTP] {} [debug] [W3C (404b0c26)] Calling AppiumDriver.getSession() with args: ["404b0c26-3286-456a-92b4-ef18f17d3f52"] [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/8C1EDB97-0A89-43AB-B3C8-35400D0FD49E] with no body [debug] [WD Proxy] Got response with status 200: { [debug] [WD Proxy] "value" : { [debug] [WD Proxy] "sessionId" : "8C1EDB97-0A89-43AB-B3C8-35400D0FD49E", [debug] [WD Proxy] "capabilities" : { [debug] [WD Proxy] "device" : "iphone", [debug] [WD Proxy] "browserName" : "testapp", [debug] [WD Proxy] "sdkVersion" : "11.4", [debug] [WD Proxy] "CFBundleIdentifier" : "com.apps.testapp" [debug] [WD Proxy] } [debug] [WD Proxy] }, [debug] [WD Proxy] "sessionId" : "8C1EDB97-0A89-43AB-B3C8-35400D0FD49E" [debug] [WD Proxy] } [debug] [WD Proxy] Proxying [GET /wda/screen] to [GET http://127.0.0.1:8100/session/8C1EDB97-0A89-43AB-B3C8-35400D0FD49E/wda/screen] with no body [debug] [WD Proxy] Got response with status 200: { [debug] [WD Proxy] "value" : { [debug] [WD Proxy] "statusBarSize" : { [debug] [WD Proxy] "width" : 414, [debug] [WD Proxy] "height" : 20 [debug] [WD Proxy] }, [debug] [WD Proxy] "scale" : 2 [debug] [WD Proxy] }, [debug] [WD Proxy] "sessionId" : "8C1EDB97-0A89-43AB-B3C8-35400D0FD49E" [debug] [WD Proxy] } [debug] [WD Proxy] Proxying [GET /window/size] to [GET http://127.0.0.1:8100/session/8C1EDB97-0A89-43AB-B3C8-35400D0FD49E/window/size] with no body [debug] [WD Proxy] Got response with status 200: { [debug] [WD Proxy] "value" : { [debug] [WD Proxy] "width" : 414, [debug] [WD Proxy] "height" : 736 [debug] [WD Proxy] }, [debug] [WD Proxy] "sessionId" : "8C1EDB97-0A89-43AB-B3C8-35400D0FD49E" [debug] [WD Proxy] } [XCUITest] Merging WDA caps over Appium caps for session detail response [debug] [W3C (404b0c26)] Responding to client with driver.getSession() result: {"udid":"f9b3fd1a1c999f2f7c87d7d260237691e6a4c421","platformName":"ios","app":"com.apps.testapp","autoAcceptAlerts":true,"automationName":"XCUITest","deviceName":"Dummy","locationServicesEnabled":true,"newCommandTimeout":75,"platformVersion":"11.4","showXcodeLog":true,"updatedWDABundleId":"com.facebook.WebDriverAgentRunner","xcodeOrgId":"XXXXXXXXXX","xcodeSigningId":"iPhone Developer","device":"iphone","browserName":"testapp","sdkVersion":"11.4","CFBundleIdentifier":"com.apps.testapp","pixelRatio":2,"statBarHeight":20,"viewportRect":{"left":0,"top":40,"width":828,"height":1432}} [HTTP] <-- GET /wd/hub/session/404b0c26-3286-456a-92b4-ef18f17d3f52 200 276 ms - 614 [HTTP] [HTTP] --> GET /wd/hub/session/404b0c26-3286-456a-92b4-ef18f17d3f52 [HTTP] {} [debug] [W3C (404b0c26)] Calling AppiumDriver.getSession() with args: ["404b0c26-3286-456a-92b4-ef18f17d3f52"] [debug] [XCUITest] Executing command 'getSession' [XCUITest] Merging WDA caps over Appium caps for session detail response [debug] [W3C (404b0c26)] Responding to client with driver.getSession() result: {"udid":"f9b3fd1a1c999f2f7c87d7d260237691e6a4c421","platformName":"ios","app":"com.apps.testapp","autoAcceptAlerts":true,"automationName":"XCUITest","deviceName":"Dummy","locationServicesEnabled":true,"newCommandTimeout":75,"platformVersion":"11.4","showXcodeLog":true,"updatedWDABundleId":"com.facebook.WebDriverAgentRunner","xcodeOrgId":"XXXXXXXXXX","xcodeSigningId":"iPhone Developer","device":"iphone","browserName":"testapp","sdkVersion":"11.4","CFBundleIdentifier":"com.apps.testapp","pixelRatio":2,"statBarHeight":20,"viewportRect":{"left":0,"top":40,"width":828,"height":1432}} [HTTP] <-- GET /wd/hub/session/404b0c26-3286-456a-92b4-ef18f17d3f52 200 1 ms - 614 [HTTP]

java.lang.NullPointerException at com.apps.mobile.testapp.ios.testappIOSTest.verifyForgotPasswordTest(testappIOSTest.java:39) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:133) at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:584) at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:172) at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46) at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:804) at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:145) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)

valfirst commented 4 years ago

@elisiajoseph

java.lang.NullPointerException at com.apps.mobile.testapp.ios.testappIOSTest.verifyForgotPasswordTest(testappIOSTest.java:39)

you have NPE in your test

elisiajoseph commented 4 years ago

@valfirst yes Im trying to figure out what's causing it. The line thats its throwing the null pointer exception is 'object.clickOnForgotPassword()' Test class: @Test(priority = 0) public void verifyForgotPasswordTest() { object.clickOnForgotPassword() .enterResetPasswordUsernameAndClickOK("abc"); main class : public TestIOSApp clickOnForgotPassword() { MobileActions.waitForElementById(iosDriver, forgotPassword, 60).click(); return this; }

valfirst commented 4 years ago

@elisiajoseph you current problem has nothing common to this issue

samarthpatil747 commented 4 years ago

Hello everyone facing same problem. Please can anyone help? i've added already the suggested library org.apache.commons:commons-lang3:3. but Getting same error

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'io.appium.android.apis' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Could not get focusPackageAndActivity. Original error: Could not parse activity from dumpsys Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: 'DESKTOP-70B30LU', ip: '192.168.0.10', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_251' Driver info: driver.version: AndroidDriver remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'io.appium.android.apis' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Could not get focusPackageAndActivity. Original error: Could not parse activity from dumpsys at getResponseForW3CError (C:\Users\Samarth\AppData\Local\Programs\Appium\resources\app\node_modules\appium-base-driver\lib\protocol\errors.js:826:9) at asyncHandler (C:\Users\Samarth\AppData\Local\Programs\Appium\resources\app\node_modules\appium-base-driver\lib\protocol\protocol.js:447:37) at process._tickCallback (internal/process/next_tick.js:68:7) Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: 'DESKTOP-70B30LU', ip: '192.168.0.10', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_251' Driver info: driver.version: AndroidDriver at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:208) at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:217) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:41) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213) at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:336) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131) at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:37) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:88) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:98) at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:94) at base.Capabilities(base.java:25) at basics.main(basics.java:12) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:186) ... 15 more Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'io.appium.android.apis' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Could not get focusPackageAndActivity. Original error: Could not parse activity from dumpsys Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: 'DESKTOP-70B30LU', ip: '192.168.0.10', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_251' Driver info: driver.version: AndroidDriver remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'io.appium.android.apis' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Could not get focusPackageAndActivity. Original error: Could not parse activity from dumpsys at getResponseForW3CError (C:\Users\Samarth\AppData\Local\Programs\Appium\resources\app\node_modules\appium-base-driver\lib\protocol\errors.js:826:9) at asyncHandler (C:\Users\Samarth\AppData\Local\Programs\Appium\resources\app\node_modules\appium-base-driver\lib\protocol\protocol.js:447:37) at process._tickCallback (internal/process/next_tick.js:68:7) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62) at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30) at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128) ... 20 more

Sharing raw logs.

[info] [Appium] Welcome to Appium v1.10.0 [info] [Appium] Appium REST http interface listener started on 0.0.0.0:4723[info] [HTTP] --> POST /wd/hub/session [info] [HTTP] {"desiredCapabilities":{"app":"C:\\Users\\Samarth\\eclipse-workspace\\Sample\\src\\ApiDemos.apk","automationName":"UIAutomator2","platformName":"Android","deviceName":"samarthemulator"},"capabilities":{"firstMatch":[{"appium:app":"C:\\Users\\Samarth\\eclipse-workspace\\Sample\\src\\ApiDemos.apk","appium:automationName":"UIAutomator2","appium:deviceName":"samarthemulator","platformName":"android"}]}} [debug] [W3C] Calling AppiumDriver.createSession() with args: [{"app":"C:\\Users\\Samarth\\eclipse-workspace\\Sample\\src\\ApiDemos.apk","automationName":"UIAutomator2","platformName":"Android","deviceName":"samarthemulator"},null,{"firstMatch":[{"appium:app":"C:\\Users\\Samarth\\eclipse-workspace\\Sample\\src\\ApiDemos.apk","appium:automationName":"UIAutomator2","appium:deviceName":"samarthemulator","platformName":"android"}]}] [debug] [BaseDriver] Event 'newSessionRequested' logged at 1590345661091 (00:11:01 GMT+0530 (India Standard Time)) [info] [Appium] Creating new AndroidUiautomator2Driver (v1.26.0) session [info] [Appium] Capabilities: [info] [Appium] platformName: android [info] [Appium] app: C:\Users\Samarth\eclipse-workspace\Sample\src\ApiDemos.apk [info] [Appium] automationName: UIAutomator2 [info] [Appium] deviceName: samarthemulator [debug] [BaseDriver] W3C capabilities {"alwaysMatch":{"platformNa... and MJSONWP desired capabilities {"app":"C:\\Users\\Samarth\... were provided [debug] [BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"platformNa... [info] [BaseDriver] Session created with session id: b38c2b05-ea4b-41b8-8e59-3d767d3b521a[info] [AndroidDriver] Java version is: 1.8.0_251 [info] [ADB] Checking whether adb is present [info] [ADB] Found 6 'build-tools' folders under 'D:\Appium\android-sdk' (newest first): [info] [ADB] D:/Appium/android-sdk/build-tools/29.0.3 [info] [ADB] D:/Appium/android-sdk/build-tools/28.0.3 [info] [ADB] D:/Appium/android-sdk/build-tools/28.0.2 [info] [ADB] D:/Appium/android-sdk/build-tools/28.0.1 [info] [ADB] D:/Appium/android-sdk/build-tools/28.0.0 [info] [ADB] D:/Appium/android-sdk/build-tools/19.1.0 [info] [ADB] Using adb.exe from D:\Appium\android-sdk\platform-tools\adb.exe [info] [AndroidDriver] Retrieving device list [debug] [ADB] Trying to find a connected android device [debug] [ADB] Getting connected devices...[debug] [ADB] 1 device(s) connected [info] [AndroidDriver] Using device: RZ8M30CQBJV [debug] [ADB] Setting device id to RZ8M30CQBJV [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell getprop ro.build.version.sdk'[debug] [ADB] Current device property 'ro.build.version.sdk': 29 [debug] [ADB] Device API level: 29 [warn] [UiAutomator2] Relaxing hidden api policy [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell settings put global hidden_api_policy_pre_p_apps 1'[debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell settings put global hidden_api_policy_p_apps 1'[debug] [AndroidDriver] Parsing package and activity from app manifest [info] [ADB] Using the alternative activity name detection method because of: Could not find apkanalyzer.bat in D:\Appium\android-sdk\platform-tools\apkanalyzer.bat,D:\Appium\android-sdk\emulator\apkanalyzer.bat,D:\Appium\android-sdk\tools\apkanalyzer.bat,D:\Appium\android-sdk\tools\bin\apkanalyzer.bat,D:\Appium\android-sdk\build-tools\29.0.3\apkanalyzer.bat,D:\Appium\android-sdk\build-tools\28.0.3\apkanalyzer.bat,D:\Appium\android-sdk\build-tools\28.0.2\apkanalyzer.bat,D:\Appium\android-sdk\build-tools\28.0.1\apkanalyzer.bat,D:\Appium\android-sdk\build-tools\28.0.0\apkanalyzer.bat,D:\Appium\android-sdk\build-tools\19.1.0\apkanalyzer.bat. Do you have the Android SDK installed at 'D:\Appium\android-sdk'? [info] [ADB] Checking whether aapt is present [info] [ADB] Using aapt.exe from D:\Appium\android-sdk\build-tools\29.0.3\aapt.exe [info] [ADB] Extracting package and launch activity from manifest[info] [ADB] Package name: 'io.appium.android.apis' [info] [ADB] Main activity name: 'io.appium.android.apis.ApiDemos' [debug] [AndroidDriver] Parsed package and activity are: io.appium.android.apis/io.appium.android.apis.ApiDemos [debug] [ADB] Getting install status for io.appium.uiautomator2.server [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV 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 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV 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 ('3.1.1' >= '3.1.1') [debug] [UiAutomator2] io.appium.uiautomator2.server installation state: sameVersionInstalled [debug] [ADB] Checking app cert for C:\Users\Samarth\AppData\Local\Programs\Appium\resources\app\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v3.1.1.apk [info] [ADB] Using apksigner.bat from D:\Appium\android-sdk\build-tools\29.0.3\apksigner.bat [debug] [ADB] Starting 'D:\Appium\android-sdk\build-tools\29.0.3\apksigner.bat' with args '["verify","--print-certs","C:\\Users\\Samarth\\AppData\\Local\\Programs\\Appium\\resources\\app\\node_modules\\appium-uiautomator2-server\\apks\\appium-uiautomator2-server-v3.1.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] 'C:\Users\Samarth\AppData\Local\Programs\Appium\resources\app\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v3.1.1.apk' is already signed. [debug] [ADB] Checking app cert for C:\Users\Samarth\AppData\Local\Programs\Appium\resources\app\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk [debug] [ADB] Starting 'D:\Appium\android-sdk\build-tools\29.0.3\apksigner.bat' with args '["verify","--print-certs","C:\\Users\\Samarth\\AppData\\Local\\Programs\\Appium\\resources\\app\\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] 'C:\Users\Samarth\AppData\Local\Programs\Appium\resources\app\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' is already signed. [info] [UiAutomator2] Server packages are not going to be (re)installed [debug] [UiAutomator2] Waiting up to 20000ms for instrumentation 'io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner' to be available [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell pm list instrumentation'[debug] [UiAutomator2] Instrumentation 'io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner' available [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV wait-for-device' [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell echo ping' [debug] [AndroidDriver] Pushing settings apk to device... [debug] [ADB] Getting install status for io.appium.settings [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV 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 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys package io.appium.settings'[debug] [ADB] The version code of the installed 'io.appium.settings' is greater than the application version code (19 > 13) [debug] [ADB] There is no need to install/upgrade 'C:\Users\Samarth\AppData\Local\Programs\Appium\resources\app\node_modules\io.appium.settings\apks\settings_apk-debug.apk' [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell ps'[debug] [AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions. [debug] [ADB] Device API level: 29 [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell appops set io.appium.settings android\:mock_location allow'[debug] [Logcat] Starting logcat capture [debug] [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to 8200 [debug] [ADB] Forwarding system: 8200 to device: 6790 [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV forward tcp\:8200 tcp\:6790'[debug] [ADB] Checking app cert for C:\Users\Samarth\eclipse-workspace\Sample\src\ApiDemos.apk [debug] [ADB] Starting 'D:\Appium\android-sdk\build-tools\29.0.3\apksigner.bat' with args '["verify","--print-certs","C:\\Users\\Samarth\\eclipse-workspace\\Sample\\src\\ApiDemos.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] 'C:\Users\Samarth\eclipse-workspace\Sample\src\ApiDemos.apk' is already signed. [debug] [ADB] Getting install status for io.appium.android.apis [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys package io.appium.android.apis'[debug] [ADB] 'io.appium.android.apis' is installed [debug] [ADB] Getting install status for io.appium.android.apis [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys package io.appium.android.apis'[debug] [ADB] 'io.appium.android.apis' is installed [debug] [ADB] Getting package info for 'io.appium.android.apis' [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys package io.appium.android.apis'[debug] [ADB] The version name of the installed 'io.appium.android.apis' is greater or equal to the application version name ('3.1.0' >= '3.1.0') [debug] [ADB] There is no need to install/upgrade 'C:\Users\Samarth\eclipse-workspace\Sample\src\ApiDemos.apk' [info] [AndroidDriver] Performing fast reset on 'io.appium.android.apis' [debug] [ADB] Getting install status for io.appium.android.apis [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys package io.appium.android.apis'[debug] [ADB] 'io.appium.android.apis' is installed [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell am force-stop io.appium.android.apis'[debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell pm clear io.appium.android.apis'[debug] [AndroidDriver] Performed fast reset on the installed 'io.appium.android.apis' application (stop and clear) [debug] [ADB] Getting all processes with uiautomator [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell ps'[debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell am force-stop io.appium.uiautomator2.server' [info] [UiAutomator2] Starting UIAutomator2 server 3.1.1 [info] [UiAutomator2] Using UIAutomator2 server from 'C:\Users\Samarth\AppData\Local\Programs\Appium\resources\app\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v3.1.1.apk' and test from 'C:\Users\Samarth\AppData\Local\Programs\Appium\resources\app\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' [info] [UiAutomator2] Running command: 'adb -s RZ8M30CQBJV shell am instrument -w io.appium.uiautomator2.server.test/androidx.test.runner.AndroidJUnitRunner' [info] [UiAutomator2] Waiting up to 20000ms for UiAutomator2 to be online... [debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body[warn] [JSONWP Proxy] Got an unexpected response: {"code":"ECONNRESET"}[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [warn] [JSONWP Proxy] Got an unexpected response: {"code":"ECONNRESET"}[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [warn] [JSONWP Proxy] Got an unexpected response: {"code":"ECONNRESET"}[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [warn] [JSONWP Proxy] Got an unexpected response: {"code":"ECONNRESET"}[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [warn] [JSONWP Proxy] Got an unexpected response: {"code":"ECONNRESET"}[debug] [JSONWP Proxy] Matched '/status' to command name 'getStatus' [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body[debug] [JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"SESSIONID\",\"status\":0,\"value\":\"Status Invoked\"}" [debug] [JSONWP Proxy] Matched '/session' to command name 'createSession' [debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8200/wd/hub/session] with body: {"desiredCapabilities":{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android","app":"C:\\Users\\Samarth\\eclipse-workspace\\Sample\\src\\ApiDemos.apk","automationName":"UIAutomator2","deviceName":"samarthemulator"},"platformName":"android","app":"C:\\Users\\Samarth\\eclipse-workspace\\Sample\\src\\ApiDemos.apk","automationName":"UIAutomator2","deviceName":"RZ8M30CQBJV","deviceUDID":"RZ8M30CQBJV","appPackage":"io.appium.android.apis"}} [debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"e717d866-ac78-4a9f-a1fc-f8f44db65df6","status":0,"value":"Created Session"} [debug] [JSONWP Proxy] Proxying [GET /appium/device/info] to [GET http://localhost:8200/wd/hub/session/e717d866-ac78-4a9f-a1fc-f8f44db65df6/appium/device/info] with no body [debug] [JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"e717d866-ac78-4a9f-a1fc-f8f44db65df6\",\"status\":0,\"value\":{\"androidId\":\"1d72a297acf97de9\",\"manufacturer\":\"samsung\",\"model\":\"SM-A305F\",\"brand\":\"samsung\",\"apiVersion\":\"29\",\"platformVersion\":\"10\",\"carrierName\":\"Jio 4G\",\"realDisplaySize\":\"1080x2340\",\"displayDensity\":420}}" [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window'[info] [AndroidDriver] Screen already unlocked, doing nothing [info] [UiAutomator2] UiAutomator2 did not start the activity we were waiting for, 'io.appium.android.apis/io.appium.android.apis.ApiDemos'. Starting it ourselves [debug] [ADB] Device API level: 29 [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell am start -W -n io.appium.android.apis/io.appium.android.apis.ApiDemos -S'[debug] [ADB] Waiting up to 20000ms for activity matching pkg: 'io.appium.android.apis' and activity: 'io.appium.android.apis.ApiDemos' to be focused [debug] [ADB] Possible activities, to be checked: 'io.appium.android.apis.ApiDemos', 'io.appium.android.apis.io.appium.android.apis.ApiDemos' [debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [ADB] Getting focused package and activity [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell dumpsys window windows'[debug] [UiAutomator2] Deleting UiAutomator2 session [debug] [UiAutomator2] Deleting UiAutomator2 server session [debug] [JSONWP Proxy] Matched '/' to command name 'deleteSession' [debug] [JSONWP Proxy] Proxying [DELETE /] to [DELETE http://localhost:8200/wd/hub/session/e717d866-ac78-4a9f-a1fc-f8f44db65df6] with no body [debug] [JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"e717d866-ac78-4a9f-a1fc-f8f44db65df6\",\"status\":0,\"value\":\"Session deleted\"}" [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell am force-stop io.appium.android.apis'[debug] [Logcat] Stopping logcat capture [debug] [ADB] Removing forwarded port socket connection: 8200 [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV forward --remove tcp\:8200' [debug] [ADB] Device API level: 29 [info] [UiAutomator2] Restoring hidden api policy to the device default configuration [debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell settings delete global hidden_api_policy_pre_p_apps'[debug] [ADB] Running 'D:\Appium\android-sdk\platform-tools\adb.exe -P 5037 -s RZ8M30CQBJV shell settings delete global hidden_api_policy_p_apps'[debug] [BaseDriver] Event 'newSessionStarted' logged at 1590345717241 (00:11:57 GMT+0530 (India Standard Time)) [debug] [W3C] Encountered internal error running command: Error: Cannot start the 'io.appium.android.apis' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Could not get focusPackageAndActivity. Original error: Could not parse activity from dumpsys [debug] [W3C] at ADB.apkUtilsMethods.startApp (C:\Users\Samarth\AppData\Local\Programs\Appium\resources\app\node_modules\appium-adb\lib\tools\apk-utils.js:144:11) [debug] [W3C] at process._tickCallback (internal/process/next_tick.js:68:7) [info] [HTTP] <-- POST /wd/hub/session 500 56242 ms - 1230 [info] [HTTP] [debug] [UiAutomator2] [UIAutomator2] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:. [debug] [UiAutomator2] [UIAutomator2] Time: 30.066 [debug] [UiAutomator2] [UIAutomator2] OK (1 test)

sam-jombay commented 4 years ago

@cigvikas Have you found any solution for this?

primus11 commented 4 years ago

For some of you the problem might be really the one mentioned here org.openqa.selenium.remote.ProtocolHandshake createSession Error #707. INFO that is output is not problematic but it can be interpreted as STANDARD_ERROR causing CI for example to fail. Following Logging in 3.0.1 - Browser Initialization - ProtocolHandshake #3087 it is possible to suppress these with

Logger.getLogger("org.openqa.selenium.remote").setLevel(Level.ALL); // or Level.WARNING

yogi0067 commented 3 years ago

Please Start user Appium Server. Go to Commnd line and type appium, i will automatically use port 4723.