How to prepare Test Cases for Mobile App

Mobile App Test Cases

Mobile App Testing : -

Testing the such process where developed mobile apps should work in hand made mobiles such as Functionality wise,Usability and ease of Use.etc

In this post you will learn How to Prepare Test cases for Mobile App

Mobile App test cases are similar to Manual Test Cases writing.Mobile App Test cases should write according to below checklists.

Check Lists:

1.Complete understanding of Requirements
2.Complete proces

HP QC Defect life cycle

HP QC defect life cycle which a defect travels through its lifetime. Bug cycle starts when defect is found and ends if a defect is closed, after confirming it is not reproduced. Defect/Bug life cycle is indicates that the defect/bug found during the testing of Applications.


The Defect Life Cycle has different stages as below

1.New:  When a defect is log and posted for the first time in Test Management tools at that time status of Bug as New.

2.Assigned: Once posted bug by tester will check by the Test lead to approves that the bug is genuine then will assigns the Defect to respective developer and the developer team using Test Management Tool.

3.Open:  At this the developer will get email at that time status is Open in Test Management Tool.

4.Fixed: Developer will fix the defect in coding and after unit testing developer will change the bug status to Fixed,then tester will get a email from Test Management Tool.

5.Retest:  Once the Tester will receive the Email regarding fixed defect then tester will start testing the fixed defect one more time to confirm that fixed defect is working properly with out any problem.

6.Verified:Once the defect is retested then tester will change the fixed defect status to Verified in Test Management Tool.

7.Reopen: Once the retested defect is still exists in application/software then tester will change the status of fixed defect to Re open in Test Management Tool.

8.Closed: If the retested defect got fixed properly and not re producible then Test lead will change the status as Closed in Test Management Tool.

9.Duplicate: This status will use where same bug is logged in Test Management Tool at that time bug status will changes to Duplicate.

10.Rejected: Once the defect is logged or fixed if tester re opens the bug because some errors at that time developer is getting correct response at that time bug status will changes to Rejected.

11.Deferred:This bug status tells that present bug will fix in next releases because with this bug there is no major functionality is impacted at that time bug status will changes to Deferred in Test Management Tool.

Helpful User Define Functions in QTP


User Define Functions


User define functions are used in QTP to create functions for web/desktop application functionalities to create Test scripts.In order to create User define functions Testers should follow the some steps and Syntax.Same as programming language VBScript will allow to create user define functions for repeatable Actions for Applications.

User Defined Function Creation in QTP

Procedure 1:

Public/Private Function Function Name(String 1,......etc)
Statements 1
Statements 2
Statements 3
Statements 4
End Function

Procedure 2:
  • Using Function definition Generator
  • Click on Function definition Generator
  • Enter Name,Parameters
  • Click on OK

Function Library

Function library is a collection of functions which contains Test scripts for Web/Desktop applications.
In order to delete the redundency ,duplication of Test Suite.In order to use function library first of all testers should associate function library to the Test Scripts.

How to Associate Function library file in QTP

Function library file will save in .vbs extesion.Testers can create function file in Notepad/qtp also.
Function library file can be associate using
File-->Settings-->Resources-->Add Associate library file-->Browse the file path.
We can assign library file using : Executablefile "path of the file"

How to use descriptive programming in qtp

Descriptive Programming:

QTP scripts can execute using Test scripts if the objects are present in the Object Repository. Descriptions of the Objects are created using Descriptive programming if Automation testers want to run an operation on an objects which is not display in the Object repository.





Drawbacks of Object Repository:

1.It takes lot of time for identify the objects ,when the object is changing dynamically.
2.If object repository size is increasing then the Test script execution speed will take more time.
3.To prepare Test scripts using object repository then testers should require build.

Descriptive programming means if we specify description of the objects in the Test scripts it self then that programming called as Descriptive programming in HP QTP. Using descriptive programming testers can execute test scripts without any object repository.Automation testers will execute Test scripts in QTP using descriptive programming.

Descriptive programming Advantages:

1.Fast Execution of Test script.
2.Easy to identify the objects.
3.We can prepare Test scripts without using build.

Descriptive programming Dis -Advantages:

It will take more time to prepare Test scripts using descriptive programming.

There are two types in Descriptive program,below are the types

1.Description properties and values in Test scripts
2.Description objects

Description properties and values in Test scripts:

Test script is developed using object properties and values of application in QTP.

Syntax:

Browser("p1:=value","p2:=value").page("p1:=value").object("p1:=value").operation/method

Examples:

Flight Application

Dialog("text:=Login").winedit("attachedtext:=Username").set "rajesh"
Dialog("text:=Login").WinEdit("attachedtext:=Password").set "xxxxxxxx"
Dialog("text:=Login").WinButton("text:=OK").Click
Window(text:=Flight Reservation).Close

