Monday 3 April 2017

Monkey Talk-Mobile Application Automation Tool for Android and iOS

Subscribe to my youtube channel for more videos here:


Read about Mobile push notification here: push-notification-for-native-application.html

                            [Monkey Talk]


[Mobile Application Automation Tool]




Monkey
Mobile App quality is an important factor for good user experience read here we will see about monkey talk automation tool how we can achieve it, for non-functional tip read here here

About Monkey Talk?

Monkey Talk is open source Automation tool for Android and iOS. MonkeyTalk is a simple-to-use tool. It automates real, functional interactive tests for iOS, Android, Web/HTML5, Hybrid and Flex apps. This open source tool can be used for simple ‘smoke tests’ or for ‘data-driven test’ suites.





Why MonkeyTalk?

Native, mobile, and hybrid app, real devices or simulators. Moreover, automation saves time, it is reusable, repeatable and so on. Monkey talk is an open source automation tool. It supports both Android and iPhone. It is very easy to learn and it's a powerful functional testing tool.

Requirement to start testing with MonkeyTalk: Brief Overview

•   Download and install Java
•   Download MonkeyTalk Pro
•   Need Eclipse or Android Studio to configure the source code
•   In order to record the script with MonkeyTalk, we need to configure the build with some dependencies.
•   The major component which is used for MonkeyTalk is MonkeyTalkAgent. Any build including Android or iOS need to be integrated with MonkeyTalk, otherwise, the tool will not able to recognize the elements of the app. As a result, we cannot record or run the script on our test app. The build which is integrated with MonkeyTalkAgent is called as Instrumented build.
Instrumentation can be done in 2 ways as follows:
•   MonkeyTalkPro provides an inbuilt feature to instrument the build, which injects MonkeyTalkAgent to the built.
Otherwise, we can manually integrate the MonkeyTalkAgent by configuring the source code using eclipse or AndroidStudio before deploying the build.
•   Before we start configuring the source code, we need to install “AspectJ” plugin in eclipse. Once the plugin is installed, open our project source code in eclipse.
Steps to instrument the Android build using eclipse as follows:

Configuring Monkeytalk with Eclispe  
In order to start with Mobile App testing, there are some pre-requisites software/packages which we need to install/unzip on machine.

Pre-requisites:

•   Eclipse setup

•   Android SDK setup

•   ADT Plug-in for Eclipse

•   Monkey Talk Tool (Testing tool for Mobile Apps Testing)

•   AJDT (for AspectJ conversion)

Eclipse:

Download Eclipse from URL:

http://www.eclipse.org/downloads/

Version: Eclipse Classic 3.7.2 (Windows 32 Bit)

No need to install the Eclipse, just unzip the downloaded folder anywhere in local drive. That will provide the ‘eclipse.exe’ which will open the Eclipse framework.

On opening the Eclipse framework, it will ask for the location of ‘workspace’ folder (‘Workspace’ is the location where the entire Eclipse project will be saved). Make any workspace folder anywhere in your machine and give the location.

Now Eclipse has successfully configured. Now we can open Eclipse, write any program and can save program to workspace folder.

Android SDK setup:

We need to setup and configure Android with Eclipse. Basically it is for development process but in case if we need to check how’s the application behave we can have a look on such the application in eclipse.

Download Android-sdk-windows (android-sdk_r18-windows) from the following URL:

http://developer.android.com/sdk/index.html

No need to install the Android, just unzip the downloaded folder (android-sdk_r18-windows) anywhere in local drive. That will provide the ‘SDK Manager.exe’ (which will open the Android SDK Manager) and ‘AVD Manager.exe’ (which will open the AVD Manager).

a ) SDK Manager: used for installing the Android packages

Run the ‘SDK Manager.exe’ (can be found in the ‘android-sdk-windows’ folder)
Android SDK manager will provide the list of package to install
Install any of the package (like Android 4.0.3 (API 15))
b) AVD Manager: used for creating the Virtual Device (emulator)

