In this article, we are going to see how to install Robotium In
Eclipse.We will use robotium for android application testing using code
base or stand alone apk. I will provide separate post for how to code.
Let's make environment ready.
Step 1. Install android SDK. See my this post.
Step 2. Download Robotium : Download latest robotium and java doc from this link . As we will perform detail analysis on robotium, you may download the source from this github link. I use zipped source.
Step 3 : Adding Robotium to the project : In this step, we will see how to create robotium project. Robotium is an extended Android JUnit package. So,
-Run Eclipse
-From file > New >Project
-Select Android Test Project [Under Android Folder, with Junit logo]
Screenshot Link
-Add a project name(ex-ShantonuTestRobo)
-Select This Project(not under any existing project)
-Select an android version( I choose 4.1.2) and click Finish. So we will find like this.
Now , we have to add downloaded library. For this, right click on project and select properties.
-From property window, select Java Build Path.
-Click Libraries
-Click Add external JARs and show the downloaded path of robotium solo jar.
ScreenShot.
-You may add Java Doc and downloaded source files. It will help advance unit testers.
Screenshot for JavaDoc
Screenshot for Source Adding.
Step 4 : Add a class under package of the source file . We will see two ways to write robotium unit test cases. I will post separately with codes.
Now we are ready environment to start coding with Robotium for Unit testing.
Note : To prevent java.lang.NoClassDefFoundError export the robotium library. To export any library go to project properties > java build path > order and export . Now select robotium and press ok.
Thanks...:)
Step 1. Install android SDK. See my this post.
Step 2. Download Robotium : Download latest robotium and java doc from this link . As we will perform detail analysis on robotium, you may download the source from this github link. I use zipped source.
Step 3 : Adding Robotium to the project : In this step, we will see how to create robotium project. Robotium is an extended Android JUnit package. So,
-Run Eclipse
-From file > New >Project
-Select Android Test Project [Under Android Folder, with Junit logo]
Screenshot Link
-Add a project name(ex-ShantonuTestRobo)
-Select This Project(not under any existing project)
-Select an android version( I choose 4.1.2) and click Finish. So we will find like this.
Now , we have to add downloaded library. For this, right click on project and select properties.
-From property window, select Java Build Path.
-Click Libraries
-Click Add external JARs and show the downloaded path of robotium solo jar.
ScreenShot.
-You may add Java Doc and downloaded source files. It will help advance unit testers.
Screenshot for JavaDoc
Screenshot for Source Adding.
Step 4 : Add a class under package of the source file . We will see two ways to write robotium unit test cases. I will post separately with codes.
Now we are ready environment to start coding with Robotium for Unit testing.
Note : To prevent java.lang.NoClassDefFoundError export the robotium library. To export any library go to project properties > java build path > order and export . Now select robotium and press ok.
Thanks...:)