I'm using monkeyrunner from android-sdk_r12-linux_x86, and I get the same ClassCastException when trying to use the MonkeyImage.sameAs method.
On Jul 11, 12:22 am, Sean Wang <wangxiao8...@gmail.com> wrote: > Hi, Now I am using the monkeyrunner with Android SDK_r12. Also got > this problem. > OS: Win7 x64 professional > Java: Sun Java 1.6.0_25 32bit version > Monkeyrunner is the one in Android sdk_r12 build, not built by myself. > > The log is below: > > C:\Users\dell>monkeyrunner > Jython 2.5.0 (Release_2_5_0:6476, Jun 16 2009, 13:33:26) > [Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.6.0_25>>> from > com.android.monkeyrunner import MonkeyRunner as MR > >>> d=MR.waitForConnection() > >>> i1=d.takeSnapshot() > >>> i2=d.takeSnapshot() > >>> i1.sameAs(i2) > > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > at > com.android.monkeyrunner.MonkeyImage.sameAs(MonkeyImage.java:138) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. > java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces > sorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > > java.lang.ClassCastException: java.lang.ClassCastException: > org.python.core.PySi > ngleton cannot be cast to com.android.monkeyrunner.core.IMonkeyImage > > On 5月25日, 上午6时05分, Bill Napier <nap...@android.com> wrote: > > > > > > > > > your stack trace doesn't match your code: > > > if img_1.sameAs(1, img_2): > > > has the arguments in the wrong order. It should be: > > > if img_1.sameAs(img_2, 1) > > > On Mon, May 23, 2011 at 2:58 AM, Alexander Sukhov > > <testsem...@gmail.com>wrote: > > > > Hello, > > > > I build SDK from source code. > > > And i want to use the following script: > > > > img=MonkeyRunner.loadImageFromFile(path='bla bla bla') > > > > img_1=device.takeSnapshot() > > > > img_1.sameAs(img, 1) > > > > But this error: > > > File "/home/semc/monkey/out/host/linux-x86/sdk/android- > > > sdk_eng.semc_linux-x86/tools/test.py", line 23, in <module> > > > if img_1.sameAs(1, img_2): > > > at > > > com.android.monkeyrunner.MonkeyImage.sameAs(MonkeyImage.java:138) > > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: > > > 39) > > > at > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp > > > l.java: > > > 25) > > > at java.lang.reflect.Method.invoke(Method.java:597) > > > > java.lang.ClassCastException: java.lang.ClassCastException: > > > org.python.core.PySingleton cannot be cast to > > > com.android.monkeyrunner.core.IMonkeyImage > > > > Please help! > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Android Developers" group. > > > To post to this group, send email to android-developers@googlegroups.com > > > To unsubscribe from this group, send email to > > > android-developers+unsubscr...@googlegroups.com > > > For more options, visit this group at > > >http://groups.google.com/group/android-developers?hl=en > > > -- > > Note: please don't send private questions to me, as I don't have time > > to provide private support. All such questions should be posted on > > public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en