UFT Tutorial 12 - Parameterization Part-2 and Environment Variables



UFT Tutorial 12 - Parameterization Part-2, Environment Variables

Usage of Data Table:

1) Enter Test Data directly in to Data Table and connect to the Test.

2) Import Test data from files (Excel/Text) and connect to the Test.

If you want to import test data from a text file, there are 2 syntax rules,

i) Data Table considers Text file first line as column headers

ii) Tab space is the delimiter between two fields
-----------------------
If you want to import test data from an excel file,

Data Table considers Excel sheet first row as column headers.
------------------------------------
3) Import Test data from a database and connect to the Test.

Steps:

i) Create a Database

ii) Create Tables

iii) Enter Test Data
----------
iv) Create DSN (Data Source Name)

v) Fetch Test data using SQL commands.
-----------------------------
4) Data driven Testing using Data Table methods and programmatic statements

'Create new sheet in Run-time Data Table
DataTable.AddSheet "Login"
'Import data from an external file
DataTable.ImportSheet "C:\Users\G C REDDY\Desktop\Input.xlsx", 1, 3
RowCount = DataTable.GetSheet("Login").GetRowCount
Msgbox RowCount
For i = 2 To RowCount Step 2
DataTable.SetCurrentRow(i)      
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\Flights Application\FlightsGUI.exe"
WpfWindow("HP MyFlight Sample Application").WpfEdit("agentName").Set DataTable("Agent", "Login")
WpfWindow("HP MyFlight Sample Application").WpfEdit("password").Set DataTable("Password", "Login")
wait 2
WpfWindow("HP MyFlight Sample Application").WpfButton("OK").Click
WpfWindow("HP MyFlight Sample Application").Close
Next
---------------------------------------
Environment Variables

What are Environment variables?

Environment variables are global variables depends on local system operating environment.

Purpose of Environment variables

                Centralized maintenance of variables
                Tests Portability

Types of Environment variables

                Built-in Variables
                User Defined Variables

Create Environment (User defined) variables

Associate Environment variables file to UFT

Access Environment variables
Syntax:

Environment("variableName")

Example:

Msgbox Environment("OS")
Msgbox Environment("ProductDir")
-----------
Edit Environment variables

Delete Environment variables
----------------------------------------
Example:
Environment.LoadFromFile "C:\Users\G C REDDY\Desktop\abcd.xml"
SystemUtil.Run Environment("AppPath")
WpfWindow("HP MyFlight Sample Application").WpfEdit("agentName").Set Environment("Agent")
WpfWindow("HP MyFlight Sample Application").WpfEdit("password").Set Environment("Password")
wait 2
WpfWindow("HP MyFlight Sample Application").WpfButton("OK").Click
WpfWindow("HP MyFlight Sample Application").Close
-------------------------------------------------------
'Load Shared object Repository file at Run-time
RepositoriesCollection.Add "Path of the Shared Repository file"

'Load Function Library file at Run-time
ExecuteFile "Path of the Function Library file"

'Load Environment Variables file at Run-time
Environment.LoadFromFile "path of the Environment variables file"
--------------------------------------------

UFT Tutorial 11 - Enhancing Tests Part-1

UFT Tutorial 11 - Enhancing Tests Part-1

1) Overview of Test Automation

2) UFT Test Process

3) VBScript for UFT

4) UFT Test Process
    Generating basic Tests
        Record and Run Tests
        Pre-requisites to create Tests
        Types of Objects in UFT
        Object Repository
        Keyword driven methodology
        Types of steps in UFT Test
        Descriptive Programming
        UFT Test Methods
---------------------------------
Enhancing Tests
----------------
Inserting Transaction points (Start and End)
-----------------------------

Using Transaction points we can measure Test Transaction time.

We can measure entire Test transaction time as well as partial test transaction time.

Services Utility object for inserting transaction points.

Syntax:

Services.StartTransaction "Transaction Name"
Steps
----------
----------
--------
Servies.EndTransaction "Transaction Name"

Example:
                                                                                                                                                   