Web Application

'Launch Gmail using internet explorer
Systemutil.Run "iexplore.exe","http:\\www.gmail.com" 

'Wait untill browser loads
Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").Sync 

'Enter  Email id in Username Field of Gmail
Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").
WebEdit("name:=Email").set "rajeshchev@gmail.com"

'Enter password in password Field of Gmail
Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").
WebEdit("name:=password").Set "xxxxxxxxxx"

'Click on Sign in Button
Browser("title:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").
WebButton("name:=Sign In").Click

Description Objects:

In order to create Descriptive programming we should create Description for Objects.

Syntax:
Set Object Name = Description.Create
Object Name("Property Name").Value="Property Value"

Examples:

Flight Reservation

'Create Description for Objects
Set dia = Description.Create
Set ana = Description.Create
Set pwd = Description.Create
Set but = Description.Create
Set win = Description.Create
'Create object Names with Properties and Values
dia("text").Value = "Login"
ana("attached text").Value = "Agent Name"
pwd("attached text").Value = "Password"
but("text").Value = "OK"
win("Flight Reservation").Value = "Flight Reservation"

'Launch Flight Application

Systemutil.Run "Path of the application"
Dialog(dia).WinEdit(ana).Set "rajesh"
Dialog(dia).WinEdit(pwd).Set "xxxxxxxx"
Dialog(dia).WinEdit(but).Click
Window(win).Close

Web Application:

Set bro = Description.Create
Set pge = Description.Create
Set sea = Description.Create
Set but = Description.Create
Set bro1 = Description.Create

bro(title).Value = "Google"
pge(title).Value = "Google"
sea(name).Value = "q"
but(name).Value = "Google search"
bro1(title).Value = "Google Search"

Browser(bro).Page(pge).WebEdit(sea).set "Google"
Browser(bro).Page(pge).WebButton(but).Click
Browser(bro1).CloseAllTabs


How to associate Object Repository in QTP

Object repository is save with .tsr extension i.e Shared object repository in HP QTP,We can use three ways to associate shared object repositories in QTP.

Three Ways:

1.Using Associate Repository
2.During Run time
3.Using Action Properties


1.Using Associate Repository:

Please follow below steps to associate object repositories in HP QTP

1.Go to Resources menu
2.Click on Associate Repository
3.Click on Add
4.Select Location of repository file path
3.Click on Open
4.Associate with action
5.Click on OK

2.How to associate Object repository during run time

We can associate object repository during run time with below ,we need to declare at the first step of the test script.

repositoriescollection.add "object repository file path"


3.Using Action Properties:


Please follow below steps to associate object repositories in HP QTP using Action properties

1.Right click on Expert view
2.Select Action
3.Select Action properties
4.Select Associate Repositories
5.Click on Add
6.Select location of the Repository file path
7.Click on Open
8.Click on OK

HP-QTP Object Repository

Object Repository:


Object Repository is a interface between HP QTP test script and The web application.Object Repository having logical naming convention and physical description for the application objects.Object Repository screen displays tree structure of all the application objects in the current action.

Navigation:

Resources Menu -->Object Repository

Types of Object Repositories

There are two types of Object Repository

1.Per Action Object Repository
2.Shared Object Repository

1.Per Action Object Repository

Per Action OR stores application objects that are associated with one specific action.So only that action can access the objects which are in Test scripts using per action object repository

2.Shared Object Repository

Shared Object Repository enables to stores application objects that can accessed by multiple components of application and any number of actions can access the shared object repository.

Object Repository Manager

Object Repository Manager enables to open multiple shared object repositories and modify object repositories as needed.We can open shared object repositories both from file system.

Navigation:

Resources-->Object Repository Manager

Operations Performs:

1.Creating new Object Repositories
2.Open object repositories
3.Save modified object repositories
4.Manipulating objects in shared object repositories
5.Managing repository parameters
6.Performing merge operations

Object Repository Comparison Tool

This tool is used to compare two object repositories in order to verify the objects of applications.


How to count Number of sub folders and print Names

How to get sub folder count and print folder names using below VBScript,In order to count number of subfolders we need to use File System Object(FSO) .Please check the below code(VB Script) to print number of sub folders as well as Count number of Sub folders.



VB Script:

Dim Obj,Obj1,Obj2,Fold_names

Set Obj = CreateObject("Scripting.FileSystemObject")

'Creating a file system object

    Set Obj1 = Obj.GetFolder("D:\Manual_Testing\Manual_Projects")

    Set Obj2 = Obj1.SubFolders

    msgbox Obj2.Count 'displaying count of sub-folders

    For Each Fold_Iteam in Obj2

        Fold_names = Fold_names& Fold_Iteam.name &vbnewline

Next

msgbox Fold_names