Thursday, September 26, 2013

How to perform monkey testing using Shell? (Monkey Testing in Android)

What comes to your mind when you hear the word monkey, Yes it is trouble :D so as tester we always need to think like a monkey while testing to stress the application. Manual Monkey testing mainly concentrates on randomly tapping on the screen without any sequence, using two fingers to tap two different buttons simultaneously, scroll several times in a loop and so on. Looks very monkeyish right :O Do try to think like a monkey while testing :)
But rather than manually executing the monkey test if you could automate it wouldn't it be great? Yes its possible for android applications through terminal. Android has Monkey program which generates a random events like touch, gestures and taps. I use this for stressing android applications and games.

How do you execute monkey test ?

- Open terminal and change directory to platform tools folder 
- Type adb shell (./adb for Mac OS)
- Type monkey -p com.your.package.name -v 5000( You can change values. More the value more the time it runs)
Ex: monkey -p com.zzepod -v 10000
- Observe the screen.

You would see your screen automatically performing touch, gesture and tap operation. If your application doesn't crash after performing this automation then your application is quite stable.

Thursday, September 19, 2013

How do you install an android application through terminal in a Mac system

Installing application

- Open terminal and change directory to platform tools folder 

- Type ./adb devices to check if device is connected.

1) Normal installation type
./adb install .apk (file location)

2) If there are more than 1 devices connected then type
./adb -s (device number) install .apk (file location)
Please note: You can see the device number from ./adb devices

3) If you are connected to emulator and you want to install the apk only to device then type
./adb install -d .apk (file location)
Please note if there are multiple devices connected then an error is displayed.

4) Re-install the application
./adb install -r .apk (file location)

5) Install in sd card instead of internal storage
./adb install -s .apk (file location)

Few other commands which are useful

1) To get log from your device
./adb logcat

2) Uninstall application
./adb uninstall (pacakage_name)

3) Uninstall application without removing data and cache
./adb uninstall -k (pacakage_name)

4) Start server to ensure its running
./adb start-server

5) Kill server if its running
./adb kill-server

Saturday, September 14, 2013

10 things you will hear from an Android developer.

1. Have they completed this feature in iOS
2. Please do not compare our build with iOS.
3. We cannot provide any animation because android doesn't support those animations.
4. You cannot find a single android application without a crash. Nothing is stable.
5. Its not like iOS, we have to support multiple resolutions.
6. No, Its a feature in Android
7. Its a devices issue, we cannot do anything about it.
8. Its a Google developer phone, memory problem.
9. Sorry, we cannot customize anything. Its better to use built-in android things.
10. I hate apple

Thursday, September 12, 2013

Different type of QA.

Listed below are the few types of QA you find in any organization.

Extra active QA
100% active while testing. These kinda QA's would exactly know where, why, when and how the application would crash.

Perspective QA
- Always things about how an end-user would use the application.

Quick QA
- This QA just tests certain main features and gets the build approved.

Verbal QA
- Tests the application and sits with the developer and discusses defects verbally and doesn't log it in the tracker.

High-per active QA
- Doesn't take breaks and always concentrates on breaking the code.

Social QA
- Always socializes with other QA and tries to gain knowledge from other QAs.

Abusive QA
- Doesn't like the product he is testing and always cribs about why he opted testing c.

Lazy QA
- Tests with zero enthusiasm. Run the application for 10 mins and gets involved with some other work.

Semi Active QA
- These kinda QA are good at testing but would be active in certain intervals of time.

Developer's boy QA
- This kind of QA's always inform about the bug to the developer and asks him if he can log it in the tracker.

So which category do you fit?

Saturday, September 7, 2013

In-App purchase for iOS (Old)

You find a game on the app store which is free and your excited to find out that it's free, So you are playing it and after you reach a certain level a pop up comes out informing you to buy the next level. OUCH! Bad thing to happen isn't it :D Those kinda games are called free minimum games. You need to purchase in order to play a further level. So as a QA you need to know everything about In-App purchase. Here you go

There are 5 kinds of purchase types
1. Consumable
2. Non-Consumable
3. Auto-renewable
4. Non-renewable
5. Free

- Consumable purchases are those which could be purchased again and again.
Ex: Coins, Cash. Energy, Lives, etc

- Non-Consumable purchases are those which are purchased once and is applicable to all the registered devices.
Ex: Levels, certain filters in photo and video apps.

- Auto-renewable purchases are those which renew subscriptions automatically.
Ex: Newspapers and Magazines, Monthly Benefits in-game (Adds gold, coins, etc)

- Non-Renewable purchase are those which has subscriptions for example 1 year without renewing for next year
Ex: Annual subscription for Magazines

- Free purchase are like auto-renewable but renews it for free.
Ex: Free contents with Newspapers

Things to remember

- Create a New apple test account to test with In-App purchases in the sandbox environment.
- Do not sign in your test account through settings, sign in through the application/game itself when accessing the purchasable content. If you log-in through setting you cannot purchase the content (**Test environment).

- Make sure that the receipt validation process is used in the application through your server in order to reduce hacks.

- If you have purchasable contents it is better to have it downloaded from a server rather than having it in package binary of the game as its easier for hackers to hack if its in binary.

