Here’s my Appium Logs, Selenium Error logs and My Code.
Appium Logs:
[Appium] Appium REST http interface listener started on 127.0.0.1:4723
[HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“app”:“C:\Users\u01n233\eclipse-workspace\AppiumTestProject\Apps\AcceleratorApp\Accelerator_3.0Test_TimestampFix.apk”,“appActivity”:“com.navistar.writeup.AcceleratorActivity”,“appPackage”:“com.navistar.writeup”,“automationName”:“Appium”,“deviceName”:“Galaxt Tab E”,“platformName”:“Android”,“platformVersion”:“7.1.1”},“capabilities”:{“desiredCapabilities”:{“app”:“C:\Users\u01n233\eclipse-workspace\AppiumTestProject\Apps\AcceleratorApp\Accelerator_3.0Test_TimestampFix.apk”,“appActivity”:“com.navistar.writeup.AcceleratorActivity”,“appPackage”:“com.navistar.writeup”,“automationName”:“Appium”,“deviceName”:“Galaxt Tab E”,“platformName”:“Android”,“platformVersion”:“7.1.1”},“firstMatch”:[{“platformName”:“android”}]}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{“app”:“C:\Users\u01n233\eclipse-workspace\AppiumTestProject\Apps\AcceleratorApp\Accelerator_3.0Test_TimestampFix.apk”,“appActivity”:“com.navistar.writeup.AcceleratorActivity”,“appPackage”:“com.navistar.writeup”,“automationName”:“Appium”,“deviceName”:“Galaxt Tab E”,“platformName”:“Android”,“platformVersion”:“7.1.1”},null,{“desiredCapabilities”:{“app”:“C:\Users\u01n233\eclipse-workspace\AppiumTestProject\Apps\AcceleratorApp\Accelerator_3.0Test_TimestampFix.apk”,“appActivity”:“com.navistar.writeup.AcceleratorActivity”,“appPackage”:“com.navistar.writeup”,“automationName”:“Appium”,“deviceName”:“Galaxt Tab E”,“platformName”:“Android”,“platformVersion”:“7.1.1”},“firstMatch”:[{“platformName”:“android”}]}]
[BaseDriver] Event ‘newSessionRequested’ logged at 1519320234628 (11:23:54 GMT-0600 (Central Standard Time))
[Appium] Merged W3C capabilities {“desiredCapabilities”:{“app”:“C:\Users\u01n2… into desiredCapabilities object {“app”:“C:\Users\u01n233\eclipse-workspace\…
[Appium] Creating new AndroidDriver (v1.37.0) session
[Appium] Capabilities:
[Appium] app: C:\Users\u01n233\eclipse-workspace\AppiumTestProject\Apps\AcceleratorApp\Accelerator_3.0Test_TimestampFix.apk
[Appium] appActivity: com.navistar.writeup.AcceleratorActivity
[Appium] appPackage: com.navistar.writeup
[Appium] automationName: Appium
[Appium] deviceName: Galaxt Tab E
[Appium] platformName: android
[Appium] platformVersion: 7.1.1
[BaseDriver] Session created with session id: 1ab1bd8e-1899-466c-b9f0-2aeda35eab3f
[AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_151
[ADB] Checking whether adb is present
[AndroidDriver] Retrieving device list
[ADB] Trying to find a connected android device
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[AndroidDriver] Looking for a device with Android ‘7.1.1’
[ADB] Setting device id to fc591f301b82ddb5
[ADB] Getting device platform version
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: [”-P”,5037,"-s",“fc591f301b82ddb5”,“shell”,“getprop”,“ro.build.version.release”]
[ADB] Current device property ‘ro.build.version.release’: 7.1.1
[AndroidDriver] Using device: fc591f301b82ddb5
[ADB] Checking whether adb is present
[ADB] Setting device id to fc591f301b82ddb5
[BaseDriver] Using local app ‘C:\Users\u01n233\eclipse-workspace\AppiumTestProject\Apps\AcceleratorApp\Accelerator_3.0Test_TimestampFix.apk’
[AndroidDriver] Checking whether app is actually present
[AndroidDriver] Starting Android session
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“wait-for-device”]
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“echo”,“ping”]
[AndroidDriver] setDeviceLanguageCountry requires language or country.
[AndroidDriver] Got language: ‘undefined’ and country: ‘undefined’
[Logcat] Starting logcat capture
[AndroidDriver] Pushing settings apk to device…
[ADB] Getting install status for io.appium.settings
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“pm”,“list”,“packages”,“io.appium.settings”]
[ADB] App is installed
[ADB] Getting package info for io.appium.settings
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“dumpsys”,“package”,“io.appium.settings”]
[ADB] Checking whether aapt is present
[ADB] The installed ‘io.appium.settings’ package does not require upgrade (5 >= 5)
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“getprop”,“ro.build.version.sdk”]
[ADB] Current device property ‘ro.build.version.sdk’: 25
[ADB] Device API level: 25
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“dumpsys”,“package”,“io.appium.settings”]
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“pm”,“dump”,“io.appium.settings”]
[ADB] Got the following command chunks to execute: pm,grant,io.appium.settings,android.permission.WRITE_SETTINGS,;,pm,grant,io.appium.settings,android.permission.ACCESS_MOCK_LOCATION,;
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“pm”,“grant”,“io.appium.settings”,“android.permission.WRITE_SETTINGS”,";",“pm”,“grant”,“io.appium.settings”,“android.permission.ACCESS_MOCK_LOCATION”,";"]
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“pm”,“grant”,“io.appium.settings”,“android.permission.WRITE_SETTINGS”,";",“pm”,“grant”,“io.appium.settings”,“android.permission.ACCESS_MOCK_LOCATION”,";"]
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“ps”]
[ADB] Device API level: 25
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“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: 25
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“appops”,“set”,“io.appium.settings”,“android:mock_location”,“allow”]
[AndroidDriver] Pushing unlock helper app to device…
[ADB] Getting install status for io.appium.unlock
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“pm”,“list”,“packages”,“io.appium.unlock”]
[ADB] App is installed
[ADB] Getting package info for io.appium.unlock
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“dumpsys”,“package”,“io.appium.unlock”]
[ADB] Checking whether aapt is present
[ADB] The installed ‘io.appium.unlock’ package does not require upgrade (2 >= 2)
[ADB] Getting device platform version
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“getprop”,“ro.build.version.release”]
[ADB] Current device property ‘ro.build.version.release’: 7.1.1
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“wm”,“size”]
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“getprop”,“ro.product.model”]
[ADB] Current device property ‘ro.product.model’: SM-T560NU
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“getprop”,“ro.product.manufacturer”]
[ADB] Current device property ‘ro.product.manufacturer’: samsung
[AndroidDriver] Remote apk path is /data/local/tmp/1ae3bbafefcb152e97400c52646c1329.apk
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“ls”,"/data/local/tmp/1ae3bbafefcb152e97400c52646c1329.apk"]
[AndroidDriver] Checking if app is installed
[ADB] Getting install status for com.navistar.writeup
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“pm”,“list”,“packages”,“com.navistar.writeup”]
[ADB] App is installed
[AndroidDriver] Apk is already on remote and installed, resetting
[AndroidDriver] Running fast reset (stop and clear)
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“am”,“force-stop”,“com.navistar.writeup”]
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“pm”,“clear”,“com.navistar.writeup”]
[AndroidDriver] Extracting strings from apk C:\Users\u01n233\eclipse-workspace\AppiumTestProject\Apps\AcceleratorApp\Accelerator_3.0Test_TimestampFix.apk undefined C:\Users\u01n233\AppData\Local\Temp\com.navistar.writeup
[ADB] Extracting strings for language: default
[ADB] Device API level: 25
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“getprop”,“persist.sys.locale”]
[ADB] Current device property ‘persist.sys.locale’: en-US
[ADB] No strings.xml for language ‘en’, getting default strings.xml
[ADB] Reading strings from converted strings.json
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“push”,“C:\Users\u01n233\AppData\Local\Temp\com.navistar.writeup\strings.json”,"/data/local/tmp"]
[AndroidBootstrap] Watching for bootstrap disconnect
[ADB] Forwarding system: 4724 to device: 4724
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“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:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“push”,“C:\Users\u01n233\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:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“ps”]
[ADB] Attempting to kill process 18784
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“kill”,"-0",18784]
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“kill”,18784]
[UiAutomator] UiAutomator exited unexpectedly with code 4294967183, signal null
[UiAutomator] Moving to state ‘stopped’
[AndroidDriver] Shutting down Android driver
[Appium] Closing session, cause was ‘UiAUtomator shut down unexpectedly’
[Appium] Removing session 585a649e-f01a-4d9f-8298-896f473fb0b6 from our master session list
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“am”,“force-stop”,“com.navistar.writeup”]
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“kill”,18784]
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“kill”,18784]
[UiAutomator] Starting UIAutomator
[ADB] Creating ADB subprocess with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“uiautomator”,“runtest”,“AppiumBootstrap.jar”,"-c",“io.appium.android.bootstrap.Bootstrap”,"-e",“pkg”,“com.navistar.writeup”,"-e",“disableAndroidWatchers”,false,"-e",“acceptSslCerts”,false]
[ADB] Pressing the HOME button
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“input”,“keyevent”,3]
[UiAutomator] Moving to state ‘online’
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] json loading complete.
[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:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“dumpsys”,“window”]
[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:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“am”,“force-stop”,“io.appium.unlock”]
[AndroidDriver] Screen already unlocked, doing nothing
[ADB] Device API level: 25
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“am”,“start”,"-W","-n",“com.navistar.writeup/com.navistar.writeup.AcceleratorActivity”,"-S"]
[AndroidDriver] Not cleaning generated files. Add clearSystemFiles
capability if wanted.
[Appium] New AndroidDriver session created successfully, session 1ab1bd8e-1899-466c-b9f0-2aeda35eab3f added to master session list
[BaseDriver] Event ‘newSessionStarted’ logged at 1519320276629 (11:24:36 GMT-0600 (Central 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”:{“app”:“C:\Users\u01n233\eclipse-workspace\AppiumTestProject\Apps\AcceleratorApp\Accelerator_3.0Test_TimestampFix.apk”,“appActivity”:“com.navistar.writeup.AcceleratorActivity”,“appPackage”:“com.navistar.writeup”,“automationName”:“Appium”,“deviceName”:“Galaxt Tab E”,“platformName”:“android”,“platformVersion”:“7.1.1”},“app”:“C:\Users\u01n233\eclipse-workspace\AppiumTestProject\Apps\AcceleratorApp\Accelerator_3.0Test_TimestampFix.apk”,“appActivity”:“com.navistar.writeup.AcceleratorActivity”,“appPackage”:“com.navistar.writeup”,“automationName”:“Appium”,“deviceName”:“fc591f301b82ddb5”,“platformName”:“android”,“platformVersion”:“7.1.1”,“deviceUDID”:“fc591f301b82ddb5”,“deviceScreenSize”:“800x1280”,“deviceModel”:“SM-T560NU”,“deviceManufacturer”:“samsung”}
[HTTP] <-- POST /wd/hub/session 200 41999 ms - 1048
[HTTP] --> POST /wd/hub/session/1ab1bd8e-1899-466c-b9f0-2aeda35eab3f/element {“using”:“id”,“value”:“username”}
[MJSONWP] Calling AppiumDriver.findElement() with args: [“id”,“username”,“1ab1bd8e-1899-466c-b9f0-2aeda35eab3f”]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 0 ms for condition
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“username”,“context”:"",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“username”,“context”:"",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘username’ using ‘ID’ with the contextId: ‘’ multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.navistar.writeup:id/username]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=android:id/username]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=username]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:{“ELEMENT”:“1”}}
[AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Responding to client with driver.findElement() result: {“ELEMENT”:“1”}
[HTTP] <-- POST /wd/hub/session/1ab1bd8e-1899-466c-b9f0-2aeda35eab3f/element 200 30459 ms - 87
[BaseDriver] Shutting down because we waited 60 seconds for a command
[AndroidDriver] Shutting down Android driver
[Appium] Closing session, cause was ‘New Command Timeout of 60 seconds expired. Try customizing the timeout using the ‘newCommandTimeout’ desired capability’
[Appium] Removing session 1ab1bd8e-1899-466c-b9f0-2aeda35eab3f from our master session list
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“am”,“force-stop”,“com.navistar.writeup”]
[ADB] Pressing the HOME button
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘C:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“input”,“keyevent”,3]
[AndroidBootstrap] Sending command to android: {“cmd”:“shutdown”}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“shutdown”}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type SHUTDOWN
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:“OK, shutting down”}
[AndroidBootstrap] Received command result from bootstrap
[UiAutomator] Shutting down UiAutomator
[UiAutomator] Moving to state ‘stopping’
[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:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“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:\Android\android-sdk\platform-tools\adb.exe’ with args: ["-P",5037,"-s",“fc591f301b82ddb5”,“shell”,“am”,“force-stop”,“io.appium.unlock”]
[AndroidDriver] Not cleaning generated files. Add clearSystemFiles
capability if wanted.
Appium server stopped successfully
Selenium Error:
java.lang.ClassCastException: org.openqa.selenium.remote.RemoteWebElement cannot be cast to io.appium.java_client.MobileElement
at amazon.AcceleratorLogin.userLogin(AcceleratorLogin.java:45)
at amazon.AcceleratorLogin.main(AcceleratorLogin.java:57)
package amazon;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
//import org.openqa.selenium.By;
//import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.MobileElement;
import io.appium.java_client.android.AndroidDriver;
public class AcceleratorLogin {
AndroidDriver<?> driver;
public void invokeLogin() {
File classpathRoot = new File(System.getProperty("user.dir"));
File appDir = new File(classpathRoot, "/Apps/AcceleratorApp/");
File app = new File(appDir, "Accelerator_3.0Test_TimestampFix.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
//capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
capabilities.setCapability("deviceName", "Galaxt Tab E");
capabilities.setCapability("platformVersion", "7.1.1");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("automationName", "Appium");
capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("appPackage", "com.navistar.writeup");
capabilities.setCapability("appActivity", "com.navistar.writeup.AcceleratorActivity");
try {
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void userLogin() {
MobileElement el3 = (MobileElement) driver.findElementById("username");
el3.sendKeys("u01n233");
}
public static void main(String[] args) {
try {
AcceleratorLogin myObj = new AcceleratorLogin();
myObj.invokeLogin();
myObj.userLogin();
} catch (Exception e) {
e.printStackTrace();
}
}
}