Saturday, November 16, 2013

Object Repository in UFT 11.5

Object Repository is second most important component in UFT after addin manager it has extradinary features and it will support developers to perform task easily.

Object Repository:

              Object Repository is a file where we are storing object properties and values so that we can perform actions based on those properties and we can modify those properties according to our test requirement.

How to Open Object Repository in UFT:

Navigations:

1."Resources" menu from menubar----->Object Repository
2.CTRL+R
3.by clicking on Object Repository button as shown in below


Generally object repository is divided into the following two types
  1. Per Action Repository
  2. Shared Object Repository
1.Per Action Repository:


Per action repository means for each action we have one repository by default so A repository file is stored with each action that we created

Per -action repository satisfies the following list of points

1.UFT creates a new blank Object repository for each action,as shown in below



2.As we record operations on objects in our application UFT automatically stores the information about the objects.

3.When we create new action,UFT creates another new Object Repository.

 here I created new action UFT creates action with repository as shown in below

4.If we record same object in two different actions the object is stores as a separate test object in each object repository.

5.Per Action Repository extension is -->.MTR(Module Test Repository )


2.Shared Object Repository:

Shared Object Repository is repository file where we use same file for all actions in our test.The extension we used for Shared Object Repository is (.tsr{Test Shared Repository})

here test Objects are stored into Object repository while we are recording and they will be used for scripting and any other requirement.

Adding Objects to Object Repository:

There are two ways to add Objects in Object Repository

1.Through Recording
        when the tool in normal recording mode what ever the objects that we record those will automatically stores into Object Repository.

2.Pre-learning(Manually Adding):

          In this process we add object by Object selectively or all objects available in the window can be added at a time to repository then we start with scripting.

Navigation:

Resources from menu bar--->Object Repository--->Object--->Add objects to local as shown below

or
Resources from menu bar--->Object Repository--->Add Objects to Local from tool bar


Once we click on Add Objects to local our mouse control becomes hand icon as we get in object spy then click on required object if it is independent test element it will automatically stores in to Object Repository or if the selected object is container like it contains multiple objects we need to click on ok,the scenarios as shown in below


After clicking on OK you will get the below window select the required option

the options behavior is as follows:

1.Selected Object Only:

if we select this then it adds to the object repository the previously selected objects's properties and values without its descendant objects.
****here previously selected object means only login dialog will add with out any objects that are present  inside that login dialog./only Parent

2.Default object Types:

If we select this option it will add the previously selected object and all the functional objects in side that object to the Object Repository.

All objects are stored with their properties and values in OR


3.All object Types:

if we select this one it will store selected object,all functional,non functional objects inside that Object as shown in below

4.selected Object Types:

Here when we select this option the select button will enable and if we click on this we can set preferences which objects we want to select according to that filter,all objects in side selected objects will stored into Object Repository



select the required option click on ok corresponding objects will add to Object repository which will helpful while writing scripts.


Export Object Repository into XML Format:

we can export Object Repositories in the form of XML format.

Navigation:
Resources--->
to be continued in very shortly

Sunday, November 10, 2013

Synchronization In UFT 11.5

"Synchronization" It is a process of matching the speeds of both UFT and application(the app that we are testing ) in order to get proper execution results.

OR 

It is process of matching the tool time and application time in order to complete the script execution successfully with out any interruption.

When Synchronization is Needed ?

when we are running a test using UFT it ideally works with same speed and gives the instructions to the  application with the same speed some times the application may take some time for processing  the specific instruction at that time our UFT won't wait for that time it immediately process the next instruction then we can't get expected result and entire application will fail to test at that time we need to implement some synchronization mechanism for waiting the tool till it gets a response from application

There we use these synchronization feature.

example:
if we are testing an login application of any mail we need to login and click on signout button but the application will take some time for login after clicking on "sign in" so our tool needs to wait for ample amount of time for "signout "button then we will click on sign out so for waiting we use this synchronization concept.

Note:  The generally the application may fast/slow we are synchronizing the tool with app.

UFT provides the following methods /properties

