michaelia / robotium Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/robotium
Automatically exported from code.google.com/p/robotium
What steps will reproduce the problem?
1. Setup mavenized main project as per maven-android-eclipse docs.
2. Setup mavenized test project as per maven-android-eclipse docs.
3. Setup Robotium dependency on test project.
What is the expected output? What do you see instead?
I expect a Junit runner result - not an exception of a missing class.
Seems like the apk doesn't have the source packed in for some reason.
This is despite having 0 compile time issues.
What version of the product are you using? On what operating system?
mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-06 15:16:01-0400)
Java version: 1.6.0_20
Java home: /usr/java/jdk1.6.0_20/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.18-194.8.1.el5" arch: "amd64" Family: "unix"
Please provide any additional information below.
DDMS Output
08-01 17:48:36.505: ERROR/dalvikvm(406): Could not find class
'com.jayway.android.robotium.solo.Solo', referenced from method
com.overlord.test.NotificationTest.setUp
08-01 17:48:36.505: WARN/dalvikvm(406): VFY: unable to resolve new-instance 16
(Lcom/jayway/android/robotium/solo/Solo;) in
Lcom/overlord/test/NotificationTest;
08-01 17:48:36.505: WARN/dalvikvm(406): VFY: rejecting opcode 0x22 at 0x0000
08-01 17:48:36.505: WARN/dalvikvm(406): VFY: rejected
Lcom/overlord/test/NotificationTest;.setUp ()V
08-01 17:48:36.505: WARN/dalvikvm(406): Verifier rejected class
Lcom/overlord/test/NotificationTest;
08-01 17:48:36.505: DEBUG/AndroidRuntime(406): Shutting down VM
08-01 17:48:36.505: WARN/dalvikvm(406): threadid=3: thread exiting with
uncaught exception (group=0x4001aa28)
08-01 17:48:36.505: ERROR/AndroidRuntime(406): Uncaught handler: thread main
exiting due to uncaught exception
08-01 17:48:36.515: ERROR/AndroidRuntime(406): java.lang.VerifyError:
com.overlord.test.NotificationTest
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
java.lang.Class.getDeclaredConstructors(Native Method)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
java.lang.Class.getConstructor(Class.java:484)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
junit.framework.TestSuite.getTestConstructor(TestSuite.java:177)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
junit.framework.TestSuite.<init>(TestSuite.java:59)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:103)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
android.test.AndroidTestRunner.getTest(AndroidTestRunner.java:124)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
android.test.AndroidTestRunner.setTestClassName(AndroidTestRunner.java:52)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
android.test.suitebuilder.TestSuiteBuilder.addTestClassByName(TestSuiteBuilder.j
ava:81)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
android.test.InstrumentationTestRunner.parseTestClass(InstrumentationTestRunner.
java:375)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
android.test.InstrumentationTestRunner.parseTestClasses(InstrumentationTestRunne
r.java:357)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
android.test.InstrumentationTestRunner.onCreate(InstrumentationTestRunner.java:3
25)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
android.app.ActivityThread.handleBindApplication(ActivityThread.java:3848)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
android.app.ActivityThread.access$2800(ActivityThread.java:116)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
android.os.Handler.dispatchMessage(Handler.java:99)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
android.os.Looper.loop(Looper.java:123)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
android.app.ActivityThread.main(ActivityThread.java:4203)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
java.lang.reflect.Method.invokeNative(Native Method)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
java.lang.reflect.Method.invoke(Method.java:521)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
08-01 17:48:36.515: ERROR/AndroidRuntime(406): at
dalvik.system.NativeStart.main(Native Method)
08-01 17:48:36.525: INFO/Process(52): Sending signal. PID: 406 SIG: 3
08-01 17:48:36.525: WARN/ActivityManager(52): Error in app com.overlord running
instrumentation
ComponentInfo{com.overlord.test/android.test.InstrumentationTestRunner}:
08-01 17:48:36.525: WARN/ActivityManager(52):
com.overlord.test.NotificationTest
08-01 17:48:36.525: WARN/ActivityManager(52): java.lang.VerifyError:
com.overlord.test.NotificationTest
Eclipse - Run Android JUnit Test output
Process crash is using the APK style test initialization,
Test run fail is using the standard test initialization.
[2010-08-01 13:48:28 - Overlordtest] Launching instrumentation
android.test.InstrumentationTestRunner on device emulator-5554
[2010-08-01 13:48:30 - Overlordtest] Collecting test information
[2010-08-01 13:48:33 - Overlordtest] Test run failed: Process crashed.
[2010-08-01 13:48:37 - Overlordtest] ------------------------------
[2010-08-01 13:48:37 - Overlordtest] Android Launch!
[2010-08-01 13:48:37 - Overlordtest] adb is running normally.
[2010-08-01 13:48:37 - Overlordtest] Performing
android.test.InstrumentationTestRunner JUnit launch
[2010-08-01 13:48:37 - Overlordtest] Automatic Target Mode: using existing
emulator 'emulator-5554' running compatible AVD 'googleapi4'
[2010-08-01 13:48:39 - Overlordtest] Application already deployed. No need to
reinstall.
[2010-08-01 13:48:39 - Overlordtest] Project dependency found, installing:
Overlord
[2010-08-01 13:48:40 - Overlord] Application already deployed. No need to
reinstall.
[2010-08-01 13:48:40 - Overlordtest] Launching instrumentation
android.test.InstrumentationTestRunner on device emulator-5554
[2010-08-01 13:48:42 - Overlordtest] Collecting test information
[2010-08-01 13:48:44 - Overlordtest] Test run failed:
com.overlord.test.NotificationTest
Primary POM.
<artifactId>overlord</artifactId>
<packaging>apk</packaging>
<name>Overlord</name>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>2.1_r2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android.maps</groupId>
<artifactId>maps</artifactId>
<version>7_r1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>maven-android-plugin</artifactId>
<configuration>
<sdk>
<path>${env.ANDROID_HOME}</path>
<platform>2.1</platform>
</sdk>
<deleteConflictingFiles>true</deleteConflictingFiles>
</configuration>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
Test project POM
<artifactId>Overlordtest</artifactId>
<packaging>apk</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>Overlordtest</name>
<dependencies>
<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>2.1_r2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android.maps</groupId>
<artifactId>maps</artifactId>
<version>7_r1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>overlord</groupId>
<artifactId>overlord</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>apk</type>
</dependency>
<dependency>
<groupId>overlord</groupId>
<artifactId>overlord</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.jayway.android.robotium</groupId>
<artifactId>robotium-solo</artifactId>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>oss.sonatype.org-jayway</id>
<url>http://oss.sonatype.org/content/groups/jayway/</url>
</repository>
</repositories>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>maven-android-plugin</artifactId>
<configuration>
<sdk>
<path>${env.ANDROID_HOME}</path>
<platform>2.1</platform>
</sdk>
<deleteConflictingFiles>true</deleteConflictingFiles>
</configuration>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
Original issue reported on code.google.com by [email protected]
on 1 Aug 2010 at 8:58
Solo.getCurrenButtonsCount() should be Solo.getCurrentButtonsCount().
What version of the product are you using? On what operating system?
robotium-1.6.0
Original issue reported on code.google.com by [email protected]
on 25 Jul 2010 at 3:29
I know the code for drag() is taken from TouchUtils, but it's probably easier
to fix it here. Notice how the x and y used for the motion event are "fromX, y"
rather than "fromX,fromY" or "toX,toY".
Current code:
http://github.com/jayway/robotium/blob/master/robotium-solo/src/main/java/com/ja
yway/android/robotium/solo/Scroller.java#L67
http://github.com/jayway/robotium/blob/master/robotium-solo/src/main/java/com/ja
yway/android/robotium/solo/Scroller.java#L86
public void drag(float fromX, float toX, float fromY, float toY,
int stepCount) {
...
eventTime,MotionEvent.ACTION_DOWN, fromX, y, 0);
...
event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_UP,fromX, y,
0);
}
Correct code:
eventTime,MotionEvent.ACTION_DOWN, fromX, fromY, 0);
...
event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_UP,toX, toY,
0);
Original issue reported on code.google.com by [email protected]
on 12 Jun 2010 at 4:50
What steps will reproduce the problem?
1. Extend a base class such as EditText:
public class MyEditText extends EditText {
...
}
2. Use this class as an EditText view.
3. call solo.getCurrentEditTexts() in a test (or related methods).
What is the expected output?
A list of MyEditText views.
What do you see instead?
A null list.
What version of the product are you using? On what operating system?
1.3.1 on mac os x / eclipse / android latest
Please provide any additional information below.
This is the result of the following check in ViewFetcher.java:
public ArrayList<TextView> getCurrentTextViews(View parent) {
... cut ..
if (view.getClass().getName().equals("android.widget.TextView")) {
textViewList.add((TextView) view);
}
... cut ..
}
This only allows classes with that specific class name, not classes that extend
it. Instead, it would be better to use the runtime "instaceof"
comparison :
public ArrayList<TextView> getCurrentTextViews(View parent) {
... cut ..
if (view.getClass().isInstance(android.widget.TextView.class)) {
textViewList.add((TextView) view);
}
... cut ..
}
The same applies to the other methods that look for buttons, GridViews, etc.
Original issue reported on code.google.com by [email protected]
on 9 Mar 2010 at 2:37
What steps will reproduce the problem?
1. Run NoteEditorTest as an Android Junit Test
What is the expected output? What do you see instead?
Everything fails, when it should pass.
What version of the product are you using? On what operating system?
1.6.0
Please provide any additional information below.
What seems to be happening is it is not actually clicking on any buttons. It
highlights the correct button, but does not click.
I have found that:
getActivity().runOnUiThread(new Runnable() {
public void run() {
mButton.performClick();
}
});
fixes things quite nicely in my app.
It works absolutely fine on the emulator.
Original issue reported on code.google.com by [email protected]
on 20 Jul 2010 at 1:12
Hi Friends,
Would like to select one particular suggestion from particular
suggestion,please let me know which method suppose to use?
Thanks,
Alf.
Original issue reported on code.google.com by [email protected]
on 11 May 2010 at 9:45
I am using this for the first time. I have found some actions that I have
needed to perform that I could not without combining several method calls
into one. I'll include the functions that I had to write to complete these
tasks here...
Original issue reported on code.google.com by [email protected]
on 16 Apr 2010 at 2:17
I don't see any way of working with dialogs.
I should be able to
* assert that one is present or not present
* detect which buttons are present (affirmative, neutral, or negative)
* click any of the buttons (affirmative, neutral, or negative)
* wait for them to close (for a indeterminate progress bar)
* read the title text
* read the message text
Original issue reported on code.google.com by [email protected]
on 16 Apr 2010 at 2:17
Hi,
Please would like to know how can i create external excel sheet from
robotium ,is there any script or commands?
Thanks,
Alf.
Original issue reported on code.google.com by [email protected]
on 12 May 2010 at 6:28
Hi,
Would like to change my SIP in to different modes like capital and small
,please let us know is there any method to click on Capital key in SIP.
Thanks and Regards,
Alf.
Original issue reported on code.google.com by [email protected]
on 18 May 2010 at 11:23
07-17 17:15:09.675: WARN/System.err(10963):
java.lang.ArrayIndexOutOfBoundsException
07-17 17:15:09.675: WARN/System.err(10963): at
com.jayway.android.robotium.solo.ViewFetcher.getViews(ViewFetcher.java:100)
07-17 17:15:09.675: WARN/System.err(10963): at
com.jayway.android.robotium.solo.ViewFetcher.getCurrentTextViews(ViewFetcher.jav
a:286)
07-17 17:15:09.675: WARN/System.err(10963): at
com.jayway.android.robotium.solo.Searcher.searchForText(Searcher.java:338)
07-17 17:15:09.675: WARN/System.err(10963): at
com.jayway.android.robotium.solo.Searcher.searchText(Searcher.java:312)
07-17 17:15:09.675: WARN/System.err(10963): at
com.jayway.android.robotium.solo.Searcher.searchText(Searcher.java:294)
07-17 17:15:09.675: WARN/System.err(10963): at
com.jayway.android.robotium.solo.Searcher.searchText(Searcher.java:278)
07-17 17:15:09.675: WARN/System.err(10963): at
com.jayway.android.robotium.solo.Solo.searchText(Solo.java:273)
07-17 17:15:09.675: WARN/System.err(10963): at
net.lp.collectionista.test.usecases.collections.ManageCollectionUseCaseTest.test
UpdateRenameCollection(ManageCollectionUseCaseTest.java:226)
07-17 17:15:09.675: WARN/System.err(10963): at
net.lp.collectionista.test.usecases.collections.ManageCollectionUseCaseTest.test
UpdateRenameCollection(ManageCollectionUseCaseTest.java:205)
07-17 17:15:09.675: WARN/System.err(10963): at
java.lang.reflect.Method.invokeNative(Native Method)
07-17 17:15:09.675: WARN/System.err(10963): at
java.lang.reflect.Method.invoke(Method.java:521)
07-17 17:15:09.675: WARN/System.err(10963): at
android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:204)
07-17 17:15:09.675: WARN/System.err(10963): at
android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:194)
07-17 17:15:09.675: WARN/System.err(10963): at
android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTes
tCase2.java:186)
07-17 17:15:09.675: WARN/System.err(10963): at
junit.framework.TestCase.runBare(TestCase.java:127)
07-17 17:15:09.682: WARN/System.err(10963): at
junit.framework.TestResult$1.protect(TestResult.java:106)
07-17 17:15:09.682: WARN/System.err(10963): at
junit.framework.TestResult.runProtected(TestResult.java:124)
07-17 17:15:09.682: WARN/System.err(10963): at
junit.framework.TestResult.run(TestResult.java:109)
07-17 17:15:09.682: WARN/System.err(10963): at
junit.framework.TestCase.run(TestCase.java:118)
07-17 17:15:09.682: WARN/System.err(10963): at
android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
07-17 17:15:09.682: WARN/System.err(10963): at
android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
07-17 17:15:09.682: WARN/System.err(10963): at
android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:52
0)
07-17 17:15:09.682: WARN/System.err(10963): at
android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)
What steps will reproduce the problem?
I can arrange for you to get my open source code that exhibits this problem.
What version of the product are you using? On what operating system?
1.6.0 on Android 2.2
Original issue reported on code.google.com by [email protected]
on 17 Jul 2010 at 3:18
I get this error when running the test in the example:
java.lang.SecurityException: Injecting to another application requires
INJECT_EVENT permission
at android.os.Parcel.readException(Parcel.java:1218)
at android.os.Parcel.readException(Parcel.java:1206)
at
android.view.IWindowManager$Stub$Proxy.injectKeyEvent(IWindowManager.java:8
05)
at android.app.Instrumentation.sendKeySync(Instrumentation.java:859)
at android.app.Instrumentation.sendKeyDownUpSync(Instrumentation.java:871)
at com.jayway.android.robotium.solo.Solo.pressMenuItem(Solo.java:556)
at com.jayway.test.NotePadTest.testAddNote(NotePadTest.java:38)
at java.lang.reflect.Method.invokeNative(Native Method)
at
android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java
:205)
at
android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:1
95)
at
android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentati
onTestCase2.java:175)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
at
android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.ja
va:430)
at
android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:
1447)
I tried adding the permission to the manifest file, but that did not help.
Original issue reported on code.google.com by [email protected]
on 22 Feb 2010 at 7:31
Hello,
Please could you explain that how we can use solo.getViews() function to
print views in console with example and please let me know is there any
function to print results in console.
Thanks.
Alf.
Original issue reported on code.google.com by [email protected]
on 20 May 2010 at 11:33
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.