Unable to launch Appium tests from Jenkins

Hi, guys!

Im trying to launch my Appium tests from Jenkins. It’s working great when i:

  1. Starting Appium server manually (cmd.exe Appium)
  2. Launch tests from Jenkins.

but when i try to launch Appium server from Jenking by using this command:

call node C:\Users\User\AppData\Roaming\npm\node_modules\appium\build\lib\main.js --address 0.0.0.0 --port 4723 --no-reset

Jenkins console returns:

[Appium] Appium REST http interface listener started on 0.0.0.0:4723

and nothing happens. No any errors…just nothing happens.

Can you help me?

Thanks

P.S. Win 7 (64 bit), Appium server 1.7.1 (installed via npm)

Means that Appium started successfully. You should pass the command to the test case folder.

For example in Python, I’ll this:

call node C:\Users\User\AppData\Roaming\npm\node_modules\appium\build\lib\main.js --address 0.0.0.0 --port 4723 --no-reset
pytest -s /Desktop/app/tests/test_login.py

i have to steps:

  1. launching Appium by command; call node Appium
  2. Then executing Gradle task: clean test

It’s working perfectly without first step, but when i’m adding first step it’s just rerurns [Appium] Appium REST http interface listener started on 0.0.0.0:4723 and nothing happens

you should append your node command with &

Eg:

call node C:\Users\User\AppData\Roaming\npm\node_modules\appium\build\lib\main.js --address 0.0.0.0 --port 4723 --no-reset &

Why should we add &:
The & makes the command run in the background.

i’ve added this symbol (&) and still nothing happens

Jenkins returns: Appium REST http interface listener started on 0.0.0.0:4723

Gradle Task doesn’t executed.

Can you paste your Jenkins code here. It works perfectly for me:

#!/bin/bash --login -x
appium &

can you try to add a echo ‘hello’ after your node appium line and see if its getting printed?

this doesn’t work:

#!/bin/bash --login -x
appium &

i’ve added echo ‘hello’ - nothing happens

i activate server logs:

getting this info:

2017-11-21 07:38:25:294 - info: [Appium] Welcome to Appium v1.7.1
2017-11-21 07:38:25:378 - info: [Appium] Non-default server args:
2017-11-21 07:38:25:378 - info: [Appium] sessionOverride: true
2017-11-21 07:38:25:379 - info: [Appium] log: C:\appium\appium.log
2017-11-21 07:38:25:448 - info: [Appium] Appium REST http interface listener started on 0.0.0.0:4723

and nothing happens

Not sure why its not running, which option did you chose in ‘Add Build Step’

I use “Invoke Gradle Script” and tasks:

clean
test
–tests
$Test

where $Test is the tests from choice parameter

The steps which I shared are for ‘Invoke Shell’ option.

You can watch this video : https://youtu.be/XsBpqBpEjvg

I am facing the same issue ! Could someone assist me ?