I think i have configured appium correctly. This is what I get when i click on the launch button:
> Starting Node Server
> debug: Starting Appium in pre-launch mode
> info: Pre-launching app
> debug: Didn't get app but did get Android package, will attempt to launch it on the device
> debug: Creating new appium session 4144ebbc-bdce-46fe-94a6-ea6f06f66faf
> debug: Using fast reset? true
> debug: Preparing device for session
> debug: Not checking whether app is present since we are assuming it's already on the device
> debug: Checking whether adb is present
> debug: Using adb from D:\Softwares\Android\ADT\ADT\sdk\platform-tools\adb.exe
> debug: Trying to find a connected android device
> debug: Getting connected devices...
> debug: executing: "D:\Softwares\Android\ADT\ADT\sdk\platform-tools\adb.exe" devices
> debug: 1 device(s) connected
> info: Found device CB5A1THVTT
> debug: Setting device id to CB5A1THVTT
> debug: Waiting for device to be ready and to respond to shell commands (timeout = 5)
> debug: executing: "D:\Softwares\Android\ADT\ADT\sdk\platform-tools\adb.exe" -s CB5A1THVTT wait-for-device
> debug: executing: "D:\Softwares\Android\ADT\ADT\sdk\platform-tools\adb.exe" -s CB5A1THVTT shell "echo 'ready'"
> debug: Starting logcat capture
> warn: No app capability, can't parse package/activity
> debug: Getting device API level
> debug: executing: "D:\Softwares\Android\ADT\ADT\sdk\platform-tools\adb.exe" -s CB5A1THVTT shell "getprop ro.build.version.sdk"
> debug: Device is at API Level 19
> info: Device API level is: 19
> debug: Apk doesn't exist locally
> debug: executing: "D:\Softwares\Android\ADT\ADT\sdk\platform-tools\adb.exe" -s CB5A1THVTT shell "rm -rf /data/local/tmp/strings.json"
> debug: Not uninstalling app since server not started with --full-reset
> debug: Skipping install since we launched with a package instead of an app path
> debug: Forwarding system:4724 to device:4724
> debug: executing: "D:\Softwares\Android\ADT\ADT\sdk\platform-tools\adb.exe" -s CB5A1THVTT forward tcp:4724 tcp:4724
> debug: Pushing appium bootstrap to device...
> debug: executing: "D:\Softwares\Android\ADT\ADT\sdk\platform-tools\adb.exe" -s CB5A1THVTT push "D:\\Softwares\\AppiumForWindows\\node_modules\\appium\\build\\android_bootstrap\\AppiumBootstrap.jar" /data/local/tmp/
> debug: Pushing settings apk to device...
> debug: executing: "D:\Softwares\Android\ADT\ADT\sdk\platform-tools\adb.exe" -s CB5A1THVTT install "D:\Softwares\AppiumForWindows\node_modules\appium\build\settings_apk\settings_apk-debug.apk"
> debug: Pushing unlock helper app to device...
> debug: executing: "D:\Softwares\Android\ADT\ADT\sdk\platform-tools\adb.exe" -s CB5A1THVTT install "D:\Softwares\AppiumForWindows\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk"
> info: Starting App
> debug: Attempting to kill all 'uiautomator' processes
> debug: Getting all processes with 'uiautomator'
> debug: executing: "D:\Softwares\Android\ADT\ADT\sdk\platform-tools\adb.exe" -s CB5A1THVTT shell "ps 'uiautomator'"
> debug: No matching processes found
> debug: Running bootstrap
> debug: spawning: D:\Softwares\Android\ADT\ADT\sdk\platform-tools\adb.exe -s CB5A1THVTT shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap
> debug: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
> debug: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
> debug: [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
> debug: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
> debug: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
> debug: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
> debug: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
> debug: [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
> debug: [BOOTSTRAP] [debug] Socket opened on port 4724
> debug: [BOOTSTRAP] [debug] Appium Socket Server Ready
> debug: [BOOTSTRAP] [debug] Loading json...
> debug: Waking up device if it's not alive
> debug: Pushing command to appium work queue: ["wake",{}]
> debug: [BOOTSTRAP] [debug] Registered crash watchers.
> debug: [BOOTSTRAP] [debug] Client connected
> debug: [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"wake","params":{}}
> debug: [BOOTSTRAP] [debug] Got command of type ACTION
> debug: [BOOTSTRAP] [debug] Got command action: wake
> debug: [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
> debug: executing: "D:\Softwares\Android\ADT\ADT\sdk\platform-tools\adb.exe" -s CB5A1THVTT shell "dumpsys window"
> debug: Writing dumpsys output to D:\Softwares\AppiumForWindows\node_modules\appium\.dumpsys.log
> debug: Screen already unlocked, continuing.
> debug: Pushing command to appium work queue: ["getDataDir",{}]
> debug: [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"getDataDir","params":{}}
> debug: [BOOTSTRAP] [debug] Got command of type ACTION
> debug: [BOOTSTRAP] [debug] Got command action: getDataDir
> debug: [BOOTSTRAP] [debug] Returning result: {"value":"\/data","status":0}
> debug: dataDir set to: /data
> debug: executing: "D:\Softwares\Android\ADT\ADT\sdk\platform-tools\adb.exe" -s CB5A1THVTT shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.dtz.sg/com.dtz.sg.DTZMobility"
> debug: Waiting for pkg "com.dtz.sg" and activity "com.dtz.sg.DTZMobility" to be focused
> debug: Getting focused package and activity
> debug: executing: "D:\Softwares\Android\ADT\ADT\sdk\platform-tools\adb.exe" -s CB5A1THVTT shell "dumpsys window windows"
> debug: Device launched! Ready for commands
> info: Welcome to Appium v1.2.0 (REV e53f49c706a25242e66d36685c268b599cc18da5)
> debug: Setting command timeout to the default of 60 secs
> info: Appium REST http interface listener started on 127.0.0.1:4723
> debug: Non-default server args: {"address":"127.0.0.1","launch":true,"logNoColors":true,"androidPackage":"com.dtz.sg","androidActivity":"com.dtz.sg.DTZMobility","platformName":"Android","platformVersion":"19","automationName":"Appium"}
> info: LogLevel: debug
I made a simple coded UI project with few lines to automate my hybrid android application:
namespace CodedUITestProject3
{
/// <summary>
/// Summary description for CodedUITest1
/// </summary>
[CodedUITest]
public class CodedUITest1
{
public AppiumDriver driver;
public DesiredCapabilities capabilities;
[TestMethod]
public void CodedUITestMethod1()
{
Console.WriteLine("Connecting to Opium server");
capabilities = new DesiredCapabilities();
capabilities.SetCapability(CapabilityType.BrowserName, "Android");
capabilities.SetCapability(CapabilityType.Version, "4.1");
capabilities.SetCapability("deviceName", "Android");
capabilities.SetCapability("platformName", "Android");
capabilities.SetCapability("appPackage", "com.dtz.sg");
capabilities.SetCapability("appActivity", "com.dtz.sg.DTZMobility");
//Application path and configurations
capabilities.SetCapability("app", @"D:\Softwares\Android\ADT\ADT\sdk\build-tools\android-4.2.2\sg-stag-1.0.6.apk");
driver = new AppiumDriver(new Uri("http://127.0.0.1:4723/wd/hub"), capabilities);
Thread.Sleep(5000);
// String title = driver.Title;
driver.FindElement(By.Name("Login")).Click();
}
But when i debug, i got this error on the code:
{"Object reference not set to an instance of an object."}
Does someone have any idea?