Services.StartTransaction "abcd"
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\Flights Application\FlightsGUI.exe","","C:\Program Files\HP\Unified Functional Testing\samples\Flights Application\",""
WpfWindow("HP MyFlight Sample Application").WpfEdit("agentName").Set "john"
WpfWindow("HP MyFlight Sample Application").WpfEdit("password").SetSecure "566b834a207a21d896da"
WpfWindow("HP MyFlight Sample Application").WpfButton("OK").Click
Services.StartTransaction "Insert Order"
WpfWindow("HP MyFlight Sample Application").WpfComboBox("fromCity").Select "Denver"
WpfWindow("HP MyFlight Sample Application").WpfComboBox("toCity").Select "Frankfurt"
WpfWindow("HP MyFlight Sample Application").WpfImage("WpfImage_3").Click 7,8
WpfWindow("HP MyFlight Sample Application").WpfCalendar("Su").SetDate "14-Dec-2015"
WpfWindow("HP MyFlight Sample Application").WpfComboBox("Class").Select "Business"
WpfWindow("HP MyFlight Sample Application").WpfComboBox("numOfTickets").Select "3"
WpfWindow("HP MyFlight Sample Application").WpfButton("FIND FLIGHTS").Click
WpfWindow("HP MyFlight Sample Application").WpfTable("flightsDataGrid").SelectCell 3,0
WpfWindow("HP MyFlight Sample Application").Move 59,25
WpfWindow("HP MyFlight Sample Application").WpfButton("SELECT FLIGHT").Click
WpfWindow("HP MyFlight Sample Application").WpfEdit("passengerName").Set "abcd"
WpfWindow("HP MyFlight Sample Application").WpfButton("ORDER").Click
WpfWindow("HP MyFlight Sample Application").Close
Services.EndTransaction "Insert Order"
Services.EndTransaction "abcd"
--------------------------------------------
Functional Test Result Analysis        Vs. Performance Test Result Analysis
----------------------------------------------------------------------------
Input: 3, 5                Login Functionality for 1000 concurrent users within 3 seconds
Addition Operation
Expected = 8                Factors to consider for Performance Testing
Actual =                AUT
                    Server response
                    Network Communicators etc...
-------------------------------------------------------------
VBScript built-in Function - Timer

It returns time in seconds that have elapsed since 12:00 AM Midnight based on local system time.

Usage:                   
---------
Variable1 = Timer (3600)
Statements/Steps
----------------
---------------
------------
Variable2 = Timer (3618)
Msgbox Variable2 - Variable1 (18)
-------------------------------------
Example:

Start_Transaction = Timer
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\Flights Application\FlightsGUI.exe"
WpfWindow("HP MyFlight Sample Application").WpfEdit("agentName").Set "john"
WpfWindow("HP MyFlight Sample Application").WpfEdit("password").SetSecure "566b834a207a21d896da"
WpfWindow("HP MyFlight Sample Application").WpfButton("OK").Click
WpfWindow("HP MyFlight Sample Application").WpfComboBox("fromCity").Select "Denver"
WpfWindow("HP MyFlight Sample Application").WpfComboBox("toCity").Select "Frankfurt"
WpfWindow("HP MyFlight Sample Application").WpfImage("WpfImage_3").Click 7,8
WpfWindow("HP MyFlight Sample Application").WpfCalendar("Su").SetDate "14-Dec-2015"
WpfWindow("HP MyFlight Sample Application").WpfComboBox("Class").Select "Business"
WpfWindow("HP MyFlight Sample Application").WpfComboBox("numOfTickets").Select "3"
WpfWindow("HP MyFlight Sample Application").WpfButton("FIND FLIGHTS").Click
WpfWindow("HP MyFlight Sample Application").WpfTable("flightsDataGrid").SelectCell 3,0
WpfWindow("HP MyFlight Sample Application").Move 59,25
WpfWindow("HP MyFlight Sample Application").WpfButton("SELECT FLIGHT").Click
WpfWindow("HP MyFlight Sample Application").WpfEdit("passengerName").Set "abcd"
WpfWindow("HP MyFlight Sample Application").WpfButton("ORDER").Click
WpfWindow("HP MyFlight Sample Application").Close
End_Transaction =Timer
Transaction_Time = End_Transaction - Start_Transaction
Msgbox Transaction_Time
Reporter.ReportEvent 2, "Res1", "Transaction Time is: " & Transaction_Time
---------------------------------
Define Test Result:
-------------------
> UFT provides Test Result for every test iteration if we use UFT tool features (checkpoints, Output values, Transaction points etc...)

> If we use our own logic (VBScript features) then we need to define Test result.

How TO Define Test result?

Using Reporter Utility object.

Example:

Reporter.ReportEvent 2, "Res1", "Transaction Time is: " & Transaction_Time

Reporter - It is an Utility Object

ReportEvent -Method / Operation

2 - Result Status

    Either 0 or micPass for Pass Status
    Either 1 or micFail for Fail Status
    Either 2 or micDone for Done Status
    Either 3 or micWarning for Warning Status

"Res1" -Result Step Name

"Transaction Time is: " - Details

& -concatenation Operator

Transaction_Time - It is a Variable
-------------------------------------------
Parameterization
----------------
What is Parameterization?

Replacing constant (Fixed) values using parameters is called Parameterization.

Purpose of Parameterization
    To pass single value
    To pass multiple values

What is Data driven Testing?

Testing the same functionality using multiple sets of Test data.

Why Data driven Testing?

Positive and Negative Testing.

Relation between Parameterization and Data Driven Testing?

We use Parameterization feature in Data Driven Testing.

For Data driven testing we pass multiple values only.

Either Passing single value or passing multiple values is called Parameterization.

How to Parameterize?

We can use either variables or Constants or Function Arguments or Environment variables or Data Table parameters or Action parameters or Dictionary keys as Parameters.

Ways of Parameterization
-----------------------------
i) Dynamic submission of Test data:

