drag() doesn't work

6 views
Skip to first unread message

jalexan

unread,
May 20, 2009, 3:19:34 PM5/20/09
to Auto-android
Are there any workarounds? Nothing works for me. I've tried this:
drag(150,100,150,250); // I see a small highlight from the starting
coordinates, but the screen doesn't move
drag(stringAt("resultView.categoriesView.0.6"),stringAt
("resultView.categoriesView.0.3")); //throws exception:

java.lang.RuntimeException: Unknown property
com.yellowpages.android.ypmobile.YPM.com Spelling?
at com.googlecode.autoandroid.positron.PositronClient.assertSuccess
(PositronClient.java:68)
at com.googlecode.autoandroid.positron.PositronClient.get
(PositronClient.java:50)
at com.googlecode.autoandroid.positron.PositronClient.get
(PositronClient.java:39)
at com.googlecode.autoandroid.positron.PositronClient.drag
(PositronClient.java:348)
at com.googlecode.autoandroid.positron.junit4.TestCase.drag
(TestCase.java:266)
at
com.yellowpages.android.ypmobile.BrandSearchCase.dragPopularCategoriesShouldShowMoreCategories
(BrandSearchCase.java:188)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.junit.internal.runners.TestMethodRunner.executeMethodBody
(TestMethodRunner.java:99)
at org.junit.internal.runners.TestMethodRunner.runUnprotected
(TestMethodRunner.java:81)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected
(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestMethodRunner.runMethod
(TestMethodRunner.java:75)
at org.junit.internal.runners.TestMethodRunner.run
(TestMethodRunner.java:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod
(TestClassMethodsRunner.java:71)
at org.junit.internal.runners.TestClassMethodsRunner.run
(TestClassMethodsRunner.java:35)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected
(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected
(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run
(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
(JUnit4TestReference.java:45)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run
(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
(RemoteTestRunner.java:196)

Thanks,
Julie

Julie Alexan

unread,
May 20, 2009, 3:21:15 PM5/20/09
to Auto-android
I should add that a horizontal drag works (different x coords), but a
vertical drag is what is not working for me here.

DineshG

unread,
May 20, 2009, 6:22:54 PM5/20/09
to Auto-android
Can you share your test ?

On May 20, 12:19 pm, jalexan <jalexan....@gmail.com> wrote:

Julie Alexan

unread,
May 21, 2009, 7:11:29 PM5/21/09
to Auto-android
Sure. I pretty much have a long list (25+) of businesses in a
LinearLayout. Only about 6 show up without dragging (scrolling
down). So, I bring up that view, try to drag (to scroll down), and I
still end up clicking on the original 4th item in the list since the
drag doesn't work:

press(MENU);
menu(MYAPP.BROWSE); // This brings up a ScrollView containing a
LinearLayout of a list of businesses
wait(1000);

//drag(stringAt("viewGroup.scrollView.linearLayout.6"),stringAt
("viewGroup.scrollView.linearLayout.3")); //THIS DOESN'T WORK
drag(160,350,160,200); // THIS DOESN'T WORK EITHER
wait(1000);

touch(stringAt("viewGroup.scrollView.linearLayout.4"); // business
id #4 clicked on should NOT be the orignal 4th item, but it is.

Hope that makes more sense than my previous post. So...all I really
need is a fix or a workaround. Any ideas?

Thanks,
Julie

Phil Smith

unread,
May 21, 2009, 7:17:28 PM5/21/09
to autoa...@googlegroups.com
If it's just a list view that you're trying to navigate through, you
could try "press(DOWN);" instead?

Julie Alexan

unread,
May 21, 2009, 8:17:26 PM5/21/09
to Auto-android
Yes! I didn't realize I could do that. I knew that had to be another
way around it but I didn't know what. Pressing down multiple times
works (duh). Thanks so much!

Julie :)

On May 21, 4:17 pm, Phil Smith <phil.h.sm...@gmail.com> wrote:
> If it's just a list view that you're trying to navigate through, you
> could try "press(DOWN);"  instead?
>

Julie Alexan

unread,
May 21, 2009, 9:00:12 PM5/21/09
to Auto-android
Oh :( Now press(UP) isn't working. If I scroll down the screen, it
seems that I can't scroll back up. Because now, neither of these
work:

press(UP,UP,UP,UP,UP,UP,UP,UP,UP,UP,UP,UP,UP,UP,UP,UP);
drag(160,200,160,350);

Any ideas on going back up? I can always press(MENU) then BROWSE all
over again, but that's kinda testing a different thing. It's not
testing scroll up.

Thanks
Julie
Reply all
Reply to author
Forward
0 new messages