How to run Appium scripts ?!

Hello,
I’m starting and fighting to just run the test.

1/ Can I run the test from Android Studio (I do not think so)

2/ Then I define a test case in java, and may be run it from maven.

  • I have a POM.xml file
  • I have the java file
  • I start run ‘mvn test’ nothing

3/ How do I setup the test framework that work with Appium ?

Sorry, but I have read tons of doc but never succeed…

I can explain my architecture, and post code. But please explain me from the beginning, I’m tired to fail with wrong copy/paste/

First, your questions:

  1. Yes.
  2. Yes. I think you are doing something wrongly.
  3. Read on!

If you’ve never set up a testing framework and have no idea where to start then you will have to do a lot of reading/research. There is no way around that, so don’t get discouraged.

This is the best tutorial I’ve found on writing a testing framework with Appium from the ground up:

http://blogs.technet.com/b/antino/archive/2014/09/22/how-to-set-up-a-basic-working-appium-test-environment.aspx

The author has written her tests in C#, so you will need to translate that to Java or whatever language you prefer. You will have to do a lot of work. Come back with specific questions and when you have learned don’t forget to give back.

1 Like

Hello and thank for helping me. I will read carefully the link you provided. But just before, let me give you more precision.

I had a bit of experience (really not much) running some test cases in Android Studio or via CI.

I succeed using expresso or unit test with Junit in an hour, but with appium I see no end.

To come back on my question:

1/ How do you do ? icon ? gradle ? maven ? run configuration ?

2/ I expect my appium test will run on CI (here GreenHouse), so they said they need a POM.xml file to recognize appium test on project.

3/ I will read and re - re - try.

Maybe another simple question that can help me.

Does the Appium project on Android Studio is the same as my Android App Project? (Articles often talk using Eclipse for running test, but you said I can run tests with AS)

Hello, your questions are a bit wide open and don’t all have to do with Appium. I’ll try to answer as best I can.

  1. I don’t know what you mean by ‘icon’. I can’t teach you how to use gradle, you’ll need to read up on that. Same goes for maven, there are plenty of websites out there that you can use to learn these technologies. I’m not sure what you mean by, ‘run configuration’.
  2. Yes, you can run Appium on CI. I have no experience with Greenhouse, but I’m sure it can be done. The POM.xml is a maven thing, so you should start reading up on that.
  3. Cool.

Seems like you have a lot of work ahead. I wish you luck.

The Appium project should be a different project than your app project. However, both can be created and maintained using Android Studio. You could also run with Eclipse, but there is definitely and advantage to using the same IDE for both, especially if it’s one you know well.

The IDE is just a tool. If you read an article that specifies Eclipse, you just need to adjust the instructions to fit the tool you’d like to use. You could write the tests using vi and run the tests from the command line. All these are valid scenarios.

Hi Wreed,

I mean by “icon” an “icon” of the Android Studio Idea, no command line.
I mean by configuration “Run/Debug Configuration” menu, where you can either define an “Android Application” configuration or “Android Test” Configuration.

Ok, I’m not familiar with that. Hopefully someone else can answer that question.

Ok, this I understand. This is one reason you want the projects to be different, each has it’s own Run/Debug Config. Eclipse does this too. Any good IDE should have this mechanism.