For i = 1 To 3 Step 1
Agent = InputBox("Enter Agent Name")
Password =InputBox("Password")
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\Flights Application\FlightsGUI.exe","","C:\Program Files\HP\Unified Functional Testing\samples\Flights Application\",""
WpfWindow("HP MyFlight Sample Application").WpfEdit("agentName").Set Agent
WpfWindow("HP MyFlight Sample Application").WpfEdit("password").Set Password
Wait 2
WpfWindow("HP MyFlight Sample Application").WpfButton("OK").Click
WpfWindow("HP MyFlight Sample Application").Close
Next
-------------------------
Note: To enter Captcha fileds we use this method (Dynamic submission of Test Data)

ii) Using Data Table

Usage of Data Table
a) Enter Test Data directly into Data table and connect to the Test
b) Import Test Data from an external file (Text/Excel) and connect to the Test
c) Import Test Data from a Database and connect to the Test

Steps for Data Driven Testing using Data Table:
------------------------------------------------
i) Generate the basic test and run it once.

ii) Insert steps for Error handling.

iii) Launch Data Table and enter or import test data

iv) Connect Test data to the Test.
    Using Editor View
    Or
    Using Keyword view
    Or
    Using Data driver
v) Run the Test
-------------------------------
Connect Test Data using editor view:

DataTable(Column name or Column Id, Sheet name or Sheet id)

Example:
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\Flights Application\FlightsGUI.exe"
WpfWindow("HP MyFlight Sample Application").WpfEdit("agentName").Set DataTable("Agent", dtGlobalSheet)
WpfWindow("HP MyFlight Sample Application").WpfEdit("password").Set DataTable("Pasword", dtGlobalSheet)
wait 2
WpfWindow("HP MyFlight Sample Application").WpfButton("OK").Click
WpfWindow("HP MyFlight Sample Application").Close
----------------------------------------------------

UFT Tutorial 10 - Dynamic Programming, Test Methods

UFT Tutorial 10 - Dynamic Programming, Test Methods

Two types of Descriptive Programming
i) Static Programming

ii) Dynamic Programming
----------------------------

Dynamic Descriptive Programming:

Creating Description objects and generating steps using Description objects is called Dynamic programming.

Step 1: Create Description Objects
Syntax:

Set variable = Description.Create

Example:

Set Login = Description.Create
------------------------------------
Step 2: Enter properties information
Syntax:

Description Object("Property1 Name").Value ="Property1 Value"
Description Object("Property2 Name").Value ="Property2 Value"

Example:

Login("devname").value = "HP MyFlight Sample Application"
Login("height").value = 538
Login("width").value = 666
--------------------------------------
Step 3: Generate Steps using Description objects
Syntax:

Test Object(Description Object).method/Operation

Example:

WpfWindow(Login).Close
-------------------------------------------------
Write Dynamic Descriptive Programming for Login Functionality in UFT Sample Application.
'Create Description Objects
Set Login = Description.Create
Set Agent = Description.Create
Set Password = Description.Create
Set OK = Description.Create

'Enter Properties information
Login("devname").value = "HP MyFlight Sample Application"
Login("height").value = 538
Login("width").value = 666

Agent("devname").value = "agentName"
Agent("visible").Value = True
Agent("x").value = 131

Password("devname").Value = "password"
Password("y").value = 295

OK("devname").value = "okButton"
OK("name").Value = "OK"

'Generate steps using description objects
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\Flights Application\FlightsGUI.exe"
WpfWindow(Login).WpfEdit(Agent).Set "john"
WpfWindow(Login).WpfEdit(Password).SetSecure "566a34e600aabb3ed707"
WpfWindow(Login).WpfButton(OK).Click
------------------------------------------
'Load Library file at run-time.
ExecuteFile "C:\Users\G C REDDY\Desktop\Objects.vbs"
'Generate steps using description objects
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\Flights Application\FlightsGUI.exe"
WpfWindow(Login).WpfEdit(Agent).Set "john"
WpfWindow(Login).WpfEdit(Password).SetSecure "566a34e600aabb3ed707"
WpfWindow(Login).WpfButton(OK).Click
-------------------------------------------
Assignments:

i) Write Descriptive Programming for "Customer Registration" functionality in GcrShop
Steps / Navigation
-------------------
1) Launch the Browser and navigate to http://www.gcrit.com/build3/

2) Click "create an account" link

3) Enter all mandatory fields

4) Click "Continue" Button
-------------------------------------
ii) Write Dynamic programming for "Login" functionality in GcrShop.
Steps / Navigation

1) Launch the Browser and navigate to http://www.gcrit.com/build3/

2) Click on "login" link

3) Enter "E-mailAddress"

4) Enter "Password"

5) Click "Sign in" Button
---------------------------------------
UFT Test Methods
1) Close Method
It closes an Object (Dialog box, Window, Browser window)

Syntax:

Object.Close

Example:

WpfWindow("HP MyFlight Sample Application").Close
Browser("Google").Close
---------------------------------------------
2) Click method
It clicks an Object (Buttons, Links)

Syntax:

Object.Click

Example:

