Friday, January 31, 2014

Inspecting IOS elements and recording tests using Appium on Simulator

1.Download & Install the GUI version of Appium server(check appium.io)
2.Open the Appium server. You should see some thing like below




















3. We would be inspecting the IOS element using this GUI version of appium
4. Check the flag AppPath an provide the path to your .app(you can find the path from Xcode)
Ex: The path I provided here is '/Users/kiran/Library/Developer/Xcode/DerivedData/UICatalog-fqsvdhmisheuvqbsuomezsujnqgi/Build/Products/Debug-iphonesimulator/UICatalog.app'
5.Ensure you pick the .app path which is in 'Debug-iphonesimulator' folder and not 'Debug-iphoneos folder (when you run the UICatalog code on a real device from Xcode, the .app will be created in 'Debug-iphoneos).
6.Now click on 'Launch' button to start the appium server.
7.Click on 'i' button to launch the IOS inspector
8.Check the below video to see how to inspect elements on IOS simulator and record the tests

You can even play back  the tests with in the appium recorder
Check the following video link to have a glance on how to inspect and record
https://www.youtube.com/watch?v=BNgFixhS_AM&feature=youtu.be

You can run your tests either starting the appium from GUI mode or from terminal mode.
Now lets c how to run the tests when appium is launched from terminal
Stop the GUI mode appium server
open the terminal and type the command appium &. This will launch the appium server on default port 4723


Thursday, January 9, 2014

Inspecting IOS elements using Appium Inspector for .app file

  1. Launch the appium Server (GUI version)
  2. You need to setup additional Parameters using to run the tests on Real Devices
  3. Choose the app path. Here you need to choose from Xcode iphoneos folder as mentioned in one of my previous blog ex: /Users/kiran/Library/Developer/Xcode/DerivedData/UICatalog-fqsvdhmisheuvqbsuomezsujnqgi/Build/Products/Debug-iphoneos/UICatalog.app
  4. Check the option UDID. UDID is the device ID. You can find it from Xcode Organiser.
  5. Open xcode. Open organiser which is on top right of your Xcode
  6. Select you device in the left list of the organiser
  7. You should be able to see the device information
  8. Here Identifier is the UDID.
  9. provide this is identifier in the appium server option UDID
  10. Select option Force Device with selected option as iPhone
  11. Select option BundleID. This is the application bundle id. To find this Id follow the below screenshot
  1. I used Iphone configuration utility(freeware) to find the app bundle path. Google it and your should be able to find the download references
  2. Open the Iphone config utility, Under Application you should be able to see the app bundle id. In this case, 'com.yourcompany.UICatalog'. Set this to the appium server option 'BundleID'
  1. Start the appium server
  2. Click on Inspector Icon
  3. You should see your Iphone Screen in the Inspector



Sunday, December 1, 2013

Prerequisites for running Tests On Real Devices

For Running tests on Real Devices (using .app file) You will need the following setup

  • Apple Developer profile
  • UDID of the Device(Iphone)
  • Application(.app) bundle ID
  • Your .app should be signed with valid provisioning profile
  • You have to build the rebuild .app file with your profile and should be able to deploy this .app from Xcode on your device.


For Running tests on Real Devices (using .ipa file) You will need the following Setup

  • Apple Developer profile
  • UDID of the Device(Iphone)
  • Application(.IPA) bundle ID
  • Your .Ipa file should be signed with valid developer provisioning profile
  • Since .Ipa file is an installation file you will need to have third party library called libimobile device. Appium internally uses the libimobile device.nstall .Ipa files on the real devices.
  • Download the source as zip (option provided on the bottom right of the page) from the following linkhttps://github.com/libimobiledevice/libimobiledevice
  • To be continued.....

Create Appium tests targetting IOS Simulator

Creating Tests for your simulator
1. Install the . app file on your Xcode simulator




















2.Get the .App path
3.You need to have selenium libraries to write the appium tests as appium used the Web driver interface
4.Open eclipse and write the following code. As same as your selenium web driver web tests
5.Start your appium from terminal using appium &

Note: Object id's that i have used in the below snapshot might be different for UICatelog application. please change them accordingly


Setting up Appium Server

Go to http://appium.io/ and download appium server. You have couple of option which appium to download
1. appium UI
2. appium nodeJs

I prefer nodeJs as I can launch it directly from code through command line terminal. However some times I use the UI version to inspect the elements. You can even launch the Inspector from terminal, hmm need to figure out and would be posting soon.

To work with appium on ease,I would recommend you to have your own MAC laptop with SDK 6. SDK 7 should also be fine but preferebly SDK 6 is recommended.

Setup.
1. Open up your mac terminal
2. Type the command sudo npm install -g appium

3.You should see appium getting downloaded and installedThat's it. What's next?1.You should have your Sample IOS app '.app'2. Get xCode 4.6 installed
3.Download the sample app source code from the URL
4. Open the code in xCode and build and run the app on Simulator. Good now you have your .app file built in project's product folder. Get the path of the app and note it some where (Check the below Image)


Next? Setting up your appium server to run your tests. Initially we will see how to setup appium server for Simulator tests.
1.Open the terminal and just run the command appium &
2.You should see the messages in the terminal that appium server is started on port 4723. This is the default port and can be customized later.
3.All set to run your tests.

IOS Native App Automation

Friends, It been long time since I have written my last blog. In this blog i'm putting my experiences using appium automation tool for IOS Native App Automation

Appium is one of the automation tool and seems to be promising in automation of IOS Native Apps. Initially, I started the evaluation with couple of open source tools appium and IOS Driver. Appium is the one, that is more active with stable & New releases.

Appium is the only tool that does not require any IOS instrumentation. It does it automatically

Some advantages listed out below
1.Supports Wedriver Interface API to write your tests in Java,Ruby....
2.Support all kinds of User Interactions like swipe (Single and multiple fingers),tap, longPress, Alerts,Picker wheel , switches and many more.
3.Runs tests on both Emulator and Real Devices.
4.Supports xPaths.
5.Comes with Object Inspector and Recoder. You need not run behind on how to inspect elements
6.Need not have reference to IOS app source code
7.Can run tests using .app or .Ipa files

Setting up Appium is little tricky as you don't get proper documentation.Initially you would end up in lots of appium server errors. However, it is very simple and just one step setup of Appium