Is this situation familiar to you?
Your group has a server (which is written in Java or C#) with a DB (mySql/SQL Server etc.) and some web services (JSON, SOAP, XMLRPC), a website and an iPhone application (objective C).
You want to automate your testing cycle, you also want to use a CI tool like Jenkins to run nightly regression tests but your QA team does not have the knowledge base to deal with all of the above technologies and you will also need a testing framework that will handle your system testing regardless the coding language.
There are a lot of testing frameworks around to choose from: Jsystem, TestNG, Junit, Robot etc. that can be integrated with all of the popular technologies including CI tools (with the help of our engineers:)), but you already knew that, this blog is about our latest solution in mobile testing using Frank framework.
“Frank allows you to write structured text test/acceptance tests/requirements (using Cucumber) and have them executed against your iOS application.” (http://www.testingwithfrank.com)
“Frank uses a combination of Cucumber and JSON commands that are sent to a server running inside your native application, and leverages UISpec to run the commands. Frank used to require changes to your production code, but that’s got a lot easier with the new static library approach”.
As mentioned above Frank is using JSON communication to control your application and Ruby based framework to run tests from your desktop, we have written a Java library for testing your application that can be integrated in your system tests scenarios and in your CI process.
Sure, it will all work fine as long as you are using the iOS simulator, but some of our clients wanted to run their tests on real devices and also Frank’s user group is filled with questions about using frank with real devices.
After some research here are the steps to run “Frankified” application on your device
Setup frank in the application directory by the command “frank setup”
Add the static resource bundle from “Frank” library that had been created in your application folder to the XCode project manually. (a guide is attached later on this document)
Build frank manually using the following command:
xcodebuild -xcconfig Frank/frankify.xcconfig clean build -arch armv7 -configuration Debug -sdk iphoneos DEPLOYMENT_LOCATION=YES DSTROOT=”</deployment/location/>” FRANK_LIBRARY_SEARCH_PATHS=”\”</application/path>/Frank\””
Install the application manually using Fruitstrap by the following command
./fruitstrap -i <device ID> -b </deployment/location/appName.app>
- Run the application on device by the following command
Instruments -w <device ID> -t “/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/Resources/templates/Activity Monitor.tracetemplate” -D ~/Desktop/instruments.log </deployment/location/appName.app>“
How to add a static bundle
right click on the project root and click “Add files to <project name>”
- add the “frank_static_resources” boundle from Frank library that was created in your project
- go to “build phases” tab in your project target
- drag frank’s bundle into “Copy Bundle Resources” section
- that’s it