1.Object Synchronization time out( ) or Default synchronization time out

2.Wait Property

3.Wait( )

4.Exist ( )

5.Sync ( ) <------- Only for Web

Note:
The default waiting time of our UFT is 20 sec and if the operation is performed in 1 second it wont wait for remaining 19 seconds it is called "Dynamisam" here we can increase the wait time to as we want.

1.Object Synchronization Time Out:

It is the maximum time provided by UFT by default to execute each statement individually within this time.

The default time is 20 seconds you can find the default time in the following path

File---->Settings---->Run--->Object Synchronization Time out please find the below snap shot



2. Wait Property:

It waits  untill  the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step.

syntax:

Object.WaitProperty(PropertyName,propertyvalue,[timeout])

Object                 any test object
PropertyName:    the name of the property whose value is checked
Propertyvalue:     The value we are expecting
Timeout               optional time in milliseconds

Note:
It is for object level and synchronization time out is for Application level

example:

Flight reservation login app for this scenario

Adding login,flight reservation objects to OR


Find the complete code from below snap


here we are looking for Window named Flight reservation after clicking on Login button our UFT waits till the enabled property "true"/it will waits for till the timeout is completed UFT will execute next statement if any of the condition is true.

***Note:
The above two mechanisms are dynamic (i.e) they won't wait unnecessary time if the action completes even if we specify long time.

We can perform this kind of synchronization in recording modes also.

3.Wait( ) :-

In this method, without specifying the condition we can keep our tool in waiting state for specified amount of time.

Syntax:

Wait( time in seconds)
ex:

Wait(30)

Note:  It is fully static it will wait full amount of time even the action performed in short time than specified.

4.Exist ( ) :

It is used to check the existence of the application/objects  within the specified time.If the object is available within the time then it returns true otherwise it returns false.This method also dynamic if we get the required thing is less time than specified it will go to next statement.

syntax:

Object.exist(seconds)

5.Sync( ):<----------For web apps only

It waits for the browser to complete the current navigation

syntax:

Object.Sync

Notes:
1.For web apps default time wait is 60 seconds and for windows it is 20 seconds only.


2.If there is any conflict in UFT tool default settings time and explicit settings like  Exist( ),Wait( ), WaitProperty  high priority will be there for external settings only.

3.If we are not specified as external it will take internal settings and perform the operations.

This is sign off of Synchronization Concepts If you need any information on these examples please reach out me I can able to help on them. 

Thursday, November 7, 2013

WIll be continued from thursday

Hey guys the thing you know I have release in NOV15th and code freez is done on this friday I didnt got sufficient time to update my blog over the last week once i become free then i will complete the following concepts completely within a short span of one week

Recordings
Object model -Object repositories
synchronization

all the topics will be covered relavent to the above topics with screen shots and explanation & blog will make a sensible order as well

Sorry for the delay

Sunday, November 3, 2013

Object Spy in UFT 11.5

It is a feature provided in UFT 11.5 which is used to display properties and values of an application object.Using this we can find the run time or test object properties and methods of any object on an open application.

Navigation:

1.Tools---->Object Spy from menu bar
2.Object spy icon from tool bar


You can choose any of the way if you click on "Object Spy" you will get the below "Object Spy" Dialog box
Click on hand icon and then click on required object you will get all the properties and values of that object.

The Object Spy dialog box contains the following options:



we use this pointer to click or highlight the object whose properties we want view.when you click on this pointer then after according to your mouse movements and pointing the properties and values of objects dynamically changes.when you click on specific object then corresponding properties and methods and hierarchy are displayed in Object Spy dialog box.

Once we capture an Object with Object spy the next three buttons will get activated as below



2.If we click on "Highlight in Application" then the object which we already captured through object repository is highlighted in application as shown above it will be useful if we have large number of object in application.

3."Add Object To Repository" this button enables to add the selected object to "Object Repository".

4.Object Hierarchy:



here it will displays the hierarchy of objects that are related to the object we selected as shown below


" Properties" tab contains properties and values of a selected object.

