Using Appium + Selenium + Java test Mobile App.
Appium is an open source tool which can test Mobile App in both Android and IOS. Base on Appium website’s description, it have those benefits: 1. User need not re-compile their App. 2. User can use existing popular language (java, c++ , python, etc. ) to write script. As my opinion , the most advantage of Appium is that if someone already know how to write automation script with Selenium, then use Appium just need several extra steps for system setup, the code of script is similar as before.
I recently got a project for testing our company new mobile App. The mobile web script was done before. It looks a best situation for Appium testing --- I just need to setup system then reuse the code from mobile web testing.
- Follow setup and running guide from Appium website:
Use java as code language, download java jar (from http://appium.io/downloads.html) And put it on test project path.
Other setup and dependence I keep them as same as my selenium web test project before.
Run Appium server in PC. Click android icon
Setup application path (it is test app APK location) ,
Platform Name, version (should be as same as your cellphone version), device name.
Click setup icon.
Remember server address and port. They will be used in test code after.
Connect cellphone to PC with a USB cable. Then click run icon of Appium server.
Running information:
Setup capabilities for AndroidDriver in java project.
Now, setup done.
Try some coding as normal selenium testing, But there are some parts maybe different from selenium test, for example:
- if want to test web-view, use code below before real test code:
- Appium give a tool for X path inspector, but it is not easy to use(for web-view it is total no useful),
I recommend chrome inspect tools: input “Chrome://inspect/” in chrome address field, then choose the app view.