Browser("Google").Page("Google").Link("Gmail").Click
WpfWindow("HP MyFlight Sample Application").WpfButton("Cancel").Click
--------------------------------------------
3) Set Method
i) Enter a value in to Edit box

Syntax:

Object.Set "value"

Example:
Browser("GCR Shop").Page("GCR Shop").WebEdit("firstname").Set "Samir"
--------------------------
ii) Check /Uncheck a Check box

Syntax:

Object.Set "ON/OFF"

Example:

Browser("GCR Shop").Page("GCR Shop").WebCheckBox("newsletter").Set "ON"
Browser("GCR Shop").Page("GCR Shop").WebCheckBox("newsletter").Set "OFF"
--------------------------------
4) SetSecure Method
It enters encoded value into Password object.

Syntax:

Object.SetSecure "Encoded value"

Example:

WpfWindow("HP MyFlight Sample Application").WpfEdit("password").SetSecure "566a3db47bdc516fe98c"
Browser("GCR Shop").Page("Gmail").WebEdit("Passwd").SetSecure "566a3de3f6f4032689e30805a000754f8b17aece1b48"
-------------------------------------------
5) Select Method
i) It selects a radio button from a Radio Group

Syntax:

Object.Select "item value"

Example:

Browser("GCR Shop").Page("GCR Shop").WebRadioGroup("gender").Select "f"

ii) It selects an item from a combo box or drop down box

Syntax:

Object.Select "item"

Or
Object.Select (index)

Example:
Browser("GCR Shop").Page("GCR Shop").WebList("country").Select "India"
Browser("GCR Shop").Page("GCR Shop").WebList("country").Select(2)
--------------------------------------
WpfWindow("HP MyFlight Sample Application").WpfComboBox("fromCity").Select (0)
WpfWindow("HP MyFlight Sample Application").WpfComboBox("toCity").Select "London"
-----------------------------------------------
Drop Down Box

Selects one item at a time.

List Box

Selects one or more items.

Combo Box
Selects an item or enters new item
---------------------------------------
6) GetVisibleText
It returns text value from an Object

Syntax:

Variable = Object.GetVisibleText

Example:

Agent = WpfWindow("HP MyFlight Sample Application").WpfEdit("agentName").GetVisibleText
Msgbox Agent
x = WpfWindow("HP MyFlight Sample Application").WpfButton("OK").GetVisibleText
Msgbox x
-----------------------------------------
7) GetROProperty method
It returns Run-time object property value

Syntax:

Variable = Object.GetRoProperty ("property name")

Example:
y = WpfWindow("HP MyFlight Sample Application").WpfButton("OK").GetROProperty("text")
Msgbox "Text Value " & y

z = WpfWindow("HP MyFlight Sample Application").WpfButton("OK").GetROProperty("enabled")
Msgbox "Enabled Value " & z

a = WpfWindow("HP MyFlight Sample Application").WpfButton("OK").GetROProperty("width")
Msgbox "Width is " & a
----------------------------------------
8) GetItemsCount
It returns items count from a combo box or list box

Syntax:

Variable = Object.GetItemsCount

Example:

itemsCount = WpfWindow("HP MyFlight Sample Application").WpfComboBox("fromCity").GetItemsCount
Msgbox itemsCount
---------------------------------
9) GetContent
It returns content from a combo box or list box

Syntax:

variable = Object.getContent

Example:

Content = WpfWindow("HP MyFlight Sample Application").WpfComboBox("fromCity").GetContent
Msgbox Content
------------------------------------------
10) GetItem
It returns an item based on item index from a list box or combo box

Syntax:
Variable = Object.getItem(item idex)

Example:
item = WpfWindow("HP MyFlight Sample Application").WpfComboBox("fromCity").GetItem(1)
Msgbox item
---------------------------------------
11) Sync (Only for web)
It waits for the browser to complete its current navigation.

Syntax:

Object.Sync

Browser("Personal Banking, Online").Page("Google").Sync
--------------------------------------
12) Navigate (Only for web)
It opens a specified url in the browser window

Syntax:

Object.Navigate "url"

Example:

Browser("Personal Banking, Online").Navigate ("www.yahoo.com")
--------------------------------------
13) CaptureBitmap method
It captures Screen shot during execution and stores in a specified location

Syntax:

Object.CaptureBitmap "path to store"

Example:
WpfWindow("HP MyFlight Sample Application").CaptureBitmap "C:\Users\G C REDDY\Desktop\Login.bmp"
-------------------------------------------

UFT Tutorial 9 - Descriptive Programming

UFT Tutorial 9 - Descriptive Programming
Descriptive Programming Or Programmatic Descriptions
 

Enter / Provide Objects information (Properties and Values) directly into statements /Steps is called Descriptive programming.

Object

Button, Edit box, Link, Radio button etc...

Property

Method
---------------------------
Test Run Process in OR based Test:

During test design UFT reads steps one by one and gets Object information from Object Repository based on that info performs operations on AUT.

Test Run Process in DP based Test:

