Tuesday 29 May 2012

How to mock location on Android Emulator by using DDMS and KML file

Following are the steps:

1. Create a KML file like:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.x">
  <Placemark>
    <name>GE2ADT</name>
    <description>Attached to the ground. Intelligently places itself
       at the height of the underlying terrain.</description>
        <View><longitude>-88.03482</longitude><latitude>43.04186</latitude><range>750000</range><tilt>0</tilt><heading>0</heading></View><styleUrl>#red</styleUrl><Style><IconStyle><scale>0.3</scale></IconStyle><LineStyle><width>0.22</width></LineStyle></Style> <Point><coordinates>-88.03482,43.04186,0</coordinates></Point>
    </Placemark>
    <Placemark>
    <name>GE2ADT-1</name>
    <description>Attached to the ground. Intelligently places itself
       at the height of the underlying terrain.</description>
        <View><longitude>-88.03963</longitude><latitude>43.02743</latitude><range>750000</range><tilt>0</tilt><heading>0</heading></View><styleUrl>#red</styleUrl><Style><IconStyle><scale>0.3</scale></IconStyle><LineStyle><width>0.22</width></LineStyle></Style> <Point><coordinates>-88.03963,43.02743,0</coordinates></Point>
  </Placemark>
 </kml>

2. Launch the ddms from ...\tools.

3. In the ddms you can see in the left pane that there is no active device shown.

4. Launch you titanium Studio and select the project for which you want to test.

5. Click on run Configurations and in that select 'Google APIs for Android <version>' for 'Android APIs and click Run.

6. Wait for the emulator to start and then start Google Maps on it.

7. Now go to ddms and here now you can see the emulator processes in the left pane.

8. Now in the right pane go to tab 'Emulator Control'.

10. Scroll down and select tab KML.

11. Specify the location of the KML file.

12. In the table below you will the location coordinates uploaded form the KML file.

13. Scroll down little and click on the Play button.

14. Now go to Emulator where you should be able to see you location getting updated on the Google Maps.

Note: for a better idea add 5-6 location (Placemark) in the KML file.

Monday 28 May 2012

The knowledge collection before starting off with testing

For beginners, who are completely new to Mobile Application testing, following are the items of which you should have / gather knowledge about, before you start off:

1. Latest trend in market for android, iOS etc.

2. Analyze business requirements.

3. Study in detail about OS features w.r.t business requirements.

4. Study about the history of the OS and the new trends going to come.

5. Explore a mobile phone - best suited for you need.

6. Prepare a Strategy.

7. Prepare a plan for various versions to be tested.

8. Do the required installation and play with it

Let's get into the details of these items one by one:

1. Latest trend in market for android, iOS etc:

In order to start with Mobile Application testing you need to have the 'complete' knowledge about the OS on which you are going to test your application and even know everything about the trends in market. This helps a lot when you actually start testing the application.
You can start reading about new versions available in market of Android, iOS etc, study about the features that are provided and if required document it at a place for your future reference. For this refer to the android site, Apple site and even a site called GSMarena etc, these have the latest news about the OS, phones etc.
If you have no idea about what android is or iOS is, read about them on Wikipedia, they share all the information like when it evolved, what is it etc.
Am important thing here that you can look for the update list of the OS version as to what all phone models can be updated.

2. Analyze business requirements:

 Once the Requirement is freezed start studying the requirement very thoroughly. In case of Agile, the Requirements keep on changing but that is fine still start reading. Read the requirement to a point where you can visualize the application in your mind and more importantly the ability to answer the question 'What is this application doing and why is it created for a mobile phone?'. Once you get the answer to this question, you have got a good idea about the project.
Here the Best practice is (if possible) ask questions to client about their business requirement like why this OS version? what is the OS commonly preferred by people at your place etc. This will help to get a better insight of the requirements. You can even come up with suggestions if you are confident enough.
Understand the various functionality, flows of the application and if required document it at a place so that you refer to it when you start writing Test Cases. You can also document the questions and answers from the client for your and the team's reference (believe me this helps a lot specially in the initial phases)
I personally always prefer to have as much documentation as possible. 

3. Study in detail about OS features w.r.t business requirements:

When you have got a good knowledge about the above two point then start relating the features with your business requirements. Study about the specifics of the OS in depth and list out the features that will affect the testing of the application
This will help you design your Test cases for 'Cross Platform testing'.
As an example for GPS testing, iOS3, on the dropped pin the current address shows up; such things are useful while testing. You can create a test case around this, that in iOS3 is the updated address showing up on the pin.
The next example  could be of Internet speed, here you can check the response of the application.

4. Study about the history of the OS and the new version going to come:

 Once you have the version on which whole testing is to be done freezed then you can start exploring the range of verions. This is needed as out in the world people may not be having the same OS as you test on, it may and it will vary. So look at the history of the OS version and the coming versions.
Discuss about this with you team lead or client and have a range set for which a smoke testing will be done to see whether the basic functionality work fine. 
The range can be something like few(2) version > current version < next version.
In ideal case testing for a range can;t be possible on the mobile device hence you can test this on Emulator where it is very easy to create the emulators of the specific android / iOS OS version.
Here, if you are testing on multiple OS like android, iOS then do the various version on one OS and on the other use only one OS for testing as it may not possible to test different versions on different OS; when in the initial phases.

5. Explore a mobile phone - best suited for you need:

This needs to be by those who have not used a phone with Android, iOS. This will help you learn about how the OS works, how to transfer files, access apps, upgrade apps, install - uninstall apps, using GPS, Google Maps etc on the phone.
In my case i wasn't very used to an iPhone so in the initial stage I used the phone that the company had, played with it. This made me comfortable with the phone so that when I start my testing I won't have to spend time in understanding iOS or iPhone. 
This is the step where you can tell the PM or TL if you need a smart phone for your testing and that if the phone provided by company is little out dated.
I saw a case where we had to order the latest iPhone 4S as we couldn't scan the bar codes with the set that we had, the camera wasn't so efficient. 
Here you can even upgrade the OS of the phone if it is outdated for the version on which you are going to perform all the testing. 

6. Prepare a Strategy:


Now is the time when you cna document the Test Plan as in the Strategy as you have the raw material ready with you.
In the Strategy mention briefly about the OS, versions that you are going to test on, get it reviewed by the Manager or TL and then you can send it to the client for their inputs.
Be clear about the phone model, the OS version while writing the Strategy because once freezed, these should not be changed, it may give a bad impression on the client.


7. Prepare a plan for various versions to be tested:

Now you can prepare the plan as to how will you test on the different versions and even you can now start creating the Test Scenarios for your testing and put them in different categories for the versions like some will be smoke tested, some will be regressed on a few versions. It would be a good practise to regress all the Test Scenarios on only 1 version at the start.
Also talk to the client about the version, phone model on which that person will test, it will help you while your testing.


8. Do the required installation and play with it:

For the application if there are applications that you need to install and learn, this is the point to do that like not lot of people use Google Earth is their day to day life and hence are not aware of how to use it so in your case if you have to use Google earth and you don't know much about it, start using it. 
It may be possible that you may need to install an '.apk' file for android and for that you will need a File Manager for your phone and you may not have one on your phone, install that and play with it as to how to install '.apk' files. In case of iPhone you may need to have and use iTunes of which mostly people are aware of but if you are not, insall it on your PC / laptop and start playing with it.