2
votes

Use case: I need to start appium server on CI Jenkins and run tests right after that. Tests don't start because appium server starting in debug mode and doesn't switch to another command. So i have jenkins on Windows machine with the following build steps (as Windows batch command):

  • start /B node path_to_appium_server\appium.js --address 127.0.0.1 --port 4723
  • timeout 10
  • "path_to_tests_runner\vstest.console.exe" "path_to_dll\test.dll" And in this case, my tests cannot started because jenkins terminate first process (with appium).
3

3 Answers

1
votes

Basic issue was with permissions for '*.dll' file which contains tests and which cannot be ran with bat file without 'runas' command (which is waiting for password) from Jenkins. So my Jenkins job contains 3 Build steps:

  • execute Windows batch command

    start node path_to_appium_server\appium.js --address 127.0.0.1 --port 4723

  • Run unit tests with VSTest.console (to get this build option you need install VSTest Runner plugin)

    specify path to dll and command line parameters

  • execute Windows batch command

    taskkill /F /IM node.exe

Second step resolve permission issue for dll file.

0
votes

It depends on how are you starting it. In most situations if on Jenkins you have 2 ways:

  • Start appium and tests in different build "shell execution" steps
  • If you want to do it in the same build step, just start it in a background with "START /B program".
0
votes

Requirement Installed Node.js 0.10 or greater.

At least an appium server instance installed via npm.

using javaclient 3.2.0

AppiumDriverLocalService service =AppiumDriverLocalService.buildDefaultService();

service.start();

service.stop();