During test design UFT reads steps one by one, objects information also available in the steps based on that info performs operations on directly AUT.

Tests based on descriptive programming are faster in execution than object repository based tests.

How to get Unique Properties Information

i) Based on UFT Object Identification Configuration

ii) Trial and error
--------------------------------------
         Recorded Test        Keyword driven Methodology
-----------------------------------------------------
Steps/Statements

Internal Process
---------------------------------------------------
OR based Test Vs.    DP
----------------------------
Test Object statements vary from OR based test and DP

Test Object Statements in OR based Test and Descriptive Programming:

i) Single Test Object statement
OR based Test

Syntax:

Test Object("Object Name").Method /Operation

Example:

WpfWindow("HP MyFlight Sample Application").Close
Browser("UFT Tutorial").Close

DP

Syntax:

Test Object("Property Name:=Property Value").Method / Operation

Or

Test Object("Property1 Name:=Property1 Value","Property2 Name:=Property2 Value" ).Method / Operation

Example:

WpfWindow("devname:=HP MyFlight Sample Application").Close
Browser("CreationTime:=0").Close

Note: Latest Browser Creation time is (n-1)

Oldest Browser Creation time is zero
--------------------------------------
Two Test Objects Step/Statement
OR based Test

Syntax:

Parent Test Object("Object Name").Child Test Object("Object Name").Method /Operation

Example:

Browser("Google").Page("Gmail - Free Storage and").Sync

WpfWindow("HP MyFlight Sample Application").WpfButton("Cancel").Click

DP

Syntax:

Test Object("Property Name:=Property Value").Method /Operation

Example:
WpfWindow("devname:=HP MyFlight Sample Application").WpfEdit("devname:=agentName").Set "john"

WpfWindow("devname:=HP MyFlight Sample Application").WpfButton("devname:=Cancel").Click

------------------------------------------------------------------
Descriptive programming Examples:

i) Write Descriptive code for Login Functionality in UFT Sample Application
Const  Login= "devname:=HP MyFlight Sample Application", AgentName ="devname:=agentName"
Const Password ="devname:=password", Ok = "text:=OK"
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\Flights Application\FlightsGUI.exe"
WpfWindow(Login).WpfEdit(AgentName).Set "john"
WpfWindow(Login).WpfEdit(Password).SetSecure "56679b3a2a6d481bb197"
WpfWindow(Login).WpfButton(OK).Click

For Centralized Maintenance of Objects:
a) Replace Test objects information (property and Property value) with constants

b) Create a library file and place constants

c) Associate the Library file to UFT, Create and execute Test scripts

d) Modify the Constants (if required) in the Library file)
-------------------------
1) Test Level Association

2) Tool Level Association

We can associate multiple library files also.
------------------------
'Load a Library file at runtime
ExecuteFile "C:\Users\G C REDDY\Desktop\Objects.vbs"
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\Flights Application\FlightsGUI.exe"
WpfWindow(Login).WpfEdit(AgentName).Set "john"
WpfWindow(Login).WpfEdit(Password).SetSecure "56679b3a2a6d481bb197"
WpfWindow(Login).WpfButton(OK).Click
----------------------------------------
'Load a Library file at run-timeExecuteFile "C:\Users\G C REDDY\Desktop\Objects.vbs"
Set x = WpfWindow(Login)
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\Flights Application\FlightsGUI.exe"
x.WpfEdit(AgentName).Set "john"
x.WpfEdit(Password).SetSecure "56679b3a2a6d481bb197"
x.WpfButton(OK).Click
-------------------------

ii) Write Descriptive code for Admin Login Functionality in Gcrshop(www.gcrit.com/build3/admin)
SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe", "http://www.gcrit.com/build3/admin/"
Browser("CreationTime:=0").Page("title:=GCR Shop").Webedit("name:=username").Set "admin"
Browser("CreationTime:=0").Page("title:=GCR Shop").Webedit("name:=password").SetSecure "5667a5518162f85e4cacb42801141a12b87c19162edf81ca"
Browser("CreationTime:=0").Page("title:=GCR Shop").WebButton("name:=Login").Click

Code Optimization:
Set myPage = Browser("CreationTime:=0").Page("title:=GCR Shop")
SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe", "http://www.gcrit.com/build3/admin/"
myPage.Webedit("name:=username").Set "admin"
myPage.Webedit("name:=password").SetSecure "5667a5518162f85e4cacb42801141a12b87c19162edf81ca"
myPage.WebButton("name:=Login").Click
----------------------------------------

UFT Tutorial 8 - Keyword Driven Methodology


UFT Tutorial 8: Keyword Driven Methodology
 

Generating Tests Manually using keywords (Test object, Utility object, method etc...)

Steps for Keyword Driven Methodology:
 

i) Create shared object Repositories (Add Objects or export local objects)

ii) Associate shared object Repositories

Or

Load Shared object Repositories at run-time.

iii) Generate Steps

    a) Using Editor view

    b) Using Keyword view

    c) Using Step Generator

    d) By drag and drop objects from OR to Editor (Test Object steps only)
