xiaofans / robotium

Automatically exported from code.google.com/p/robotium
0 stars 0 forks source link

Error "could not find class 'android.support.v4.app.FragmentActivity' while launching activity #391

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a dummy AUT android native app with one activity.
2. Create the test robotium project 
3. In the test project add "AndroidTestUtility.jar" file (attached here) in 
libs folder along with robotium 3.6 jar file.
4. The "AndroidTestUtility.jar" handles the setup and tear down by itself.
5. Add similar cade as below:

    private static final String TARGET_PACKAGE_ID ="com.sap.esm.retail";
    private static final String LAUNCHER_ACTIVITY_FULL_CLASSNAME2 ="com.sap.esm.retail.MobileRetailingActivity"; // First Activity

     public InitialTest() throws ClassNotFoundException {
                super(TARGET_PACKAGE_ID,LAUNCHER_ACTIVITY_FULL_CLASSNAME2);

     }
6. Add a sample test method that the robotium would execute.
7. Run the android junit test.
8. Error message in IDE shown (screenshot "ErrorScreenshotIDE.jpg") and error 
message in logcat shown (screenshot "ErrorLogScreenshot.JPG").
9. I have attached the logcat file content also.

What is the expected output? What do you see instead?

The test framework "AndroidTestUtility" is extended by the main class of the 
test roboiutm project.

What version of the product are you using? On what operating system?
Windows 7 64bit, Android ADT bundle, Robotium 3.6 (checked on 3.4.1 also), 
Target: Android API 15

Please provide any additional information below.

Can anyone help me here ?

Thanks and Regards,

Abhishek

Original issue reported on code.google.com by abhishek...@gmail.com on 15 Feb 2013 at 5:09

Attachments:

GoogleCodeExporter commented 9 years ago
The expected output should have been the launch of the activity and the 
subsequent automated steps for it.
Actualt output is that the activity is launched but no automated steps (solo 
statements) are executed. The error message is shown in the attached 
screenshots.

Original comment by abhishek...@gmail.com on 15 Feb 2013 at 5:21

GoogleCodeExporter commented 9 years ago
The logcat file Entirelog.txt can be downloaded from : 
http://www.2shared.com/document/JvKoOJL5/Entirelog.html

Original comment by abhishek...@gmail.com on 15 Feb 2013 at 6:26

GoogleCodeExporter commented 9 years ago
You need to export the Robotium jar in the java build path. Please see "Common 
Robotium issues" in the tutorials wiki page. 

Original comment by renasr...@gmail.com on 15 Feb 2013 at 2:20