•Run the ‘AVD Manager.exe’ (can be found in the ‘android-sdk-windows’ folder)

•‘Android Virtual Device Manager’ window will be open.

•Click on New> and follow the steps as shown in below screenshot:

Name: name of Virtual device (or emulator

Target: version of Android emulator which you are going to use

CPU/ABI: for Android, use ARM

SD Card ‘Size’: it could be 512MB or 1GB

Snapshot: checked (best practice) [It will keep the track if any activity killed or process crashed, if its enabled we can restore the session ]

Skin ‘Built-in’: HVGA (for Android)

Click on ‘CreateAVD’. It will create the AVD which will be seen in ‘Android Virtual Device Manager’ under ‘AVD Name’ section.

Select the AVD name and click on ‘Start’. ‘Launch Option’ pop-up will be open. Then click on ‘Launch’.  It will open the Android emulator.

ADT plug-in for Eclipse:

ADT plug-in extends the capabilities of Eclipse to let you quickly set up new Android projects, build an app UI, debug your app, and export signed (or unsigned) app packages (APKs) for distribution.

To install ADT plug-in:

• Start Eclipse> Help > Install New Software….

• Click Add, in the top-right corner.

• In the Add Repository dialog that appears, enter “ADT Plug-in” for the Name and the following URL for the Location:

•  https://dl-ssl.google.com/android/eclipse/

• Click OK

Restart the Eclipse. It will ask for the Android SDK (which is we have already install as above mentioned steps) so Just give the location of Android SDK path.

Now while looking on the Eclipse, TWO newly added icons will be shown.

These TWO icons are for ‘AVD Manager’ and ‘Android SDK Manager’.

Now Eclipse is configured with Android SDK.

Monkey Talk:

Monkey Talk can be downloading from the below address:

http://www.gorillalogic.com/testing-tools/monkeytalk/download

Pre-requisit for installing Monkey Talk Agent:

For installing the Monkey Talk Android Agent, first we need to convert Android project into AspectJ.

For doing so, we need to configure AJDT in Eclipse by following steps:

Eclipse> Help> Install New Software > Click on Add…

In ‘Add Repository’ popup:

Name: AJDT

Location: http://download.eclipse.org/tools/ajdt/37/update

Click Ok. It will configure the AJDT with Eclipse.

Steps to convert source code into Aspect J code



Step 1: Convert your Android project to AspectJ by right click the project name and select as follows.


Step 2: MonkeyTalk-agent.jar can be found in the “agents” folder in the MonkeyTalk package you downloaded earlier. The exact name of the jar might vary depending on the version, but it should always start with “MonkeyTalkagent”.

Step 3: Create a “libs” folder in your Android project, if you don’t already have one and Copy the monkeytalk-agent.jar into the libs folder.



Step 4: Right click on MonkeyTalk-agent.jar→ AspectJ Tools→ Add to Aspectpath.



Step 5: Update your AndroidManifest.xml to include the following two permissions:




Step 6: Update the project properties (right-click on the project→ Properties→ Java Build Path), select the Order and Export tab, and check the checkbox next to the AspectJ Runtime Library to export it:




Step 7: Deploy your application to an Android device or emulator. As a result, you will find the instrumented apk in project’s bin folder. By using that apk, we now start the test with MonkeyTalkIDE. (For Video tutorial Click here).

Step to be followed to create a test in MonkeyTalkIDE as follows:

Step 1: Create new TestProject by selecting (File→ New→ Project→ General→ Project). Enter the Project name (eg. MyProject) and click finish.

Step 2: Now add Test to the project by right click on the project and select (New→ Script). Enter the name for the test (MyTest) and select the project to which it needs to be added. Now open the test file which we created (say “http://MyTest.mt”)



Step 3: Now we have to import the instrumented apk which we already created, by selecting menu (App→ Select a .apk file to test) or using toolbar as below:



Step 4: After adding apk, Choose any of the connected device or emulators to test.


Once the device is selected the console below will show the message like this:


Step 5: Now install that apk in the selected device as follows:




Step 6: Now launch the app in connected device as follows:



Note: Once again click on connect device, as a result the record and playback button will be enabled to start the test.

Step 7: Now we can start recording by click on record button.

Whatever we work on the test app will be recorded by monkeytalk and generate the test script as follows:

Our test script can be view and edit in 3 ways as follows:
Table view
Monkey talk Script
JavaScript




Step 8: Once the recording is done. Click on Stop button and click Play button to view the playback of the script. (Before clicking on Play button, relaunch the application is recommendable).

Step 9: To do a complete test on our test app, we have to add some verify commands if needed.

Step 10: Test result can be viewed in the console window.

Advantages of Monkeytalk:

Open source Tool
Provide Record and Playback
Support both Android and iOS
Support Cross platform recording
Easy Readable Test script
Support Gestures


Reference: Google and Quora

Tuesday 14 March 2017

Testing Beacon based Mobile Applications

Read about mobile application security testing with MobSF here: Mobile Application Penetration Testing with MobSF

What are Beacons?



Beacons are a small transmitter that Emits Bluetooth Low Energy (BLE).It transmits a signal which can be used to communicate with other devices. It works with Bluetooth activated devices and they should be within the range.

Types of Beacon:

1. Eddystone:-It is a BLE devices developed by Google to communicate with smartphone, Tablets, and other IoT based devices
2. iBeacon:-It is a BLE device developed by Apple to communicate with smartphone, Tablets and other IOT based devices

How does beacon work’s with other Devices and IoT

Eddystone used the following to communicate:-


1. Eddystone-UID: An opaque unique ID.
2. Eddystone-URL: A compressed URL that, once parsed and decompressed, is directly usable by the client.
3. Eddystone-TLM: A block of telemetry information containing beacon status and runtime values.

iBeacon uses the following to communicate:-

1. UUID: B9407F30-F5F8-466E-AFF9-25556B57FE6D it is a Unique Identifier
2. Major ID: 1
3. Minor ID: 2 

Use case of Beacon based application

Suppose you are a customer of one of the reputed 5 Hotel star hotel.
 How you will feel when someone greets you at the reception with your name without asking your name on arrival.
 You are being virtually assisted in your room without an attendant.
 You are near a Bar and get a notification to visit there with a 25% discount especially for you
 You are not sure which is the nearest pool to go for but get a prompt reply from the admin team about it

To provide all these services we can use Beacons based applications on Android and iOS devices.

Suppose we have been provided with the application by developers we need to take care of the following Test cases:

1. The application should work with all supported devices
2.Apk and.Ipa file should successfully be installed on every device
3. Verify that when the customer enters within the hotel range then Front desk should get a message With the name and estimated time of arrival
4. When the customer opens the application to see in house map of the hotel he should clearly see it in order to route to the room
5. When the customer is near a Pub or Bar he should get notified about the deal of 25% of especially for him.
6. When the customer searches for the nearest swimming pool he should be routed to the correct area
7. Verify that if customer moves out of the BLE range then he should not be able to use the service since he is not in range
8. Verify the minimum distance is correct when we are in the hotel area I.e. the distance supported by beacon
9. The data shown by the iOS and Android devices should be accurate.
10. Does it show the relevant result on low data I.e 2g and 3g
11. Verify if we use the same Application in a different branch of the hotel then it should not work

Beacons drain the battery of the device fast and some time is not too accurate 

Wednesday 1 March 2017

Giving Estimation using Story Point

What is Estimation in Agile:-

How much time/effort is going to be taken to do a particular task or requirement Viz User Stories is known as Estimations.
Estimation is a very tricky task.A wrong estimated User Story can defeat the purpose of delivering any working project.

Who all are involved in estimation:-

Different stakeholders such as Product Owner, Developers, QA, UI/UX designer, and other higher management can estimate their effort in sprint planning once the backlog has been prioritized by the Product Owner requirement/story has been groomed.

Estimation Difference within Member’s, Why??

We cannot deny the fact that every member will have different estimations.
This is because every member is taking their individual effort recounting their past experiences or by self instinct that how much time they will take to do that task.
Something may take time for the developer to implement but the same thing can be easy to test for Testers. The same goes for UI/UX designers.

How to estimate a user story from a QA perspective??

Let’s say we have any user story like sorting the price of flights and the Acceptance Criteria as below:-

As a traveler, I can sort flight having price from low currency to high currency.




Acceptance Criteria

i. The flight search should be in ascending order
ii. When no flight available display the message “Please search using different combination”
iii. If two flights are having the same price search then display the flight in alphabetic order

Estimating the above story using story points:-

When we are estimating any story using story points we are using a judgmental approach and define the complexity of the story rather than manual effort in days.
The judgmental effort are done using some progression formula like Fibonacci-like format: 0, 0.5, 1, 2, 3, 5, 8, 13, 20, 40, 100.

We can use https://www.planningpoker.com/ to estimates our user story which is interactive and easy. Let us suppose the team after the meeting came to the conclusion that the above story is of 5 Story points

Now to estimate the above story as a QA I would take into consideration the following point.

1) As per acceptance criteria, I will write the test case and upload it on Test Management Tool “1 Hour”.
2) To test the whole according to AC I will take another one “1 Hour”.
3) To test on 4 different browsers like Chrome, Firefox, IE 10, and Safari “15 Minutes” each which counts 15*4= 1 Hour.
4) If the change is reflected on webview of Android and iOS application then “15 Minutes” to install the build on each OS and “15 Minutes” each to verify the functionality on each OS. The time will increase if the devices list will increase. Therefor 15 Minutes*4= 1 Hour
5) Now adding 1 Hour to the total estimated task.
There fore total time taken is 1H+1H+1H+1H+1H=5Hours

