Run Appium tests on real device when executing from Jenkins

Hi,
our Android app doesn’t support x86 architecture and I want run tests from Jeninks on it . Only solution I see is that I will run them on real device. Do you know if it is possible to run it from jenkins after new android app build file is created ?

Or is there better options ?

Thanks a lot

1 Like

Absolutely.
There’s a variety of ways to do this.

Currently I modify our android build plan to trigger a remote Jenkins Job (upon successful build) that copies the apk into place and starts the appium ui automation.

Saucelabs has a good how to on this:

Let me know if you have any questions.
Thanks!

Thank you very much shermaneric. The link you sent me helped me a bit but my issue is a bit different because I don’t want to run tests locally but on the remote VM for Jenkins - this “jenkins” machine is located out of my country. I have access only to Jenkins website.
I am facing these issues:

  • how to install Appium on Jenkins’s VM ?
  • how to run the Appium server in Jenkins ?
  • tests are not at jenkins. I added them via Source Code Management. Where I can set/defice which tests should be run from the test code ?
  • Is the Android Emulator Plugin only way how to setup new emulator for testing ? Is it possible to create some emulator first and then just loaded it Is it possible to do it when jenkins machine is just VM? I guess attaching real device to Jenkins 's VM is not possible… :smile:

Too many questions… thanks.

1 Like

Hi gabo, good questions hope these answers help:

  1. You install appium on a vm just like you would install appium anywhere else - appium.io should help you here.

  2. A few different ways to go on this. Start appium on your Jenkins vm like you would on your machine. 2 processes: 1 for iOS, 1 for android on separate ports. Of course if you’re up for it there is selenium grid but that’s a whole other level

  3. You can set up your emulators on the remote vm however you like. Just note that if you want to run multiple android emulators simultaneously, youll need to specify separate ports. Up until recently it was impossible to run multiple iOS simulators simultaneously. Facebook looks to have a solution. You can search on this board and online for more info.

Note: you could work this with real devices as well using usb (wifi adb to device I believe is possible - haven’t tried) ultimately, I would think you would have to have some level of physical access to this vm and it’s devices for this method to work

  1. Lastly, you’ll have to change The driver setting in your scripts to the correct server and port. I’m using the ruby cucumber Appium.txt setup, so I would do this in the appium_lib section

  2. As you probably know now, sauce labs is offering a real device cloud as well as Amazon and bit bar. - they can do a lot of this for you if you’re willing to pay :blush:

Good luck!
Eric

1 Like

Thanks for your comprehensve answer !

Hi Gabo, I am new to this and i am trying to integrate appium with jenkins as you are doing. Could you please share / demo on how you did.

In jenkins, I have a job which build android build and one job which run tests. When android job finishes, I copy build artefacts from android job to test job. You can do it via jenkins. When I have installer build located in workspace of test job, I run appium server and execute tests.

Thanks for your reply, I have the test scripts (incl in .jar file) in Git and the appium scripts are written using java. Now, from what i understood, we can checkout the source from jenkins and in build steps i can start appium server, start emulator, then invoke maven command to run tests. Is my understanding correct?
Also, Can i have the appium server installed on my jenkins VM? Could you please let me how you did the configuration set up and libraries/plugins/webdrivers used?
I am completely new to this, please help.

If you are able to run test on your personal machine, then try setup same configuration(appium, adb,…) on Jenkins machine. Then you should be able to run test in same way as on your machine.

Can you provide the list of components/tools/drivers/plugins you used?

  • Git
  • Appium
  • Java
  • Junit
  • Ant

Sorry for too much questioning, can you explain me how are you configuring in jenkins so that it builds test project and run the tests. And where did you install appium ?

hello Anu, did you find any resources that provide a clear setup for Appium-Jenkins integration?