Run appium server programmatically using java

As we already got to know from our earlier post Appium test run,  always run appium server  / appium GUI before running your appium test.

While running automated tests, we have to manually run the appium server / GUI first.

Problem:

let’s say that we have to schedule our appium tests to run (may be a nightly build test) and we won’t be at desk or office to run the appium server first.

Solution:

We can write a java code block to run the appium server before running our actual appium test, then we need to do anything manually.

Prerequisites:

  • Download and install appium.exe (refer step6 of appium setup)
  • Install node.exe (refer step7 of appium setup)
  • Jar file – you may get error while running the appium programmatically, validator or lang3 error, include these below jars in to your project

commons-validator-x.x.x.jar – download here

commons-lang3-x.x.jar – download here




Let’s see how we can achieve this – 

below code will automatically run the appium server and after run the appium test.

You can provide path for AppiumServerlog.txt as per your local drive path, I mentioned the project folder path.

 

Content posted is based on learning or working experience, Share the post with others if find useful, Any queries?, leave comments or discuss on our facebook:qavalidation.com, Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: