0

I am trying to get chimpchat to work for Android. This is my class

import java.util.Map;
import java.util.TreeMap;

import com.android.chimpchat.ChimpChat;
import com.android.chimpchat.adb.AdbBackend;
import com.android.chimpchat.core.IChimpDevice;
import com.android.chimpchat.core.TouchPressType;


public class TapTest {

    public static void main(String[] args)
    {
           Map<String, String> options = new TreeMap<String, String>();
           options.put("backend", "adb");
           options.put("adbLocation", "D:\\Android\\platform-tools\\adb.exe");
           ChimpChat chimpchat = ChimpChat.getInstance(options);
           IChimpDevice device = chimpchat.waitForConnection(5000, ".*");
           device.touch(100, 100, TouchPressType.DOWN_AND_UP);
           chimpchat.shutdown();

    }

}

and running this gives me this exception

Exception in thread "main" java.lang.NoClassDefFoundError: com/android/ddmlib/TimeoutException
    at com.android.chimpchat.adb.AdbBackend.waitForConnection(AdbBackend.java:122)
    at com.android.chimpchat.ChimpChat.waitForConnection(ChimpChat.java:91)
    at TapTest.main(TapTest.java:21)
Caused by: java.lang.ClassNotFoundException: com.android.ddmlib.TimeoutException
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 3 more

I have added Chimpchat.jar,guava.jar, monkeyrunner.jar, sdklib.jar, jython-standalone.jar.

AnujKapoor
  • 99
  • 2
  • 10

2 Answers2

0

Why don't you use uiautomator instead?

I see the uiautomator as the better tool for inspecting UI elements. It has more powerful methods to identify UI objects and interact with them. You no longer need to place sleep commands in your script. Just wait for a specific element. You can wait for an element to appear or disappear.

You can have watchers which run in case an UI object is not found. This can be helpful when handling pop-ups and error messages.

Here's a link to a tutorial. http://developer.android.com/tools/testing/testing_ui.html

Gabriel Porumb
  • 1,661
  • 1
  • 12
  • 21
0

As the error say. You need to add ddmlib.jar too.

user1047504
  • 578
  • 7
  • 14