0

I am a newbie to Python and have created simple Appium Automation Test case for Android mobile app.

I have setup Jenkins server and want to run Appium on it so there are 2 ways:

  1. Run appium server via Jenkins (We can run it using appium command but when I run appium command it just "hangs up" and showing server console continiously)
  2. Start Appium Server programmatically using Python

I know we can run Appium Server programmatically using Java but don't know about python.

So, if you have any idea about either of above 2 ways, please post the answer.

Thank you

4 Answers 4

1

I have found the answer for 1:

Use appium & command.

Use & at the end of the command that will run it in background and didn't freeze the terminal.

Please Refer this

Sign up to request clarification or add additional context in comments.

Comments

0

Below is what you can do for 2. Start Appium Server programmatically using Python

import os

#starts appium on same terminal window

os.system("appium")

#starts appium on new terminal window 
os.system("start /B start cmd.exe @cmd /k appium")

Comments

0

The way I do it is:

write appium in terminal

or if I want a specific chromedriver version then I do:

appium --chromedriver-executable /path/to/my/chromedriver/chromedriver_2.42

Comments

0

1) Create a shell script called startAppium.sh with this command: appium --debug &

2) Create a shell script called killAppium.sh with this command: kill $(ps -e | grep 'appium' | awk '{print $1}')

3) Use python to run either process to execute the shell scripts: import killProcess killProcess.call(['./killAppium.sh'])

Note: I use the above for Jenkins CI/CD in the groovy file's setup and post blocks with just the commands, i.e: sh "appium --debug &" and sh "kill $(ps -e | grep 'appium' | awk '{print $1}')".

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.