Wednesday 4 January 2017

5 Incredible handy key points while testing "Mobile Application"



When it comes to Mobile Application Testing most of the QA's aren't aware where to start from.They just jump straight into the application and start functional testing.But wait there are much more to do before we start exploring bugs.

Improving Mobile Application Testing Process & Coverage!HOW?

How to figure it out that application has been tested at it's best and certain guideline has been followed and nothing is missed:-
  1. Use mnemonics like- I Sliced Up FunLong Fun CUP and Cop Flung Gun.
  2. To visually organize information for mobile Application use Mind Map's like -Ministry of Testing and Test Insane.
Here are 5 key points to be kept in mind that we should know before we are ready to move the application in UAT
  1. Picking Application from background-Is your App smart enough to judge itself what to do when we are picking them up from the background of the "OS".Yes, a badly coded app doesn't behave well when we launch them from the background and they start hanging the device's/Application altogether.
  2. Screen Orientation-Most of the app which does not support screen orientation are likely to Crash or have a memory leak when we are we are using them in the orientation they do not support either portrait or Landscape.
  3. Touch Gesture-iOS or Android if the application is supporting multiple touch gesture where only one event can be fired at a particular instance the application is going to crash.
  4. Performance-Performance of the application with respect to your competitor is a must check.Is it having better UI, Performance or Usability.
  5. Network Testing-The application on flight mode or no network mode is definitely going to give Dev's some hiccups.Be sure that proper validation is available in every negative instance/steps or scenarios.
Moreover, the tester should keep in my that the application should not crash even in the corner scenarios because a single situation of the application getting crash will make you lose multiple lovely users.
In the end, would like to Quote “It’s more about good enough than it is about right or wrong.” – James Bach So just go and make your mobile application good enough.

Interview Experience with AMAZON for the role of Quality Assurance Tester

This role was for Digital/ IoT/Mobile Application based testing :)  Amazon is a dream company and everyone wants to work for that company a...

Popular Posts