Write and Run Java Test from Eclipse IDE

--

Install and execute Android APK file from code.

Step A: Select a directory as workspace

Figure 1 : Select the workspace & select Lauch button.

Step B: Type a name of project and check your default settings.

Figure 2: Type the name of project & Click on Next

Step C: Right click on project and select properties > Java Build Path > Select Class Path and Add required libraries from Add External JARs

Figure 3: Select the Classpath & Add required JAR files.

Step D: Add External JARs as Java Client Library. [Refer: Installation for Appium Test — (Part 07)]

Step E: Add External JARs as Selenium Driver (Java). [Refer: Installation for Appium Test — (Part 07)]

Step F: Copy and Paste “Sample APK File” into Src folder

Step G: Right Click on Project > New > Package > Create package and name it as “demo”.

Figure 4: Create package & Click on Finish

Step H: Right Click on Package > Create class and name it as “MobileTest1”.

Figure 5: Create class & Click on Finish

Step I: The skeleton of Class “MobileTest1” look like as above.

Figure 6: A skeleton code for Class.

Step J: Update the Class “MobileTest1” look like as above.

Figure 7: Write & modify existing code

Step K: Run Appium Server and Run Emulator. Right Click on source code and Select Run As > Java Application and wait for your output in your selected Emulator.

Figure 8: Run the application using Run As option

An output of the above steps is…

Figure 9: Final output of your APK file.

Let us know what you think

Please give us feedback on this manual, so we can provide content that’s truly useful and helpful. Thanks!

--

--

No responses yet