Appium scripts are getting failed, after hitting url successful - java

Appium scripts are getting failed, after hitting url successful.
Selenium Oxygen 2
Appium version 1.2.7
Url hit the browser open the link, after some page gates refreshed and then again url reopened in new tab within the same chrome browser.
url " us.justdial.com" opeing in the chrome browser still scripts are getting failed. Have already updated chrome driver.
Below are the scripts
import java.net.MalformedURLException;
import java.net.URL;
//import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeUnit;
/*import org.openqa.selenium.Capabilities;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriver.Timeouts;
import org.openqa.selenium.chrome.ChromeDriver;*/
//import org.openqa.selenium.android.AndroidDriver;
//import org.openqa.selenium.remote.BrowserType;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
//import org.openqa.selenium.remote.RemoteWebDriver;
//import org.openqa.selenium.remote.RemoteWebDriver;
//import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;
//import io.appium.java_client.remote.MobileCapabilityType;
public class Appium_device {
//String driverPath = "F:/ChromeDriver/chromedriver.exe";
public AppiumDriver driver;
#Test
public void Appium_device() throws MalformedURLException, Exception {
{
// APPLICATION_LOG.info("Initializing project properties");
DesiredCapabilities capabilities = new DesiredCapabilities();
// Set android deviceName desired capability. Set your device name.
// capabilities.setCapability("deviceName", "5203a1bbea4a8385");
// capabilities.setCapability("deviceName", "4100df0accbd9f00");
// capabilities.setCapability("deviceName", "0123456789ABCDEF");
capabilities.setCapability("deviceName", "4d007af54ac04177");
// Set BROWSER_NAME desired capability. It's Android in our case here.
capabilities.setCapability(CapabilityType.BROWSER_NAME, "Android");
// capabilities.setCapability("browsername", "chrome");
capabilities.setCapability("chromedriverExecutable", "C:/Users/vaibhavsi/Downloads/chromedriver_win32/chromedriver.exe");
// Set android VERSION desired capability. Set your mobile device's OS version.
// capabilities.setCapability(CapabilityType.VERSION, "4.2.2");
// capabilities.setCapability(CapabilityType.VERSION, "6.0.1");
capabilities.setCapability(CapabilityType.VERSION, "6.0.1");
// Set android platformName desired capability. It's Android in our case here.
capabilities.setCapability("platformName", "Android");
// Set android appPackage desired capability. It is
// com.android.calculator2 for calculator application.
// Set your application's appPackage if you are using any other app.
// capabilities.setCapability("appPackage", "org.mozilla.firefox");
capabilities.setCapability("appPackage", "com.android.chrome");
// Set android appActivity desired capability. It is
// com.android.calculator2.Calculator for calculator application.
// Set your application's appPackage if you are using any other app.
capabilities.setCapability("appActivity", "com.google.android.apps.chrome.Main");
// Created object of RemoteWebDriver will all set capabilities.
// Set appium server address and port number in URL string.
// It will launch calculator app in android device.
// webdriver.Chrome(executable_path='C:\Users\Ganeshkumarg\Downloads\chromedriver_win32\chromedriver.exe');
// RemoteWebDriver webDriver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
// webDriver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
try {
driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
}catch(MalformedURLException e)
{
e.printStackTrace();
}
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
System.out.println("Step 9");
try {
driver.get("https://us.justdial.com");
System.out.println("site hit");
}
catch (Exception e) {
System.out.println("site not accessed");
throw (e);
// TODO: handle exception
}
}
}
}
Following are the appium error logs
[Appium] Welcome to Appium v1.7.1
[Appium] Non-default server args:
[Appium] address: 127.0.0.1
[Appium] Appium REST http interface listener started on 127.0.0.1:4723
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"appActivity":"com.google.android.apps.chrome.Main","appPackage":"com.android.chrome","browserName":"Android","chromedriverExecutable":"C:/Users/vaibhavsi/Downloads/chromedriver_win32/chromedriver.exe","deviceName":"4d007af54ac04177","platformName":"Android","version":"6.0.1"},"capabilities":{"desiredCapabilities":{"appActivity":"com.google.android.apps.chrome.Main","appPackage":"com.android.chrome","browserName":"Android","chromedriverExecutable":"C:/Users/vaibhavsi/Downloads/chromedriver_win32/chromedriver.exe","deviceName":"4d007af54ac04177","platformName":"Android","version":"6.0.1"},"firstMatch":[{"browserName":"Android","platformName":"android"}]}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"appActivity":"com.google.android.apps.chrome.Main","appPackage":"com.android.chrome","browserName":"Android","chromedriverExecutable":"C:/Users/vaibhavsi/Downloads/chromedriver_win32/chromedriver.exe","deviceName":"4d007af54ac04177","platformName":"Android","version":"6.0.1"},null,{"desiredCapabilities":{"appActivity":"com.google.android.apps.chrome.Main","appPackage":"com.android.chrome","browserName":"Android","chromedriverExecutable":"C:/Users/vaibhavsi/Downloads/chromedriver_win32/chromedriver.exe","deviceName":"4d007af54ac04177","platformName":"Android","version":"6.0.1"},"firstMatch":[{"browserName":"Android","platformName":"android"}]}]
[BaseDriver] Event 'newSessionRequested' logged at 1515140901130 (13:58:21 GMT+0530 (India Standard Time))
[Appium] Creating new AndroidDriver (v1.28.1) session
[Appium] Capabilities:
[Appium] appActivity: 'com.google.android.apps.chrome.Main'
[Appium] appPackage: 'com.android.chrome'
[Appium] browserName: 'Android'
[Appium] chromedriverExecutable: 'C:/Users/vaibhavsi/Downloads/chromedriver_win32/chromedriver.exe'
[Appium] deviceName: '4d007af54ac04177'
[Appium] platformName: 'Android'
[Appium] version: '6.0.1'
[BaseDriver] The following capabilities were provided, but are not recognized by appium: version.
[BaseDriver] Session created with session id: b284c843-d3e4-4d13-94aa-a9f752377fe8
[AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_144
[ADB] Checking whether adb is present
[ADB] Using adb.exe from C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe
[AndroidDriver] Retrieving device list
[ADB] Trying to find a connected android device
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[AndroidDriver] Using device: 4d007af54ac04177
[ADB] Checking whether adb is present
[ADB] Using adb.exe from C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe
[ADB] Setting device id to 4d007af54ac04177
[AndroidDriver] App file was not listed, instead we're going to run com.android.chrome directly on the device
[AndroidDriver] Checking whether package is present on the device
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","pm","list","packages","com.android.chrome"]
[AndroidDriver] Starting Android session
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","wait-for-device"]
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","echo","ping"]
[Logcat] Starting logcat capture
[AndroidDriver] Pushing settings apk to device...
[ADB] Uninstalling and re-installing 'io.appium.settings'
[ADB] Uninstalling io.appium.settings
[ADB] Getting install status for io.appium.settings
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","pm","list","packages","io.appium.settings"]
[ADB] App is installed
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","am","force-stop","io.appium.settings"]
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","uninstall","io.appium.settings"]
[ADB] ADB command output: Success
[ADB] io.appium.settings was successfully uninstalled
[ADB] Getting install status for io.appium.settings
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","pm","list","packages","io.appium.settings"]
[ADB] App is not installed
[ADB] App 'C:\Users\vaibhavsi\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\io.appium.settings\app\build\outputs\apk\settings_apk-debug.apk' not installed. Installing
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","install","C:\\Users\\vaibhavsi\\AppData\\Local\\Programs\\appium-desktop\\resources\\app\\node_modules\\appium\\node_modules\\io.appium.settings\\app\\build\\outputs\\apk\\settings_apk-debug.apk"]
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","getprop","ro.build.version.sdk"]
[ADB] Current device property 'ro.build.version.sdk': 23
[ADB] Device API level: 23
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","dumpsys","package","io.appium.settings"]
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","pm","dump","io.appium.settings"]
[ADB] Got the following command chunks to execute: pm,grant,io.appium.settings,android.permission.INTERNET,;,pm,grant,io.appium.settings,android.permission.CHANGE_NETWORK_STATE,;,pm,grant,io.appium.settings,android.permission.ACCESS_NETWORK_STATE,;,pm,grant,io.appium.settings,android.permission.READ_PHONE_STATE,;,pm,grant,io.appium.settings,android.permission.WRITE_SETTINGS,;,pm,grant,io.appium.settings,android.permission.CHANGE_WIFI_STATE,;,pm,grant,io.appium.settings,android.permission.ACCESS_WIFI_STATE,;,pm,grant,io.appium.settings,android.permission.ACCESS_FINE_LOCATION,;,pm,grant,io.appium.settings,android.permission.ACCESS_COARSE_LOCATION,;,pm,grant,io.appium.settings,android.permission.ACCESS_MOCK_LOCATION,;,pm,grant,io.appium.settings,android.permission.SET_ANIMATION_SCALE,;
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","pm","grant","io.appium.settings","android.permission.INTERNET",";","pm","grant","io.appium.settings","android.permission.CHANGE_NETWORK_STATE",";","pm","grant","io.appium.settings","android.permission.ACCESS_NETWORK_STATE",";","pm","grant","io.appium.settings","android.permission.READ_PHONE_STATE",";","pm","grant","io.appium.settings","android.permission.WRITE_SETTINGS",";","pm","grant","io.appium.settings","android.permission.CHANGE_WIFI_STATE",";","pm","grant","io.appium.settings","android.permission.ACCESS_WIFI_STATE",";","pm","grant","io.appium.settings","android.permission.ACCESS_FINE_LOCATION",";","pm","grant","io.appium.settings","android.permission.ACCESS_COARSE_LOCATION",";","pm","grant","io.appium.settings","android.permission.ACCESS_MOCK_LOCATION",";","pm","grant","io.appium.settings","android.permission.SET_ANIMATION_SCALE",";"]
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","ps"]
[ADB] Device API level: 23
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","am","start","-W","-n","io.appium.settings/.Settings","-a","android.intent.action.MAIN","-c","android.intent.category.LAUNCHER","-f","0x10200000"]
[ADB] Device API level: 23
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","appops","set","io.appium.settings","android:mock_location","allow"]
[AndroidDriver] Pushing unlock helper app to device...
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","install","C:\\Users\\vaibhavsi\\AppData\\Local\\Programs\\appium-desktop\\resources\\app\\node_modules\\appium\\node_modules\\appium-unlock\\bin\\unlock_apk-debug.apk"]
[ADB] Getting device platform version
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","getprop","ro.build.version.release"]
[ADB] Current device property 'ro.build.version.release': 6.0.1
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","wm","size"]
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","getprop","ro.product.model"]
[ADB] Current device property 'ro.product.model': SM-G900H
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","getprop","ro.product.manufacturer"]
[ADB] Current device property 'ro.product.manufacturer': samsung
[AndroidDriver] No app sent in, not parsing package/activity
[AndroidDriver] No app capability. Assuming it is already on the device
[AndroidDriver] Running fast reset (stop and clear)
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","am","force-stop","com.android.chrome"]
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","pm","clear","com.android.chrome"]
[AndroidBootstrap] Watching for bootstrap disconnect
[ADB] Forwarding system: 4724 to device: 4724
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","forward","tcp:4724","tcp:4724"]
[UiAutomator] Starting UiAutomator
[UiAutomator] Moving to state 'starting'
[UiAutomator] Parsing uiautomator jar
[UiAutomator] Found jar name: 'AppiumBootstrap.jar'
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","push","C:\\Users\\vaibhavsi\\AppData\\Local\\Programs\\appium-desktop\\resources\\app\\node_modules\\appium\\node_modules\\appium-android-bootstrap\\bootstrap\\bin\\AppiumBootstrap.jar","/data/local/tmp/"]
[ADB] Attempting to kill all uiautomator processes
[ADB] Getting all processes with uiautomator
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","ps"]
[ADB] No uiautomator process found to kill, continuing...
[UiAutomator] Starting UIAutomator
[ADB] Creating ADB subprocess with args: ["-P",5037,"-s","4d007af54ac04177","shell","uiautomator","runtest","AppiumBootstrap.jar","-c","io.appium.android.bootstrap.Bootstrap","-e","pkg","com.android.chrome","-e","disableAndroidWatchers",false,"-e","acceptSslCerts",false]
[UiAutomator] Moving to state 'online'
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Registered crash watchers.
[AndroidBootstrap] Android bootstrap socket is now connected
[ADB] Getting connected devices...
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Client connected
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","dumpsys","window"]
[AndroidDriver] Screen already unlocked, doing nothing
[ADB] Device API level: 23
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","am","start","-W","-n","com.android.chrome/com.google.android.apps.chrome.Main","-S"]
[Appium] New AndroidDriver session created successfully, session b284c843-d3e4-4d13-94aa-a9f752377fe8 added to master session list
[BaseDriver] Event 'newSessionStarted' logged at 1515140936767 (13:58:56 GMT+0530 (India Standard Time))
[MJSONWP] Responding to client with driver.createSession() result: {"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"appActivity":"com.google.android.apps.chrome.Main","appPackage":"com.android.chrome","browserName":"Android","chromedriverExecutable":"C:/Users/vaibhavsi/Downloads/chromedriver_win32/chromedriver.exe","deviceName":"4d007af54ac04177","platformName":"Android","version":"6.0.1"},"appActivity":"com.google.android.apps.chrome.Main","appPackage":"com.android.chrome","browserName":"Android","chromedriverExecutable":"C:/Users/vaibhavsi/Downloads/chromedriver_win32/chromedriver.exe","deviceName":"4d007af54ac04177","platformName":"Android","version":"6.0.1","deviceUDID":"4d007af54ac04177","platformVersion":"6.0.1","deviceScreenSize":"1080x1920","deviceModel":"SM-G900H","deviceManufacturer":"samsung"}
[HTTP] <-- POST /wd/hub/session 200 35735 ms - 978
[HTTP] --> POST /wd/hub/session/b284c843-d3e4-4d13-94aa-a9f752377fe8/timeouts {"type":"implicit","ms":10000}
[MJSONWP] Calling AppiumDriver.timeouts() with args: ["implicit",10000,"b284c843-d3e4-4d13-94aa-a9f752377fe8"]
[BaseDriver] Set implicit wait to 10000ms
[MJSONWP] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/b284c843-d3e4-4d13-94aa-a9f752377fe8/timeouts 200 5 ms - 76
[HTTP] --> POST /wd/hub/session/b284c843-d3e4-4d13-94aa-a9f752377fe8/url {"url":"https://us.justdial.com"}
[MJSONWP] Calling AppiumDriver.setUrl() with args: ["https://us.justdial.com","b284c843-d3e4-4d13-94aa-a9f752377fe8"]
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","am","start","-W","-a","android.intent.action.VIEW","-d","https://us.justdial.com","com.android.chrome"]
[ADB] Running 'C:\Users\vaibhavsi\AppData\Local\Android\android-sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","4d007af54ac04177","shell","am","start","-W","-a","android.intent.action.VIEW","-d","https://us.justdial.com","com.android.chrome"]
[ADB] Error: Error attempting to start URI. Original error: Error: Error executing adbExec. Original error: 'Command 'C\:\\Users\\vaibhavsi\\AppData\\Local\\Android\\android-sdk\\platform-tools\\adb.exe -P 5037 -s 4d007af54ac04177 shell am start -W -a android.intent.action.VIEW -d https\://us.justdial.com com.android.chrome' timed out after 20000ms'; Stderr: ''; Code: 'null'
at Object.wrappedLogger.errorAndThrow (C:\Users\vaibhavsi\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:63:13)
at ADB.callee$0$0$ (C:\Users\vaibhavsi\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:47:9)
at tryCatch (C:\Users\vaibhavsi\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\vaibhavsi\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Users\vaibhavsi\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (C:\Users\vaibhavsi\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
Error: Error attempting to start URI. Original error: Error: Error executing adbExec. Original error: 'Command 'C\:\\Users\\vaibhavsi\\AppData\\Local\\Android\\android-sdk\\platform-tools\\adb.exe -P 5037 -s 4d007af54ac04177 shell am start -W -a android.intent.action.VIEW -d https\://us.justdial.com com.android.chrome' timed out after 20000ms'; Stderr: ''; Code: 'null'
at Object.wrappedLogger.errorAndThrow (C:\Users\vaibhavsi\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:63:13)
at ADB.callee$0$0$ (C:\Users\vaibhavsi\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:47:9)
at tryCatch (C:\Users\vaibhavsi\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\vaibhavsi\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Users\vaibhavsi\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (C:\Users\vaibhavsi\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
[MJSONWP] Encountered internal error running command: Error: Error attempting to start URI. Original error: Error: Error executing adbExec. Original error: 'Command 'C\:\\Users\\vaibhavsi\\AppData\\Local\\Android\\android-sdk\\platform-tools\\adb.exe -P 5037 -s 4d007af54ac04177 shell am start -W -a android.intent.action.VIEW -d https\://us.justdial.com com.android.chrome' timed out after 20000ms'; Stderr: ''; Code: 'null'
at Object.wrappedLogger.errorAndThrow (C:\Users\vaibhavsi\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:63:13)
at ADB.callee$0$0$ (C:\Users\vaibhavsi\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:47:9)
at tryCatch (C:\Users\vaibhavsi\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\vaibhavsi\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Users\vaibhavsi\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (C:\Users\vaibhavsi\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
[HTTP] <-- POST /wd/hub/session/b284c843-d3e4-4d13-94aa-a9f752377fe8/url 500 40572 ms - 553
Frequent Error:
An unknown server-side error occurred while processing the command. Original error: Error attempting to start URI. Original error: Error: Error executing adbExec. Original error: 'Command 'C\:\\Users\\vaibhavsi\\AppData\\Local\\Android\\android-sdk\\platform-tools\\adb.exe -P 5037 -s 4d007af54ac04177 shell am start -W -a android.intent.action.VIEW -d https\://us.justdial.com com.android.chrome' timed out after 20000ms'; Stderr: ''; Code: 'null' (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Please look into same.

Since you are trying to test web app in browser, why not to do it this way:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator");
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, MobileBrowserType.BROWSER);
// if chrome is installed, but not default one - use MobileBrowserType.CHROME
AppiumDriver<MobileElement> driver = new AndroidDriver<>(
new URL("http://127.0.0.1:4723/wd/hub"),
capabilities
);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("https://us.justdial.com");
It works perfectly for me with Appium java client 5.0.4 / server 1.7.1

Removed "Unlock" and "Appium settings" apps from device - Appium installs those apps automatically.
Also, passed appium arguments in my scripts. Below are the changes:
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import io.appium.java_client.AppiumDriver;
public class Appium_device {
//String driverPath = "F:/ChromeDriver/chromedriver.exe";
AppiumDriver<?> driver;
#BeforeTest
public void Appium_device() throws MalformedURLException, Exception {
{
// APPLICATION_LOG.info("Initializing project properties");
DesiredCapabilities capabilities = new DesiredCapabilities();
// Set android deviceName desired capability. Set your device name.
// capabilities.setCapability("deviceName", "5203a1bbea4a8385");
// capabilities.setCapability("deviceName", "4100df0accbd9f00");
// capabilities.setCapability("deviceName", "0123456789ABCDEF");
capabilities.setCapability("deviceName", "4d007af54ac04177");
// Set BROWSER_NAME desired capability. It's Android in our case here.
capabilities.setCapability(CapabilityType.BROWSER_NAME, "Android");
// capabilities.setCapability("browsername", "chrome");
// capabilities.setCapability("chromedriverExecutable", "C:/Users/vaibhavsi/Downloads/chromedriver_win32/chromedriver.exe");
// Set android VERSION desired capability. Set your mobile device's OS version.
// capabilities.setCapability(CapabilityType.VERSION, "4.2.2");
// capabilities.setCapability(CapabilityType.VERSION, "6.0.1");
capabilities.setCapability(CapabilityType.VERSION, "6.0.1");
// Set android platformName desired capability. It's Android in our case here.
capabilities.setCapability("platformName", "Android");
// Set android appPackage desired capability. It is
// com.android.calculator2 for calculator application.
// Set your application's appPackage if you are using any other app.
// capabilities.setCapability("appPackage", "org.mozilla.firefox");
capabilities.setCapability("appPackage", "com.android.chrome");
// Set android appActivity desired capability. It is
// com.android.calculator2.Calculator for calculator application.
// Set your application's appPackage if you are using any other app.
capabilities.setCapability("appActivity", "com.google.android.apps.chrome.Main");
// capability.setCapability("binary", "C:\Program Files\Google\Chrome\Application");
// Created object of RemoteWebDriver will all set capabilities.
// Set appium server address and port number in URL string.
// It will launch calculator app in android device.
// webdriver.Chrome(executable_path='C:\Users\Ganeshkumarg\Downloads\chromedriver_win32\chromedriver.exe');
// RemoteWebDriver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
// webDriver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
// capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator");
// capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, MobileBrowserType.BROWSER);
driver = new AppiumDriver<WebElement>(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
}
#Test
public void launch() throws Exception {
try {
//driver.get("https://us.justdial.com");
driver.navigate().to("https://us.justdial.com");
System.out.println("site hit");
}
catch (Exception e) {
System.out.println("site not accessed");
throw (e);
// TODO: handle exception
}
}}
Thanks a ton to all for your helpful suggestions.

Related

Can't start appium inspector session: exited with code 255

I am trying to start an appium inspector session, however I keep having problems with apkanalyzer.bat, now I received the following message:
Using 'apkanalyzer.bat' from 'C:\Users\ayla_\AppData\Local\Android\Sdk\tools\bin\apkanalyzer.bat'
[ADB] Starting 'C:\Users\ayla_\AppData\Local\Android\Sdk\tools\bin\apkanalyzer.bat' with args ["-h","manifest","print","C:\\Users\\ayla_\\Documents\\Documentos_Ayla\\Treinamentos\\Automacao Mobile\\File Manager by Astro File Browser_v7.4.0_apkpure.com.apk"]
[ADB] Using the alternative activity name detection method because of: Command 'C\:\\Users\\ayla_\\AppData\\Local\\Android\\Sdk\\tools\\bin\\apkanalyzer.bat -h manifest print 'C:\\Users\\ayla_\\Documents\\Documentos_Ayla\\Treinamentos\\Automacao Mobile\\File Manager by Astro File Browser_v7.4.0_apkpure.com.apk'' exited with code 255
[ADB] Extracting package and launch activity from manifest
[AndroidDriver] Shutting down Android driver
[AndroidDriver] Called deleteSession but bootstrap wasn't active
[Logcat] Stopping logcat capture
[ADB] Running 'C:\Users\ayla_\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.unlock'
[AndroidDriver] Not cleaning generated files. Add `clearSystemFiles` capability if wanted.
[BaseDriver] Event 'newSessionStarted' logged at 1569549028506 (22:50:28 GMT-0300 (Hora oficial do Brasil))
[MJSONWP] Encountered internal error running command: Error: packageAndLaunchActivityFromManifest failed. Original error: Command 'java -jar C\:\\Users\\ayla_\\AppData\\Local\\Programs\\appium-desktop\\resources\\app\\node_modules\\appium\\node_modules\\appium-adb\\jars\\appium_apk_tools.jar printLaunchActivity 'C:\\Users\\ayla_\\Documents\\Documentos_Ayla\\Treinamentos\\Automacao Mobile\\File Manager by Astro File Browser_v7.4.0_apkpure.com.apk' C\:\\Users\\ayla_\\AppData\\Local\\Temp\\com.metago.astro' exited with code 1; StdErr: Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x7f060046 color/common_google_signin_btn_text_dark_default, config=[DEFAULT]
If someone knows the solution to this problem, please share with me.

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.

Appium: custom android app keeps crashing on launch

Have a problem where all of a sudden a previously working appium based android app selenium test has stopped working as it did (consistently successful).
The issue is specifically to do with the launch of the app by appium (the app always launches when opened with physical user input..). Basically the app launches, the loading screen appears and then it crashes. This happens most of the time but not always. I've found it usually works fine initially after restarting the phone. However, it'll crash on subsequent runs.
Any assistance would be much appreciated. Tried many things/searching online already but it's all been to of no avail..
Here's the appium output:
[AndroidDriver] Parsed pid: '27608' pkg: 'com.dedsert.betbright.uat' from
[AndroidDriver] USER PID PPID VSIZE RSS WCHAN PC NAME
[AndroidDriver] u0_a236 27608 4736 3621124 393160 0 0000000000 R com.dedsert.betbright.uat
[AndroidDriver] Returning process name: 'com.dedsert.betbright.uat'
[AndroidDriver] Found webviews: ["WEBVIEW_com.dedsert.betbright.uat"]
[AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_com.dedsert.betbright.uat"]
[MJSONWP] Responding to client with driver.setContext() result: null
[HTTP] <-- POST /wd/hub/session/a9457315-d657-4fd1-bdf0-36fe5d76b3c5/context 200 245 ms - 76
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_RESULT: shortMsg=java.lang.StackOverflowError
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_RESULT: longMsg=stack size 1037KB
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_CODE: 0
[UiAutomator] UiAutomator exited unexpectedly with code 4294967295, signal null
[UiAutomator] Moving to state 'stopped'
[AndroidDriver] Shutting down Android driver
[Appium] Closing session, cause was 'UiAUtomator shut down unexpectedly'
[Appium] Removing session a9457315-d657-4fd1-bdf0-36fe5d76b3c5 from our master session list
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\kroring\AppData\Local\Android\Sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","ce051715c336451002","shell","am","force-stop","com.dedsert.betbright.uat"]
[ADB] Pressing the HOME button
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\kroring\AppData\Local\Android\Sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","ce051715c336451002","shell","input","keyevent",3]
[AndroidBootstrap] Cannot shut down Android bootstrap; it has already shut down
[Logcat] Stopping logcat capture
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\kroring\AppData\Local\Android\Sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","ce051715c336451002","shell","am","force-stop","io.appium.unlock"]
[AndroidDriver] Not cleaning generated files. Add `clearSystemFiles` capability if wanted.
[HTTP] --> POST /wd/hub/session/a9457315-d657-4fd1-bdf0-36fe5d76b3c5/context {"name":"WEBVIEW_com.dedsert.betbright.uat"}
[HTTP] <-- POST /wd/hub/session/a9457315-d657-4fd1-bdf0-36fe5d76b3c5/context 404 1 ms - 131
Not a whole lot to be seen on the IntelliJ side - did spot this in the stacktrace given:
org.openqa.selenium.remote.SessionNotFoundException: A session is either terminated or not started (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 5 milliseconds
Uninstall appium and reinstall appium and it will work for you.
From command line.
npm uninstall -g appium
Reinstall the appium.
npm install -g appium
Looks like your phone is out of memory. It could be worthwhile to clear the cache of your testing phone :
Power off your device. This method is different for different
manufacturers, and you should look it up on the internet before
proceeding further.
Load into your bootloader screen by holding down
a combination of keys. In some devices, you have to press the Power
button with Volume down key simultaneously. In other devices, Power
button with both the Volume keys have to pressed simultaneously.
Touchscreen might not work, and you have to navigate using Volume
keys.
Go to Recovery and select it with a tap on the Power button.
Go to Wipe cache partition and tap the Power button to select it.
After the cache gets cleared, select Reboot system now.
Information from (step 4): https://fossbytes.com/clear-android-cache-data-quick-methods/

Not able to launch an activity in appium

n","com.tellm.android.app/.com.jodelapp.jodelandroidv3.view.mainactivity","-S"]
[ADB] Error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
[ADB] Error: Error occured while starting App. Original error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
at Object.wrappedLogger.errorAndThrow (C:\resources\app\node_modules\appium\node_modules\appium-support\lib\logging.js:63:13)
at ADB.callee$0$0$ (C:\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\apk-utils.js:79:9)
at tryCatch (C:\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (
Error: Error occured while starting App. Original error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
[UiAutomator] UiAutomator shut down normally
[UiAutomator] Moving to state 'stopped'
[ADB] Attempting to kill all uiautomator processes
[ADB] Getting all processes with uiautomator
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","ZY22325Q4Q","shell","ps"]
[ADB] No uiautomator process found to kill, continuing...
[UiAutomator] Moving to state 'stopped'
[Logcat] Stopping logcat capture
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","ZY22325Q4Q","shell","am","force-stop","io.appium.unlock"]
[AndroidDriver] Not cleaning generated files. Add `clearSystemFiles` capability if wanted.
**[**MJSONWP] Encountered internal error running command: Error: Error occured while starting App. Original error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity****
and the code is :
public class Jodel {
private static AndroidDriver driver;
public static void main(String[] args) throws MalformedURLException {
// TODO Auto-generated method stub
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
capabilities.setCapability("deviceName", "Moto G(3rd Generation)");
capabilities.setCapability("platformVersion", "5.1.1");
capabilities.setCapability("platformName", "Android");
// capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("appPackage",
"com.tellm.android.app");
capabilities.setCapability("appActivity",
"com.jodelapp.jodelandroidv3.view.mainactivity");
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT,"100");
driver = new AndroidDriver(new URL("http://0.0.0.0:4723/wd/hub"),
capabilities);
}
}
Have you tried this
Error: Could not pre-launch appium: Error: Activity used to start app doesn’t exist or cannot be launched! Make sure it exists and is a launchable activity

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