Appium frozen when sending command to Android - java

When android driver finding some element, appium frozen ([AndroidBootstrap] Sending command to android) and will die after some time. This happens only on one computer (Mac) and only on android.
At last appium sending this:
[Appium] New AndroidDriver session created successfully, session 7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d added to master session list
[debug] [MJSONWP] Responding to client with driver.createSession() result: {"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"app":"/Users/jenkins/.jenkins/jobs/Android5-test-ReleaseIntegtationTests-Demo/workspace/test-Integration-Tests/src/test/resources/testDemo-debug.apk","noReset":true,"newCommandTimeout":88,"udid":"018433348882859","platformName":"Android","deviceName":"Android","fullReset":false},"app":"/Users/jenkins/.jenkins/jobs/Android5-test-ReleaseIntegtationTests-Demo/workspace/test-Integration-Tests/src/test/resources/testDemo-debug.apk","noReset":true,"newCommandTimeout":88,"udid":"018433348882859","platformName":"Android","deviceName":"018433348882859","fullReset":false,"deviceUDID":"018433348882859","platformVersion":"5.1.1","appPackage":"com.my.testApp","appWaitPackage":"com.my.testApp","appActivity":"com.my.testApp.MainActivity","appWaitActivity":"com.my.targetDem...
[HTTP] <-- POST /wd/hub/session 200 6192 ms - 1112
[HTTP] --> GET /wd/hub/session/7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d {}
[debug] [MJSONWP] Calling AppiumDriver.getSession() with args: ["7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d"]
[debug] [MJSONWP] Responding to client with driver.getSession() result: {"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"app":"/Users/jenkins/.jenkins/jobs/Android5-test-ReleaseIntegtationTests-Demo/workspace/test-Integration-Tests/src/test/resources/testDemo-debug.apk","noReset":true,"newCommandTimeout":88,"udid":"018433348882859","platformName":"Android","deviceName":"Android","fullReset":false},"app":"/Users/jenkins/.jenkins/jobs/Android5-test-ReleaseIntegtationTests-Demo/workspace/test-Integration-Tests/src/test/resources/testDemo-debug.apk","noReset":true,"newCommandTimeout":88,"udid":"018433348882859","platformName":"Android","deviceName":"018433348882859","fullReset":false,"deviceUDID":"018433348882859","platformVersion":"5.1.1","appPackage":"com.my.testApp","appWaitPackage":"com.my.testApp","appActivity":"com.my.testApp.MainActivity","appWaitActivity":"com.my.targetDem...
[HTTP] <-- GET /wd/hub/session/7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d 200 5 ms - 1112
[HTTP] --> GET /wd/hub/session/7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d {}
[debug] [MJSONWP] Calling AppiumDriver.getSession() with args: ["7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d"]
[debug] [MJSONWP] Responding to client with driver.getSession() result: {"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"app":"/Users/jenkins/.jenkins/jobs/Android5-test-ReleaseIntegtationTests-Demo/workspace/test-Integration-Tests/src/test/resources/testDemo-debug.apk","noReset":true,"newCommandTimeout":88,"udid":"018433348882859","platformName":"Android","deviceName":"Android","fullReset":false},"app":"/Users/jenkins/.jenkins/jobs/Android5-test-ReleaseIntegtationTests-Demo/workspace/test-Integration-Tests/src/test/resources/testDemo-debug.apk","noReset":true,"newCommandTimeout":88,"udid":"018433348882859","platformName":"Android","deviceName":"018433348882859","fullReset":false,"deviceUDID":"018433348882859","platformVersion":"5.1.1","appPackage":"com.my.testApp","appWaitPackage":"com.my.testApp","appActivity":"com.my.testApp.MainActivity","appWaitActivity":"com.my.targetDem...
[HTTP] <-- GET /wd/hub/session/7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d 200 3 ms - 1112
[HTTP] --> POST /wd/hub/session/7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d/timeouts {"type":"implicit","ms":10000}
[debug] [MJSONWP] Calling AppiumDriver.timeouts() with args: ["implicit",10000,"7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d"]
[debug] [BaseDriver] Set implicit wait to 10000ms
[debug] [MJSONWP] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d/timeouts 200 3 ms - 76
[HTTP] --> POST /wd/hub/session/7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d/timeouts {"type":"implicit","ms":1000}
[debug] [MJSONWP] Calling AppiumDriver.timeouts() with args: ["implicit",1000,"7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d"]
[debug] [BaseDriver] Set implicit wait to 1000ms
[debug] [MJSONWP] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d/timeouts 200 3 ms - 76
[HTTP] --> POST /wd/hub/session/7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d/elements {"using":"id","value":"com.my.testApp:id/card_view"}
[debug] [MJSONWP] Calling AppiumDriver.findElements() with args: ["id","com.my.testApp:id/card_view","7de5c8a9-3d5e-49dc-b228-3b76f0cf5f1d"]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 1000 ms for condition
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.my.testApp:id/card_view","context":"","multiple":true}}
Appium: 1.6.1
io.appium:java-client:5.0.0-BETA3
ADB: 1.0.36
Appium Capabilities:
File appDir = new File(System.getProperty("user.dir") + properties.getProperty("appDir"));
File app = new File(appDir, System.getProperty("appName"));
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, System.getProperty("platform"));
capabilities.setCapability(MobileCapabilityType.UDID, System.getProperty("udid"));
capabilities.setCapability(MobileCapabilityType.NO_RESET, true);
capabilities.setCapability(MobileCapabilityType.FULL_RESET, false);
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 88);
androidDriver = new AndroidDriver(new URL(System.getProperty("appiumUrl")), capabilities);
androidDriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
Any ideas?

Reinstalling appium 1.6.1 not helped me.
But I resolved my issue after downgrade appium to 1.5.3 and upgrade back to 1.6.1.
Apparently version 1.5.3 pulled up the missing libraries. But why 1.6.1 didn't do it I don't know.

Related

Not able to send the keys to the input element

I'm trying to pass the login credentials to the input fields, everytime when I run the code the input field is getting identified, but the keys are not passing at the input field. Please help...
Code:
WebElement image=driver.findElement(By.xpath("//android.widget.Image[#content-desc='LandingPAge']"));
System.out.println("Landed Login page");
driver.findElementByXPath("//android.view.View[#content-desc='Username']").sendKeys("u3#gmail.com");
driver.findElementById("password").sendKeys("1231212");
driver.findElementByXPath("//android.widget.Button[#content-desc='Login']").click();
Appium Log Details:
[debug] [W3C (235592b3)] Calling AppiumDriver.setValue() with args: [["u","3","#","g","m","a","i","l",".","c","o","m"],"2","235592b3-a8eb-4ccb-8d22-fef43fa92679"]
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"element:setText","params":{"elementId":"2","text":"u3#gmail.com","replace":false}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"element:setText","params":{"elementId":"2","text":"u3#gmail.com","replace":false}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: setText
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using element passed in: 2
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Attempting to clear using UiObject.clearText().
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":7,"value":"UiSelector[CLASS=android.view.View, INSTANCE=5]"}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [MJSONWP] Matched JSONWP error code 7 to NoSuchElementError
[debug] [W3C (235592b3)] Encountered internal error running command: NoSuchElementError: UiSelector[CLASS=android.view.View, INSTANCE=5]
Ecllipse Console Error:
[RemoteTestNG] detected TestNG version 6.14.2
Jun 05, 2019 1:03:25 PM io.appium.java_client.remote.AppiumCommandExecutor$1 lambda$0
INFO: Detected dialect: W3C
Landed Login page
FAILED CONFIGURATION: #BeforeClass setUp
org.openqa.selenium.NoSuchElementException:
UiSelector[CLASS=android.view.View, INSTANCE=5]
For documentation on this error, please visit:
http://seleniumhq.org/exceptions/no_such_element.html
Although you're following like selenium sendKeys to enter text in input fields, sometimes appium does not work as it.
So first click on input field and then enter value using sendKeys as mentioned in below snippet.
driver.findElement(By.id("#loc")).click();
driver.findElement(By.id("#loc")).sendKeys("text);
Let me know if you still face any issue.

Appium Request to register with grid was unsuccessful: Error: getaddrinfo ENOTFOUND http http:80 while starting Selenium Grid Node

I'm at my wits end with this. I am trying to connect Appium (command line) through an attached device that is visible with adb devices. The grid is launched with the following conmmand
java -jar ../../selenium-server-standalone-3.6.0.jar -role hub -hubConfig ./hubconfig.json
and spins up as it should with the following:
C:\projects\mfa-functional\Selenium Batch Files>java -jar
C:/Selenium/SeleniumGrid/selenium-server-standalone-3.6.0.jar -role hub -
hubConfig C:/Selenium/SeleniumGrid/BatchFiles/Hub/hubconfig.json
13:40:15.686 INFO - Selenium build info: version: '3.6.0', revision:
'6fbf3ec767'
13:40:15.687 INFO - Launching Selenium Grid hub
2018-04-25 13:40:16.708:INFO::main: Logging initialized #1540ms to
org.seleniumhq.jetty9.util.log.StdErrLog
13:40:16.725 INFO - Will listen on 4444
2018-04-25 13:40:16.781:INFO:osjs.Server:main: jetty-9.4.5.v20170502
2018-04-25 13:40:16.816:INFO:osjs.session:main: DefaultSessionIdManager
workerName=node0
2018-04-25 13:40:16.816:INFO:osjs.session:main: No SessionScavenger set,
using defaults
2018-04-25 13:40:16.818:INFO:osjs.session:main: Scavenging every 600000ms
2018-04-25 13:40:16.825:INFO:osjsh.ContextHandler:main: Started
o.s.j.s.ServletContextHandler#2d2e5f00{/,null,AVAILABLE}
2018-04-25 13:40:16.852:INFO:osjs.AbstractConnector:main: Started
ServerConnector#5b0abc94{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
2018-04-25 13:40:16.852:INFO:osjs.Server:main: Started #1686ms
13:40:16.853 INFO - Nodes should register to
http://127.0.0.1:4444/grid/register/
13:40:16.853 INFO - Selenium Grid hub is up and running
with the following config.json
{
"host": "127.0.0.1",
"maxSessions": 35,
"port": 4444,
"cleanupCycle": 5000,
"timeout": 300000,
"newSessionWaitTimeout": -1,
"servlets": [],
"prioritizer": null,
"capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
"throwOnCapabilityNotPresent": true,
"nodePolling": 180000,
"platform": "WINDOWS"
}
I am trying to spin up a node to connect to this hub with the following command
appium -a 127.0.0.1 --nodeconfig MKs_tablet.json
MKs_tablet.json looks as follows
{
"capabilities":
[
{
"appiumVersion" : "1.8.0",
"browserName": "andriod",
"version":"4.4.2",
"maxInstances": 1,
"platform":"Android",
"deviceName" : "KJOVSCGISWSC8HOV"
}
],
"configuration" :
{
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 2,
"url":"http://http://127.0.0.1:4723/wd/hub",
"host" : "http://127.0.0.1",
"port": 4723,
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": "http://127.0.0.1",
"nodeStatusCheckTimeout": 5000
}
}
The appium node spins up just fine, but cannot seem to connect to the grid hub. The result is as follows:
C:\Selenium\SeleniumGrid\ExternalDeviceConfig\Appium Device Configs>appium -
a 127.0.0.1 --nodeconfig MKs_tablet.json
[Appium] Welcome to Appium v1.8.0
[Appium] Non-default server args:
[Appium] address: 127.0.0.1
[Appium] nodeconfig: MKs_tablet.json
[debug] [Appium] Starting auto register thread for grid. Will try to
register every 5000 ms.
[Appium] Appium REST http interface listener started on 127.0.0.1:4723
[Appium] Request to register with grid was unsuccessful: Error: getaddrinfo
ENOTFOUND http http:80
[debug] [Appium] Hub down or not responding: Error: getaddrinfo ENOTFOUND
http http:80
[Appium] Request to register with grid was unsuccessful: Error: getaddrinfo
ENOTFOUND http http:80
[debug] [Appium] Hub down or not responding: Error: getaddrinfo ENOTFOUND
http http:80
[Appium] Request to register with grid was unsuccessful: Error: getaddrinfo
ENOTFOUND http http:80
[debug] [Appium] Hub down or not responding: Error: getaddrinfo ENOTFOUND
http http:80
[Appium] Request to register with grid was unsuccessful: Error: getaddrinfo
ENOTFOUND http http:80
[debug] [Appium] Hub down or not responding: Error: getaddrinfo ENOTFOUND
http http:80
Am I just overlooking something be cause there just doesn't seem to be anything suggested out there. I can find anything wrong with my config files. It looks like it should work
HELP!!!
This error message...
[Appium] Appium REST http interface listener started on 127.0.0.1:4723
[Appium] Request to register with grid was unsuccessful: Error: getaddrinfo ENOTFOUND http http:80
[debug] [Appium] Hub down or not responding: Error: getaddrinfo ENOTFOUND http http:80
...implies that the Appium Client was unable to register with the Selenium Grid Hub
Your main issue is within the --nodeconfig for the parameter url within MKs_tablet.json where the protocol http is specified twice.
Solution
Within --nodeconfig, the parameter url within MKs_tablet.json must be set as :
"url":"http://127.0.0.1:4723/wd/hub"

Error: Command 'java -version' exited with code 20

I run the android automation test from eclipse it throws
Encountered internal error running command: Error: Command 'java -version' exited with code 20
Appium Logfile:
`[BaseDriver] Event 'newSessionRequested' logged at 1519716463353
(12:57:43 GMT+0530 (IST)) [Appium] Merged W3C capabilities
{"desiredCapabilities":{"app":"/Users/sathish/S... into
desiredCapabilities object
{"app":"/Users/sathish/Sathish/CASA/Automation ... [Appium] Creating
new AndroidDriver (v1.39.0) session [Appium] Capabilities: [Appium]
app: /Users/sathish/Sathish/CASA/Automation
Test/EndlessAisleAutomationTest/app/app-qa-debug.apk [Appium]
appActivity: tech.ajira.endlessAisle.activities.TenantLoginActivity
[Appium] appPackage: tech.ajira.endlessAisle [Appium]
deviceName: Google Nexus 9 [Appium] platformName: android
[BaseDriver] [BaseDriver] W3C capabilities [] and MJSONWP desired
capabilities were provided [BaseDriver] Expected W3C "capabilities"
to be a JSON Object but was provided with: [] [BaseDriver] Falling
back to MJSONWP desired capabilities [BaseDriver] Session created
with session id: e1e27d58-611a-4877-b8fc-8e7e98351be1
[AndroidDriver] Getting Java version [AndroidDriver] Shutting down
Android driver [AndroidDriver] Called deleteSession but bootstrap
wasn't active [MJSONWP] Encountered internal error running command:
Error: Command 'java -version' exited with code 20
at ChildProcess. (/Applications/Appium.app/Contents/Resources/app/node_modules/teen_process/lib/teen_process.js:97:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:194:7)
at maybeClose (internal/child_process.js:899:16)
at Socket. (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at Pipe._handle.close [as _onclose] (net.js:510:12) [HTTP] <-- POST /wd/hub/session 500 41 ms - 180`
Please help me to fix this issue. Thank you
Seems Appium is not able to connect to the running emulator. Try setting correct values for deviceName and platformVersion capabilities to find the connected device.
In command prompt try running adb devices to get the device name.

Can't click a button due to a sticky button presence

Due to presence of a sticky chat button, I can not click a button on screen on my Appium test. Can anyone help?
Code
public static void TapViewBookingButton() throws InterruptedException
{
Setup.startTimer();
MobileElement btnViewBooking = (MobileElement) Setup.wait.until(ExpectedConditions.presenceOfElementLocated(By.id(btnViewBooking_ID)));
btnViewBooking.click();
Setup.updateLogMessage("VIEW BOOKING button clicked in " + Setup.stopTimer(Setup.stopWatch), SM_CONSTANTS.isScreenshot);
}
buttonViewBooking.Click() - (VIEW BOOKING) doesn't work as shown in the picture due to a sticky online chat sticky button shown on the bottom right of the screen
Logs:
info: --> POST /wd/hub/session/7ee1afc3-9a7c-4105-b8e9-acdbf9570f46/elements {"using":"id","value":"com.servicemarket.app.debug:id/btnViewBooking"}
info: [debug] Waiting up to 0ms for condition
info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"com.servicemarket.app.debug:id/btnViewBooking","context":"","multiple":true}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.servicemarket.app.debug:id/btnViewBooking","context":"","multiple":true}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding com.servicemarket.app.debug:id/btnViewBooking using ID with the contextId: multiple: true
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[RESOURCE_ID=com.servicemarket.app.debug:id/btnViewBooking]
info: [debug] [BOOTSTRAP] [debug] getElements selector:UiSelector[RESOURCE_ID=com.servicemarket.app.debug:id/btnViewBooking]
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (0)
info: [debug] [BOOTSTRAP] [debug] getElements tmp selector:UiSelector[INSTANCE=0, RESOURCE_ID=com.servicemarket.app.debug:id/btnViewBooking]
info: [debug] [BOOTSTRAP] [debug] Element[] is null: (1)
info: [debug] [BOOTSTRAP] [debug] getElements tmp selector:UiSelector[INSTANCE=1, RESOURCE_ID=com.servicemarket.app.debug:id/btnViewBooking]
info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":[{"ELEMENT":"126"}],"status":0}
info: [debug] Responding to client with success: {"status":0,"value":[{"ELEMENT":"126"}],"sessionId":"7ee1afc3-9a7c-4105-b8e9-acdbf9570f46"}
info: <-- POST /wd/hub/session/7ee1afc3-9a7c-4105-b8e9-acdbf9570f46/elements 200 36.010 ms - 91 {"status":0,"value":[{"ELEMENT":"126"}],"sessionId":"7ee1afc3-9a7c-4105-b8e9-acdbf9570f46"}
info: --> POST /wd/hub/session/7ee1afc3-9a7c-4105-b8e9-acdbf9570f46/element/126/click {"id":"126"}
info: [debug] Pushing command to appium work queue: ["element:click",{"elementId":"126"}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:click","params":{"elementId":"126"}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: click
info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"7ee1afc3-9a7c-4105-b8e9-acdbf9570f46"}
info: <-- POST /wd/hub/session/7ee1afc3-9a7c-4105-b8e9-acdbf9570f46/element/126/click 200 306.260 ms - 76 {"status":0,"value":true,"sessionId":"7ee1afc3-9a7c-4105-b8e9-acdbf9570f46"}
So you can get element. Thats already good. Try to click with TouchAction, e.g. press or longPress:
Point point = btnViewBooking.getLocation();
new TouchAction(driver)
.longPress(point.getX(), point.getY())
.release()
.perform();

Appium (Android): App not signed with debug cert

I was running my automation scripts on bamboo using below configuration and facing an issue while re-signing the app file on simulator. I have tried what I can but couldn't say what's the issue with, is it appium, or bamboo or emulator issue?
Earlier then this issue, I faced an issue same as in the below link. I have tried to solve that issue and started facing this issue.I have raised this issue in Appium discuss also.
Here is the link: https://discuss.appium.io/t/uiautomator2-error-cannot-read-property-isscreenlocked-of-undefined/15153
Appium: appium#1.6.4-beta and also tried with appium#1.6.3
jdk: 1.8.0_102
platformVersion: '7.1'
automationName: 'uiautomator2'
platformName: 'Android'
Logs:
[Appium] Welcome to Appium v1.6.3
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"apk-path","newCommandTimeout":"600","platformVersion":"7.1","automationName":"uiautomator2","platformName":"Android","deviceName":"emulator-5554"}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"apk-path","newCommandTimeout":"600","platformVersion":"7.1","automationName":"uiautomator2","platformName":"Android","deviceName":"emulator-5554"},null,null,null,null]
[Appium] Creating new AndroidUiautomator2Driver session
[Appium] Capabilities:
[Appium] app: 'apk-path'
[Appium] newCommandTimeout: '600'
[Appium] platformVersion: '7.1'
[Appium] automationName: 'uiautomator2'
[Appium] platformName: 'Android'
[Appium] deviceName: 'emulator-5554'
[BaseDriver] Capability 'newCommandTimeout' changed from string ('600') to integer (600). This may cause unexpected behavior
[BaseDriver] Session created with session id: 25e878b1-f9cf-4fb5-9070-d88617c91374
[BaseDriver] Using local app 'apk-path'
[debug] [UiAutomator2] Checking whether app is actually present
[UiAutomator2] UIAutomator2 Driver version:0.2.3
[debug] [AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_102
[ADB] Checking whether adb is present
[ADB] Using adb from /Users/admin/Library/Android/sdk/platform-tools/adb
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[AndroidDriver] Looking for a device with Android '7.1'
[debug] [ADB] Setting device id to emulator-5554
[ADB] Getting device platform version
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/admin/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","getprop","ro.build.version.release"]
[AndroidDriver] Using device: emulator-5554
[ADB] Checking whether adb is present
[ADB] Using adb from /Users/admin/Library/Android/sdk/platform-tools/adb
[debug] [ADB] Setting device id to emulator-5554
[debug] [AndroidDriver] Parsing package and activity from app manifest
[ADB] Checking whether aapt is present
[ADB] Using aapt from /Users/admin/Library/Android/sdk/build-tools/25.0.2/aapt
[ADB] Extracting package and launch activity from manifest
[debug] [ADB] badging package: package
[debug] [ADB] badging act: Activity
[debug] [AndroidDriver] Parsed package and activity are: package/Activity
[ADB] Getting device platform version
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/admin/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","getprop","ro.build.version.release"]
[debug] [ADB] Attempting to kill all io.appium.uiautomator2.server processes
[debug] [ADB] Getting all processes with io.appium.uiautomator2.server
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/admin/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","ps"]
[ADB] No io.appium.uiautomator2.server process found to kill, continuing...
[debug] [ADB] Running '/Users/admin/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","wait-for-device"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/admin/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","echo","ping"]
[debug] [Logcat] Starting logcat capture
[debug] [AndroidDriver] Pushing settings apk to device...
[debug] [ADB] Running '/Users/admin/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","install","/usr/local/lib/node_modules/appium/node_modules/io.appium.settings/bin/settings_apk-debug.apk"]
[debug] [ADB] Running '/Users/admin/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","install","/usr/local/lib/node_modules/appium/node_modules/io.appium.settings/bin/settings_apk-debug.apk"]
[debug] [ADB] Application '/usr/local/lib/node_modules/appium/node_modules/io.appium.settings/bin/settings_apk-debug.apk' already installed. Continuing.
[debug] [AndroidDriver] Pushing unlock helper app to device...
[debug] [ADB] Running '/Users/admin/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","install","/usr/local/lib/node_modules/appium/node_modules/appium-unlock/bin/unlock_apk-debug.apk"]
[debug] [ADB] Running '/Users/admin/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","install","/usr/local/lib/node_modules/appium/node_modules/appium-unlock/bin/unlock_apk-debug.apk"]
[debug] [ADB] Application '/usr/local/lib/node_modules/appium/node_modules/appium-unlock/bin/unlock_apk-debug.apk' already installed. Continuing.
[debug] [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to 8200
[debug] [ADB] Forwarding system: 8200 to device: 6790
[debug] [ADB] Running '/Users/admin/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","forward","tcp:8200","tcp:6790"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/admin/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","dumpsys","window"]
[AndroidDriver] Screen already unlocked, doing nothing
[debug] [AndroidDriver] Extracting strings from apk apk-path null /var/folders/w3/85v473ln4n795wf2dd39mgjw0000gn/T/package
[debug] [ADB] Extracting strings for language: default
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/admin/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","getprop","ro.build.version.sdk"]
[debug] [ADB] Device API level: 25
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/admin/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","getprop","persist.sys.locale"]
[debug] [ADB] Current device property 'persist.sys.locale':
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/admin/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","getprop","ro.product.locale"]
[debug] [ADB] Current device property 'ro.product.locale': en-US
[debug] [ADB] No strings.xml for language 'en', getting default strings.xml
[debug] [ADB] Reading strings from converted strings.json
[debug] [ADB] Running '/Users/admin/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","push","/var/folders/w3/85v473ln4n795wf2dd39mgjw0000gn/T/package/strings.json","/data/local/tmp"]
[debug] [ADB] Checking app cert for apk-path.
[debug] [ADB] App not signed with debug cert.
[debug] [ADB] Resigning apk.
[ADB] Error: Could not sign with default ceritficate. Original error Command '/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/java -jar /usr/local/lib/node_modules/appium/node_modules/appium-adb/jars/sign.jar apk-path --override' exited with code 1
at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
at ADB.callee$0$0$ (../../../lib/tools/apk-signing.js:21:9)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke as _invoke
at GeneratorFunctionPrototype.prototype.(anonymous function) as throw
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at run (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/es6.promise.js:108:47)
at /usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/es6.promise.js:119:28
at flush (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.microtask.js:19:5)
at combinedTickCallback (internal/process/nexttick.js:67:7)
at process.tickCallback (internal/process/nexttick.js:98:9)
[Error: Could not sign with default ceritficate. Original error Command '/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/java -jar /usr/local/lib/node_modules/appium/node_modules/appium-adb/jars/sign.jar apk-path --override' exited with code 1]
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [UiAutomator2] Deleting UiAutomator2 server session
[UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: Error: Trying to proxy a session command without session id
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/admin/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","am","force-stop","package"]
Could someone help me on this please?
Thanks
I'm running into the same problem. I was told to reset the factory settings on my Samsung Galaxy S8! That did not work. I've read that it's a network timeout so increase the network time out. I see you added newCommandTimeout: '600' I did the same and that did not work.
Did you have an older version of Appium running? I tried with the Windows U/I version 1.4.16! and then I tried with the beta version of the Windows U/I. I finally removed the U/I version and installed the commandline version 1.6.5. I still run into the same problem.
While running the scripts I was running using command line without providing automation name "uiautomator2" and the scripts started working for me. I really don't understand where the issue was exactly till now, as it is working fine I didn't concentrate on the issue again.
Hope this helps for you.
Thanks

Categories

Resources