I hope these options will enough to work on "Object Spy" in UFT 11.5.If there is any doubt please let me know.

Conclusion:  Object Spy is used in order to identify an object' in an application and use their properties to access that object through script so that we can achieve the functionality.

Thursday, October 31, 2013

Working with Recording Modes in UFT 11.5

RecordingIt is one of the feature of UFT 11.5/QTP where maximum applications automation starts with recording then after the script is enhanced with Object Repositories,Check points,Output Values,Parameterization,synchronization etc.So we can take it as initial step for automation.

Playback:We will record the application with one set of data and we will enhance the test as I explained above and Play/Run that script with multiple sets of data by using data/web tables.here we can execute same script for thousands of different data.

All the above terminolgies will come to know in coming tutorials as of now no issues you can proceed with reading this article.

Unified Functional testing 11.5 is the recording & play back tool,it is a functional testing tool to use retesting and regression testing purpose.it supports the following list of recording modes.

1.Normal Recording Mode
2.Analog Recording Mode
3.Low Level Recording Mode
4.Insight Recording Mode

You can able to see the list of recording modes in UFT 11.5 from "Record" menu as below


1.Normal/Standard/General/Default Recording Mode:

              It is popularly known as default recording mode,It records the user mouse and keyboard actions
on Application under test with respect to objects and stores those objects in Object Repositorys and perform the operations on those objects.

Here while recording the application UFT generates VB script statements in TestPane and at the same time it adds corresponding objects to Object Repository.

Working with Normal Recording mode:

Navigation 1:

Launch UFT 11.5---->Select "Record" menu from menu bar---->click on "Record" option

Navigation 2:

Select "Record" option from Toolbar.

Navigation 3:

Use short cut key "F6"

we can find the above navigations as below


When we click on "Record" we will get below "Record and Run settings "window where we can select that we are going to record winodws /web application here it is mandatory one.



After selecting windows/web we need to specify that we are going to record for opened application/we can specify the path of the application.

Once it is done click on Apply and click on OK then recording will start.

Note: It is good to close all the unnecessary applications while recording.while recording is in progress don't perform any operations anywhere in the screen.

Recording a windows application Flight Reservation Login and Logout operations:
steps to follow:

1.Launch UFT 11.5.
2.Open Flight Reservation windows app from Start-->allprograms-->HP Software-->HP Unified Functional Testing-->Sample applications-->Flight GUI


2.Select "Record" from any of the above three ways
3.select "Windows Application" from "Record and Run settings" window.
then

you can select any one of the option and specify which application you want to record I am taking first option and then click on "Apply" next click on "OK".

Now recording will start

click on Flight reservation application give AgentName as "xxxxxxxxxx" Password as"mercury" click on OK
it will login into the Application then click on Filemenu--->Exit and then stop recording as shown below


Once you click on exit then click on stop recording.

You will get script generated in Test Pane for your actions.You can re-run it any number of times and enhance it we will look into them after few days.

find the below script for the same


Note: When you are playing the script make sure that the application on which you recorded is opened then only that script runs.

Note:  By default Recording means Normal recording only.
Script Description:

1.Dialog,WinEdit,WinButton,Window,WinMenu are keywords/class names
2. Login,AgentName,Password,OK,Flight Reservation,Menu are logical names.
3.Set,Set Secure,Activate,Click are methods to perform actions on the objects.
4. srinivas,password are values that are passing to application to validate the functionality.

Normal Recording Mode Disadvantages:
1.We can't record continuous mouse operations
example:
Perform recording operation while providing a signature on ms-paint and play it you can find the issue.

2.Can't record if the respective addin is not present for an application technology.


2.Analog Recording Mode:

We overcome the above the limitations by using this recording mode.

It enables you to record exact mouse and keyboard operations as you perform the operations under recording.
Here UFT records and tracks each and every movement of the mouse and keyboard as you drag the mouse around the screen or the application window.

Navigation:

We cannot directly perform analog recording we can use analog recording in Normal recording

to be continued in next tutorials