Tech Blog updated with solution for latest problems, I encountered with selenium and mobile testing.
I professionally specialize in Calabash IOS & Android, Robotium
there are list of ruby commands that can be used in calabash-android to get pciture from camera and save it
I had this problem running commands from calabash to take pciture, I was able to get past it using these 2 functions
def takePicFromCamera
system('adb shell input keyevent 27') # click take picture button end
# save picture by clicking on save def savePicture system('adb shell input keyevent 21') Page.new.waitFor(2) # waitfor 2 second system('adb shell input keyevent 22') # select save Page.new.waitFor(2) # waitfor 2 second system('adb shell input keyevent 23') # Click save Page.new.waitFor(5) # waitfor 5 second end
Robotium 4.0 has been released with webview support which enables testing of hybrid applications .
Some new functionalities have been added which enables testing of webpage embedded within native app also called as hybrid android application.
new functionalities inculde:
waitForWebElement(By by), clickOnWebElement(WebElement webElement),
enterTextInWebElement(By by, String text), typeTextInWebElement(By by,
String text), clearTextInWebElement(By by), getWebElement(By by, int
index)
This is not an exhaustive explanation for a starter but should suffice some one who knows a bit of robotium,
Please feel free to leave comments below
Steps
Part1: running webview application
Steps
1) Go to github copy project link - https://github.com/tejasv02/Androidwebviewsampleapp.git
2) Import project into eclipse
3) Solve dependency errors
4) Run web view application test as Android application
Part2: Testing webview application
Steps:
1) Go to github and copy project link - https://github.com/tejasv02/Robotium4Webviewtest.git
2) Import project into eclipse
3) Solve dependency errors
4) Run web view application test as Android application
Problems : The import android cannot be resolved
Install plugin for android - https://dl-ssl.google.com/android/eclipse/
set path for Android SDK - Windows -> preferences -> Android
Finally !!!
I did run calabash android to test mobile app with embedded webview using calabash
This tools covers all requirements necessary for mobile application testing project, there are some limitation as all functionalities are not implemented.
Certainly this is the best tool for mobile hybrid application testing (fonemonkey works fine but I am not very happy with that)
I have created a test project that can be downloaded and used to testing sample app, Just to make sure things are fine and installation is OK
Problems
1) when there is this below error
resign application using http://www.troido.de/re-sign.jar java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{sh.calaba.android.test/sh.calaba.instrumentationbac kend.CalabashInstrumentationTestRunner} from pid=549, uid=549 not allowed because package sh.calaba.android.test does not have a signature matching the target com.example.pickerviews2
2) When there are missing libraries search for them and add them to lib folder
Go to properties -> Java Build path -> libraries and remove Error libraries
3) Unable to resolve target 'android-7' PickerViews Unknown Android Target Problem
This means project.properties will have to be updated to android sdk level installed in SDK manager
I have been working in mobile testing close to 5 years and there are different tools that have gone past me.
Latetly I have used Robotium / Eggplant and tried Calabash / Fonemonkey(http://www.gorillalogic.com/) / Monkey runner and couple more.
Mobile Apps testing (not web related testing)
Robotium has given me pretty good results with testing of mobile apps, It can interact very well with apps and can be configured to run with Jenkins build server (other tools also can do that).
Its a very powerful open source tool and has been updated frequently so new functionalities are introduced and errors are correct pretty fast.
Mobile Web testing
Selenium Android driver and Selenium Iphone driver are the unchallenged masters for webtesting.The way Robotium works is pretty similar to selenium but the apps that can be tested is the real difference.
For anyone who has used selenium and has basic knowledge about testing mobile phones it must be a cake walk
Try gorilla logic if you want a record and play back solution
Calabash is BDD focused tool and is available for both Android and Iphone , I have installed and tried it for learning purpose. haven't got it running for Real project.
I am pretty impressed with tool as such.
Eggplant is more of UI based tool and as per my experience its the only best tool available for Android / IOS / Symbian / Blackberry phones. There are loads of problems when it comes to connectivity but for limited set of repeated testcases it yeilds quick results. Sense talk used in Eggplant iss easy to learn.You definitely dont need to have programming knowledge to run the testcases.
Please leave compliments if like my blog or leave comments
I have got this build.xml from one of the sites...
and have customised it a bit to get it working.
${basedir} refers to project directory
I have updated path to suite.xml file in below code I have also added below code to remove existing test output and create each one every time tests are run.
One of the challenges we face while creating test suite is to put common settings into a file and read it from code as and when neccessary. I did struggle a bit so thought sharing this might help any one who encounters similar problem.
Steps:
1) Create a file say in ur src folder or create a new package config and put a file called config.properties
2) From the file where you want to read create a varaiable like
public
static Properties CONFIG = new Properties();
3) Then load the content into it from the file you have created
I installed GIT on my machine all of a sudden my eclipse was dead slow.
I had to over come this problem without unistalling git
After playing with preference found a solution atlast
Windows >Preferences -> Team -> GIT and uncheck these boxes as in the above picture