-------------------------------------
Step Generator
 

Design -> Step Generator or (F7)

It is a library of Functions (VBScript built-in functions etc...) and Utility objects, used to generate Recordable and Non-Recordable steps.

Non-Recordable steps:
 

i) Operation on disabled Object

ii) Irregular Operation
------------------------------------------
Advantages of Recording
 

i) Easy to generate Tests and takes less time.

ii) Scripting is knowledge optional

iii) Analyze the AUT in terms of Object Identification.

iv) Recommendable for dynamically changing UI designs

v) Recommendable for short term projects
etc...
-------------------------------
Disadvantages of Recording
 

i) No centralized maintenance of Test Objects

ii) Low in performance.

iii) Testers may not have command on Test scripts, so locating errors is difficult

iv) We cannot record all operations

etc...
-------------------------------------
Types of Steps or Statements in UFT Test / test script
 

We use different type of steps in UFT Tests

i) Utility statements / Steps
 

SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\Flights Application\FlightsGUI.exe"
 

SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe"

ii) Test Object Statements or Object Calls
 

Browser("Google").Page("Google").Link("Gmail").Click
WpfWindow("HP MyFlight Sample Application").WpfButton("Cancel").Click
iv) Declarationsa) Variables
Dim a, b(4), c(), d(4, 5)

b) Constants
Const city ="Hyderabad", num =100

iv) Flow Control Statements
a) Conditional Statements
 

Dim a, b

a =100
b = 50

If a > b Then
    Msgbox "A is a Big Number"
    Else
    Msgbox "B is a Big Number"
End If

b) Loop Statements
 

For i = 1 To 5 Step 1
Msgbox i &    " Hello UFT"
Next

v) Checkpoint Statements
 

VbWindow("CALCULATOR").VbEdit("RESULT").Check CheckPoint("RESULT")

vi) Output value statements
 

VbWindow("CALCULATOR").VbEdit("RESULT").Output CheckPoint("RESULT")

vii) Automation Object statement
 

objFso.CreateFolder "C:\Users\G C REDDY\Desktop\QTP"

viii) VBScript statements
 

Option Explicit

Dim

If

Set

On Error Resume Next etc...
------------------------------------

UFT Class 7 - UFT Object Repository

UFT Class 7: UFT Object Repository
What is Object Repository?
 

It is a storage place to store Test Objects information.

Two types of Object Repository in UFT:
 

i) Local Object Repository

ii) Shared Object Repository

i) Local Object Repository
 

UFT creates a local repository for every Action automatically during Recording.

User can edit local objects (Add, Rename, delete)

It is an internal file, UFT save local repository files along with Test Scripts.

ii) Shared Object Repository
 

User creates Shared object Repository files either By Adding objects or By exporting Local objects.

Shared object Repository files are External files, user need to maintain external files.

User can edit shared objects.

Shared object Repository file extension is .tsr
----------------------------------
Operations on Object Repository:
 

i) Add Objects (Local and Shared)

ii) Rename Objects (Local and Shared)

iii) Delete Objects (Local and Shared)

iv) Export Local objects

v) Merge Object Repositories

vi) Associate Shared object Repositories

vii) Load Shared Object Repository at Run-time.

Syntax:
RepositoriesCollection.Add "Path of the Shared Object Repository"

Example:
RepositoriesCollection.Add "C:\Users\G C REDDY\Desktop\Login.tsr"

viii) Map Objects in between OR and AUT

View options

a) Highlight in Application (OR to AUT)

b) Locate in Repository (AUT to OR)
--------------
ix) Export Shared objects to XML/Import from XML

x) Define New Test Objects
-----------------------------------------
Dynamic Handling of Object Repositories:
 

RepositoriesCollection.Add "C:\Users\G C REDDY\Desktop\Login.tsr"
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\Flights Application\FlightsGUI.exe"
WpfWindow("HP MyFlight Sample Application").WpfEdit("agentName").Set "john"
WpfWindow("HP MyFlight Sample Application").WpfEdit("password").Set "HP"
WpfWindow("HP MyFlight Sample Application").WpfButton("OK").Click
Posi = RepositoriesCollection.Find("C:\Users\G C REDDY\Desktop\Login.tsr")
RepositoriesCollection.Remove(Posi)
RepositoriesCollection.Add "C:\Users\G C REDDY\Desktop\Orders.tsr"
wpfwindow("HP MyFlight Sample Application").WpfComboBox("fromCity").Select "London"
WpfWindow("HP MyFlight Sample Application").Close
RepositoriesCollection.RemoveAll

UFT Interview Questions Part 2

UFT Interview Questions Part 2
1) What is Add in Manager in UFT?
 

It shows all available Add ins in our company, we have to select appropriate Add ins for our Application.

2) What is Test Pane?
 

It is an area where we create, view and modify Tests/Test Scripts.

It has two views,

i) Editor view - Test in VBScript format

ii) Keyword view - Test in GUI format

Switch from Editor view to Keyword view

View menu -> Keyword view