- A detailed description has to be provided to the user informing about the money getting deducted automatically if its auto-renewable purchases.

- In-App purchase should be an intentional purchase and not accidentally. Apple rejects application which has purchases unintentional.

- Make sure to have a good customized dialog box informing about what content would be obtained if In-App purchase is performed to increase the chance of purchasing.

Test Cases

- Have Restore button in your game/application if it is a Non-consumable product. As user restore he shouldn't be charged with any real money again.

- Pricing information should be shown based on the region-specific currency i.e for Indian users it should be shown in Rupees and not in Dollars.
Note: Make sure the Artwork fits into the given box which shows the pricing information irrespective of region.

- Make sure a No Internet Connection alert is put up when user tries to access the In-App purchasable content.

- Restrict In-App purchase through settings / Disable In-App purchase: Alert should be put up informing about In-App purchase disabled while trying to access the content.

Thursday, September 5, 2013

Things to do when you are bored with testing

1. Change routine
If you follow a routine while testing, change it. Start testing in a different way.

2. Set a goal
Try setting a goal like to find 10 critical bug in the build. This will really help.

3. Motivate yourself
Even if you find a small bug try motivation yourself and praise yourself for finding the bug

4. Write blogs about testing
You know why I started the blog :P As you blog you would know the capability of how good you are in testing

5. Discuss testing strategies with teammates
Best way to learn and to know about how other teammates work.

6. Try understanding technical stuff
Discuss with developer on how he implemented a feature and try breaking the code.

7. Ask for change
If you are really bored with a project ask your manager to put you in some other project or team.

8. Change your company
This sounds a bit crazy but its better to work in some other place if you find your job boring

9. Try automation
Try learning new automation for mobile and web application.

10. Change field
Try learning new programming language and apply for a developers post.

Monday, September 2, 2013

Testing Facebook feature in iOS application. (Old)

Facebook plays an important role in any application or game. It is a medium where you can share about your application or share content of your application. As a tester we have to make sure Facebook feature is tested properly.

Work flow of Facebook in any application is as follows

1) iOS 5.1.1 and below

a) Facebook application not installed.
On tapping share button in application Facebook log in pop up has to be displayed if SDK has been integrated else it should take you to safari web browser. After entering the credentials Facebook would take you to Request for Permission page to ask you if it should allow to access the application. On tapping allow it should open up the share message window where you can share the content If you tap on don't allow it should cancel and take you back to application

Step 1 - Login window

Step 2 - Request Permission for Profile
Step 3 - Requests permission for sharing

3. You can choose with whom you want to share the content of application. Tap on Ok.

4. Share message window would appear. Tap on share and it would get shared in Facebook. 

b) Facebook application installed and not logged in.
On tapping share button in application it should take you to Facebook application. After entering the credentials it should display Request for Permission page to ask you if it should allow to access the application. On tapping allow it should open up the share message window where you can share the content If you tap on don't allow it should cancel and take you back to application

c) If user has logged in to Facebook application and user taps on share content in his application then it should redirect directly to Facebook application to request for permission without asking for login 

d) If user has already allowed sharing content to Facebook then it should take you to Facebook application and should immediately take you back to application to display share message window.

Step 1 : Redirects to Facebook application


Step 2: Permission Page

3.  Redirects to application to display share window. You can see in the screenshot below that eBay uses customized share message window which looks much better than the normal share window of Facebook. 

2) iOS 6.0 and above

a) Do not login to Facebook in settings.
On tapping share button in application it should display a native dialog box informing that you have not logged in to Facebook in settings.

b) Login to Facebook from settings
On tapping share button in application a system dialog box has to be displayed asking you if it can post to your friends on your behalf.
- On tapping OK button share message window would appear and on tapping share, post would get shared to your Facebook timeline.
- On tapping Don't allow device would display an alert which would indicate that in future if you want to share any content from this application You have to enable sharing in Facebook of settings

Step 1: Request for permission.


Step 2: Share window to share the content.


Tap on Dont allow


Useful test cases.

1) Revoke permission of the application through browser and share.
On sharing the content, error message has to be displayed and it should allow to re revoke the permission

- How to revoke permission
Facebook -> Apps -> App Center -> Your apps -> Tap on clear button (x) of the app you want to revoke permission

2) Change facebook password of the user who is already logged in setting
On sharing the content in iOS 6, an alert has to be displayed requesting to enter the password. Tapping on setting should take you to setting screen to enter the new password.

Tap on share - This would display alert displayed in screenshot


Tap on Settings and change password. Return back to application to share the content again.


3) Delete the Facebook account
Error message has to be displayed in message window of Facebook window in iOS 5.

4) Timeout
Sometimes due to slow network it would take lot of time to post the content. A timeout alert has to be displayed if the content doesn't get shared.

5) Disconnect network and then tap on share
No internet connection dialog has to be displayed.

6) In iOS 5.1.1 and below you would get an error in Facebook message window and you will not be able to share any content. This is because of
a) You have revoked the permission and your application is already running.
b) You are not given access to post in Sandbox environment
c) Developer account in which you have created is deleted

7) General
Always have a sign out button in application for iOS 5.1.1 At-least if your Facebook is not responding you can log-out and then try it again.