Switch from Keyword view to Editor view

View menu -> Editor

3) What is Active Screen?
 

It captures and holds Screen shots for every user operation on AUT during record.

Using Active Screen we can easily understand and update the Test/Test Script

It requires more memory, so tool performance will be reduced.

Launch Active Screen

View menu -> Active screen

4) What is Data Table?
 

It is an integrated workbook (Excel like) for Data related operations.

Launch Data Table:
View menu -> Data

It has 2 types of sheets
i) Global sheet for entire test

ii) Actions sheet/s / Local Sheets

> UFT attaches one Data Table for every Test.

Usage of Data Table:
i) Enter test data directly into Data Table and connect to the Test

ii) Import test data from an external file (Text/Excel) and connect to the Test

iii) Import test data from a database and connect to the Test
--------------
> Data Table is located in 2 areas

i) In UFT tool main window (Design time Data Table)

ii) In UFT tool Result window (Run-time Data Table)

5) What is Errors pane?
 

It shows syntax errors automatically while saving the Test.

6) What is Step Generator?
 

It is a library of functions and utility objects used to generate recordable and non-recordable steps.

7) What is Test Recording?
 

It is a process of generating steps/statements for user actions on AUT and storing Objects information into Object Repository.

8) What is Test Run?
 

During Test execution UFT reads steps one by one and gets Objects information from Object Repository, based on that info performs actions on AUT.

9) How many Recording Modes available in UFT and what are they?
UFT has Four Recording Modes,
i) Normal Recording or Default Recording?

ii) Analog Recording

iii) Low Level Recording

iv) Insight Recording

10) What is Normal Recording?
 

It records user actions on AUT based on Objects.

It is the default Record mode in UFT.
-------------------
It is unable record continuous mouse operations.

11) What is Analog Recording?
 

It records user actions on AUT based on x, y coordinates of either desktop or Application window.

It also records Normal operations.
----------------------------------
Drawbacks

i) It requires more memory than Normal Recording

ii) It doesn't generate steps for every user action on AUT, generates all actions in a track file, so Test Script is not readable as well as editable.

12) What is Low Level Recording?
 

It records some operations on Non supported environments (records based on object coordinates), also records normal steps.

Drawbacks
----------
i) It requires more memory than Normal Recording

ii) Test Script is nor readable

13) What is Insight Recording?
 

It records some operations on Non supported environments (it capturers object screen shots also).

14) What are the Pre-requisites to create Tests in UFT?
 

i) Test Scenario:
Ex: Verify Login Functionality in GcrShop (http://www.gcrit.com/build3/admin/)

ii) Steps / Navigation
Example:

a) Launch the Browser and navigate to http://www.gcrit.com/build3/admin/

b) Enter user name

c) Enter password

d) Login Login button

iii) Verification Point/s
Check the existence of Logoff Link.

iv) Input Data
User name: admin

Password: admin@123

v) Error Handling
Example: Capture Error message and Close the Browser.

vi) Test Objects Information

vii) Test Methods Information

15) What is Run-time Object?
 

The Object present in the Application is called Run-time object.

States of Run-time objects:

Enabled, Disabled, Visible, Hidden and Focused.

16) What is Test Object?
 

Reference of Run-time object is Called Test object.

Test object names vary from one environment to another.

17) What are Utility Objects?
 

They are UFT Reserved objects used for Testing and Result Reporting.

Example: SystemUtil, RepositoriesCollection, Services, Reporter etc...

18) What are Automation Objects?
 

Automation objects are User defined objects used to work with Drives, Folders, Files and Databases.

Example:
i) File System Object

ii) Excel Application Object

iii) Database Connection Object

iv) Database Recordset Object

v) Dictionary object
etc...
--------------------------------------

Software Testing Fresher Resume

Software Testing Fresher Resume
Narasimha Rao Ummaneni                   
Email: narasimharaou@gmail.com
Mobile: **********
---------------------------------------------------------------------------
Career Objective:
To obtain a challenging and responsible position in the area of Software Testing where my knowledge, ability and dedication will be utilized.

Summary:
• Good knowledge on Software Development Life cycle models.

• Knowledge on Business Requirements, Software Requirements and Test Requirements.
• Expertise on Software Test Levels, Test Types and Test design techniques.
• Knowledge on All phases of Software Test Process includes Test Planning, Test Design, Test Execution and Test Closure.
• Ability to generate Test scenarios, to write Test Cases, and to collect Test Data.
• Knowledge on Creating and Executing Test batches.
• Expertise  on Defect Reporting, Defect Tracking and Defect Life cycle.
• Expertise on UFT Fundamentals & Features and Test Automation Process.
• Expertise on Creating Test cases using Selenium WebDriver and TestNG testing framework.
• Expertise Java Programming and VBScripting.
• Knowledge of Writing & Executing SQL Statements.
• Knowledge on Quality Standards like ISO, IEEE, and CMM /CMMMI.
• Good interpersonal skills, committed, result oriented, hard working with a quest and zeal to learn new technologies.

Academic Qualification:
• B.Tech (Computer Science and Engineering) from Jawaharlal Nehru Technological University in 2015 with 72%.
• Intermediate from BIE, AP (SKR Govt College, Gudur) passed in 2011 with 68%
• S.S.C from School of Secondary Education, AP in 2009 with 76%.

Software Skills:
Operating Systems :    Linux, Windows 7, 8 and Windows 2008 Server
Testing Tools         :    UFT 11.5 to 12.51, Selenium 2.0
Language              :    C, C++, java
Databases             :    SQL Server, Oracle
Scripting               :    Vbscript, Java script
Web Technologies  :    HTML, XML

Training Programmings Attended:
 

• Software Testing Training program (Manual Testing and Test Automation using UFT) in Hyderabad in 2015
• Test Automation using Selenium WebDriver with Java and TestNG.

Testing Certifications:
• ISTQB Foundation Level (CTFL) certification in 2015.

Academic Project Work:
Title                       :    IBEE-ECom
Technologies Used   :    LAMP (Linux, Apache, MySQL and PHP)
Operating System    :    Linux


Project Description:
          IBEE-Com is an Ecommerce web portal, it organizes online shopping business operations like products promotions, selling and shipping goods etc. It has 2 interfaces, One is Admin interface, provides features like Adding / Editing / Deleting Vendors, Products, User management and generating Reports. Another interface is User Interface, provides features like Products menu, searching for products, buying products etc…

Responsibilities:
• Understanding and analyzing Functional Requirements
• Involvement in User Interface design using HTML, Java script and Flash technologies.
• Writing code for User interface functionality and part of Admin interface functionality.
• Involvement in Database design (Creating and organizing tables)

Personal Details:
Name                 :        Ummaneni Narasimha Rao   
Date of Birth       :        30-July-1993
Married Status    :        Single
Nationality          :        Indian

Address              :        ********    

Languages known   :        Telugu, English, Hindi

UFT Class 6 - Creating Tests in UFT


UFT Tutorial 6 - Creating Tests in UFT
a) Object Repository based Test Design

                1) Recording
                2) Keyword Driven Methodology

b) Descriptive Programming / Programmatic Descriptions

                1) Static Programming
                2) Dynamic Programming
-----------------------------------
Record and Run Tests

What is Test Recording?

It is a process of generating steps/statements for user actions on AUT and storing Objects information into Object Repository.
What is Test Run?

During Test execution UFT reads steps one by one and gets Objects information from Object
Repository, based on that info performs actions on AUT.

Recording Modes:

i) Normal Recording / Default Recording

It records user actions on AUT based on Objects.

It is the default Record mode in UFT.
-------------------
It is unable record continuous mouse operations.

ii) Analog Recording

It records user actions on AUT based on x, y coordinates of either desktop or Application window.

It also records Normal operations.
----------------------------------
Drawbacks


i) It requires more memory than Normal Recording

ii) It doesn't generate steps for every step, generates all actions in a track file, so
Test Script is not readable as well as editable.
----------------------------------------------
iii) Low Level Recording

It records some operations on Non supported environments (records based on object coordinates), also records normal steps.

Drawbacks
----------
i) It requires more memory than Normal Recording

ii) Test Script is nor readable
--------------------------------------
iv) Insight Recording

It records some operations on Non supported environments (it captures object screen shots also).
----------------------------
Advantages of Recording

Disadvantages of Recording
--------------------------------------
Pre-requisites to create Tests in UFT

i) Test Scenario:

Verify Login Functionality in GcrShop (http://www.gcrit.com/build3/admin/)
---------------------------------
ii) Steps / Navigation

i) Launch the Browser and navigate to http://www.gcrit.com/build3/admin/

ii) Enter user name

iii) Enter password

iv) Login Login button
----------------------------
iii) Verification Point/s

Check the existence of Logoff Link.
----------------------------------
iv) Input Data

User name: admin

Password: admin@123
------------------------------------
v) Error Handling

Capture Error message and Close the Browser.
-------------------------
vi) Add Comments

Test Objects Information

Test Methods
---------------------
Types of Objects in UFT

i) Run-time Objects


The Object present in the Application is called Run-time object.

States of Run-time objects

Enabled

Disabled

Visible

Hidden

Focused
--------------------
ii) Test Objects

Reference of Run-time object is Called Test object.

Constant Object

Dynamic Object

Duplicate Objects
----------------------
iii) Utility Objects

They are UFT Reserved objects used for Testing and Result Reporting.

SystemUtil

Windows based Application:

Syntax:

SystemUtil.Run "path of the application"

Example:

SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\Flights Application\FlightsGUI.exe"

Web based Application:

Syntax:

SystemUtil.Run "path of the Browser", "url"

Example:

SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe", "www.icicibank.com"

iv) Automation Objects

Automation objects are User defined objects used to work with Drives, Folders, Files and Databases.

1) File System Object

2) Excel Application Object

3) Database Connection Object

4) Database Recordset Object

5) Dictionary object
etc...
--------------------------------------