Blog to understand automation concepts in QTP, Selenium Webdriver and Manual Testing concepts

Showing posts with label QTP. Show all posts
Showing posts with label QTP. Show all posts

Example to explain working with excel application in QTP using VBScript

 In this post, we will know how to work with excel application with an example . We will explain how to copy a source file and create an destination file with same name or a dynamic name generated. We will also explain how to copy data from an excel worksheet to another worksheet, delete an excel sheet, and rename an excel worksheet using excel application object.

 The problem we will resolve using this code is as follows. 


In the below code, we will explain how to implement the above using vb script.

destfile = CopyFile("D:\testt\TestSupport_1.xls", "D:\testt\", 1)
copydata "D:\testt\generatedRpt.xls", destfile, "general_report", "temp"
masterfile = Copyfile(destfile, "D:\testt\TestingSupport_Daily_Data.xls",0)


'' Description - This function will copy the file from source location to destination folder. In this example we have used below three parameter as per our need.

''Source file - Exact name and location of the source file. This is an external file generated at a fixed location which was first part of problem and will be handled using QTP
''DestinationFolder - this is either the folder location with or without file name. 
''filename - this shows filename is included in the the destinationfolder. In case of dynamic naming of the file, provide value as 1 else provide value as 0.

function CopyFile(SourceFile, DestinationFolder, filename)
if (filename =1) then
'' generate a dynamic name for the file in case filename argument is provided as 1
    DestinationFile = DestinationFolder + "TestSupport" + cstr(DatePart("m",Now()))+ cstr(DatePart("d",Now()))+ cstr(DatePart("yyyy",Now())) + ".xls"
else
   DestinationFile = Destinationfolder
end If

    Set fso = CreateObject("Scripting.FileSystemObject")
    'Check to see if the file already exists in the destination folder
    If fso.FileExists(DestinationFile) Then
    ''In case of destinationfile already exists, delete the existing file
fso.DeleteFile DestinationFile, True
    End If

'' Copy the file from source location to destination location
    fso.CopyFile SourceFile, DestinationFile, True
''close the instance of filesystem object
    Set fso = Nothing
''return the value of file name as the rsturn value of the function.
copyfile = Destinationfile
End function
'

'' Description - this function will copy data from sheet1 of workbook1 to sheet2 of workbook2.


sub copydata(workbook1, workbook2, sheet1,sheet2)
'' Create an instance of excel object
Set objExcel = CreateObject("Excel.Application") 
'' define if the excel needs to be displayed and alerts to be displayed. here the excel will be visible but no alerts will be displayed in case of alert prompt in the excel application.

objExcel.Visible = True
objExcel.DisplayAlerts = False
'' create an instance of excel workbooks for source as well as destination workbook
Set objsrcFile= objExcel.Workbooks.Open(workbook1)   
Set objdestfile = objExcel.Workbooks.Open(workbook2) 
objsrcfile.Activate
'' create instance of worksheet in the workbook
Set objsrcSheet = objsrcfile.Worksheets(sheet1)
Set objdestSheet = objdestfile.Worksheets(sheet2)
'' gather the data from the source file to destination file
'' In the below example , we are copying the data from 4th row in source file to destination file. we can start from first row also if required.
icolcount = objsrcSheet.usedrange.columns.count
irowcount = objsrcSheet.usedrange.rows.count
for i = 4 to irowcount-1
for j = 1 to icolcount-1
''copies data from the destination file to the source file
objdestSheet.cells(i-3,j)= objsrcsheet.cells(i,j)
next
next
objsrcfile.save
objdestfile.save
''This is again a customised code to delete a sheet from excel file. 
objdestfile.sheets("Previous Day").Delete
'' This step renames the sheet in the destinstion file.
Set objWrksheet = objdestfile.Worksheets("Today")
objWrksheet.Name = "Previous Day"
set objWrkSheet = nothing
''Rename another sheet in the workbook
Set objWrksheet = objdestfile.Worksheets("temp")
objWrkSheet.Name = "Today"
set objWrkSheet = nothing
''Add a temp table at the end of sheets and name it as temp
Set objWrkSheet = objdestfile.Sheets.Add(, objdestfile.Sheets(objdestfile.Sheets.Count))
objWrkSheet.Name = "temp"

''Save the excel file and close the instance of excel aplication
objdestfile.save
objsrcfile.close
objdestfile.close
objexcel.quit
set objexcel = nothing
msgbox "done"
end sub

Using Parameterization for data driven testing in QTP/ UFT

UFT/ QTP enables us to configure the values for properties and other items by defining a value as a constant or a parameter. We can also use regular expressions for some values to increase the flexibility and adaptability of our tests. A parameter is value that is defined or generated externally and is retrieved during a run session. A parameter for example can take value from an external source like excel sheet or UFT data tables.

The major advantage or need of using parameters in test is to create data driven tests. 

Let me explain this with an example. Suppose there are two edit controls in the Page Username and Password and user clicks on login button to login.

Suppose the requirement is to create test which will validate different users are able to login into application successfully. If we use constant value for Username and Password and have to validate for 100 Users, we will need to create 100 tests, Maintaining 100 tests is a tedious task and time consuming activity. 

Let me explain this with an example, suppose there is change in identification property of the Username edit box. E.g. Name of Username field is changed to E-Mail and the user using constants is using the local object repository for each test. We need to make change in each of the tests. Maintenance is also difficult because of rework for minor change in script. Also keeping the test executor understand the difference between the tests and which test is for which purpose is difficult task with growth in size of test suite.

Using Parameters in the test solves the above problem, we can iterate the same test steps execution using multiple data set and can compare the expected result with the pre-defined data stored in the data source. 

For e.g for successful login or incorrect password, parameterization using data table object, the code is like:

Parameterization

Browser("qaautomationqtp").page("qaautomationqtp").WebEdit("UserName").Set DataTable("UserName", dtGlobalSheet)

Browser("qaautomationqtp").page("qaautomationqtp").WebEdit("Password").Set DataTable("Password", dtGlobalSheet)

Browser("qaautomationqtp").page("qaautomationqtp").Webbutton("SignIn").Click

In the above example we use the global sheet to drive the data. We can upload data from external excel file or database to datatables in QTP and also extract back the information from data tables to excel using data table import/export methods. Once we have data in the local sheet or global sheet in data table, we can use data as shown in above code in QTP.

By data driven testing using parameterization, we need to create only a single test for 100 of tests using hardcoded approach and also the data is managed at a single place, hence improving the maintenance of the test.

Next question is what all we can parameterize in QTP, we can parameterize :

  • Checkpoints properties

  • Object properties for a selected step.

  • Operation arguments defined for a selected step.

  • Object properties in Object Repository.



The different ways in which data can be parameterized in QTP/UFT are as follows:


  • Test parameters enable us to use values passed in the test.
  • Action parameters enable us to pass values from other actions in the test.
  • Using Random Number, we can parameterize the value where any random numeric value can be provided.

  • Environment variable can be used for parameterization in QTP

    • Using datatables in QTP/UFT, we can parameterize the data. Before running the test we need to specify in Test Setting or action settings in QTP, how many iteration the test needs to be executed


    This article "Working with data tables" explains how to work with data tables in details.

    This article Environment variable explains how to work with environment variable in QTP.


    How to send e-mail using outlook object in QTP

    This post explain how to send e-mail using microsoft outlook object with or without any attachments. In the next article we will explain how to read information from an e-mail message.

    ''Function Description - This function sends a mail to end user
    '' Arguments - SendtoUser - Mail will be send to user mentioned in send to
    ''Subject - Subject of the mail
    ''Body - Text of the mail
    ''Attachment - Path of attachment to send e-mail

    SendMailUsingOutlook "SendToUser@test.com; testZ@test.com"," Subject", "Body", ""

    Function SendMailUsingOutlook(SendToUser, Subject, Body, Attachment) 

    '' create an object of outlook application and creating a new e-mail object
        Set objOutlook=CreateObject("Outlook.Application") 
        Set objMail=objOutlook.CreateItem(0) 

    '' Provide details of the mail object
        objMail.to=SendToUser
        objMail.Subject=Subject 
        objMail.Body=Body 

    '' attach a file with the e-mail, provide path of the attachment in the folder
        If (Attachment <> "") Then 
            objMail.Attachments.Add(Attachment) 
        End If 
    '' Send the e-mail
        objMail.Send 
    '' close the instance of Outlook application object
        objOutlook.Quit 

    ''release the object created    Set objMail = Nothing 
        Set objOutlook = Nothing 
    End Function 

    Descriptive programming in QTP: Questions Answers

    This post discusses on concepts of descriptive programming in QTP through questions and answers. Difference between DP and OR, types of DP, various examples are explained in this article


    Question  1: What is descriptive Programming?

    Answer: Descriptive programming allows working on an object by describing properties of the object at run time. Descriptive Programming provides flexibility to select properties. For e.g.: Suppose we have Web Object, we can use only html Id if defined for the object and some other properties if html id is not defined such that description of object is unique.

    Question 2:  What are different types in which descriptive programming can be implemented?

    Answer: Descriptive programming can be implemented using string based description or object based description:
                   a.  String based Description
                   b.  Using Description Object

    Question 3: What is String based Description approach for descriptive programming?

    Answer: In String based description, we create a description string similar to the tree structure we get on recording in QTP. So what we do is replace the tree structure with description string:


    e.g:  Browser(“Google”).Page(“Google”).WebEdit(“q”).set “nitin” 
    In Case of Object Repository(Recording) is expressed in Descriptive Programming as :Browser(“name:=Google”).Page(“name:=Google”).WebEdit(“html id:=qq”,”index:=0”).Set “nitin”

    Note: We can have parent object defined using OR and child object using DP, but vice versa is not possible, i.e Parent object description using DP and child object using OR.
    Browser(“Google”).Page(“Google”).WebEdit(“html id:=qq”,”index:=0”).Set “nitin” is correct but
    Browser(“name:=Google”).Page(“Google”).WebEdit(“html id:=qq”,”index:=0”).Set “nitin” is incorrect

    Question 4: How is Descriptive programming implemented using description object?

    Answer:  Using description object, we create description object and add properties to the object


    e.g: Set objdesc = description.create
    objdesc(“name”).value =”google”
    Browser(Objdesc).Close
    Or
    Set objdesc = description.create
    objdesc(“name”).value =”search”
    Browser("Google").Page("title:=.*").WebButton(objdesc)

    Question 5: I want to know number of links in a page, how Can I found the same using description object

    Answer: Code to find number of links in a page is:
    Set objLink=Description.Create ‘’Create a description object
    objLink("html tag").value="A"    ‘’Now the description object will refer to collection of object with tagName as “A”
    set olnk=Browser("Google").Page("Google").ChildObjects(objLink) ‘’Collection of all links in page(“Google”)
    iCount = olnk.Count ‘’Count of all links in the page.
    MsgBox “Count of links in Page are” & iCount
    Similar to number of link, we can find number of Editbox (tagname as Input), Image(Img) and so on in a page

    Question 6: I want to know, if certain object exist in a page and create a generic function to verify object of various types, How to code for this?

    Answer: Function below can be used to create a common function to verify existence of various types of objects in the page:
    Call Func_IsExistsObject(“Html id>abcd”,”WebEdit”,)
    Public Function Func_IsExistsObject(strobjDescObj,strObjType,)
    On error resume next
    Func_IsExistsObject = "False"  ‘’ Set the flag as ‘False’ at start of test execution
    Set objDesc= Description.create ‘’create  description  object
    strobjDesc = split(strobjDescObj,">")
    objdesc(strobjDesc(0)).value = strobjDesc(1)
    objdesc("index").value = 0
    If(ucase(strObjType) = "WEBBUTTON") Then
    Func_IsExistsObject = Browser("Google").Page("title:=.*").WebButton(objdesc).Exist
    ElseIf(ucase(strObjType) = "IMAGE") Then
    Func_IsExistsObject = Browser("Google").Page("title:=.*").Image(objdesc).Exist
    ElseIf(ucase(strObjType) = "CHECKBOX") then
    Func_IsExistsObject = Browser("Google").Page("title:=.*").WebCheckBox(objdesc).Exist
    ElseIf(ucase(strObjType) = "PAGE") then
    Func_IsExistsObject = Browser("Google").Page(objdesc).Exist
    ElseIf(ucase(strObjType) = "WEBELEMENT") then
    Func_IsExistsObject = Browser("Google").Page("title:=.*").WebElement(objdesc).Exist
    ElseIf(ucase(strObjType) = "WEBTABLE") then
    Func_IsExistsObject = Browser("Google").Page("title:=.*").WebTable(objdesc).Exist
    ElseIf(ucase(strObjType) = "WEBLIST") Then
    Func_IsExistsObject = Browser("Google").Page("title:=.*").WebList(objdesc).Exist
    ElseIf(ucase(strObjType) = "WEBEDIT") Then
    Func_IsExistsObject = Browser("Google").Page("title:=.*").WebEdit(objdesc).Exist
    ElseIf(ucase(strObjType) = "LINK") then
    Func_IsExistsObject = Browser("Google").Page("title:=.*").Link(objdesc).Exist
    End If
    Exit Function

    Question 7: How to close all browsers except QC using descriptive programming?

    Answer:  Below lines of code can be used to close all browsers except QC using descriptive programming:
    Set oBrowser = Description.Create
    oBrowser("micclass").Value = "Browser"
    Set ColBrowser= Desktop.Childobjects(oBrowser)
    For i = 0 to CollBrowser.count -1 step 1
                    If Instr(CollBrowser (i).GetROProperty("Name"), "Quality Center") = 0 Then
                                    CollBrowser(i).Close
                    End If
    Next

    Question 8: What are the advantage and disadvantage of descriptive Programming compared to Object Repository?

    Answer: Using Descriptive Programming helps in Portability and helps to identify object in case of dynamic object or creating objective library of description objects in case application is not developed completely but we know the properties of objects. For further details of comparison of Object Repository , Refer to  below links:


    How to work with Actions in QTP - Question in QTP

    Question 1: What are Actions in QTP?

    Answer: When we create a test in QTP, An action is created by default.  A test comprises call to multiple actions. Action helps divide the test into logical units and can be called multiple times within the test by some other actions. To understand this better, suppose I have an application that calls to login into application, then create a deal, viewing the deal, editing the deal, viewing the deal , and log out from application. So we can divide the test into actions as shown in screenshot below and call the actions from a main action.
     
    Example

    Question 2: Functions also help divide the test into logical units, so how Actions are different from functions?

    Answer: We can understand the difference between an action and function by below comparisons:

    1.   As we create a test in QTP, An action is created by default. Inside an action we can write multiple functions or call functions from external vbs libraries.
    2.   Action is a QTP Feature whereas Function is a VB Script feature.
    3.   Action are integral part of QTP Test, artifacts such as data table, object repository, checkpoint are associated to the action and are specific to the action, whereas we cannot associate these artifacts with a function,  but can be used by function if function is called within the action with which the object repository is associated.
    4.   Since Action have data table, and object repository, there take lot more space to functions, and are not useful in case we are using DOM or Descriptive programming for object identification and external test data in the form of excel sheets or database.
    5.   There is no limit to the number of functions that can be created or called within an action, but we can create a maximum of 120 actions in QTP 11.
    6.   We can return complex values from a function including arrays and object which is not possible in action parameters.
    7.   Editing an external function is much easier compared to an external action called by an action at runtime.
    8.   We can load both the external test actions and function libraries at run time.For external test action: use statement LoadandRunAction, whereas for loading external libraries use LoadFunctionLibrary.

    Question 3: How do we return value from an action?

    Answer: We can return value from an action using Input Parameter and output parameters.

    Question 4: What are the various types of Actions in QTP?

    Answer:  Following are the types of actions in QTP:

    Reusable action – A newly created action in QTP is reusable by default. A reusable action can be called by other action within the test or external actions.


    Non-reusable action – By default, an action is reusable in QTP, but can be made non-reusable by changing action Properties. A non-reusable action cannot be called from other actions.


    External action- This is a reusable action stored in another test. This is explained earlier in this article how to call an external action.


    Nested action - An action can call another action. This is known as nesting an action. For e.g : Multiple action called from an action and specific action being executed based on some condition using conditional looping.


    Question 5: What is difference between Calls to Copy of Actions and Calls to existing actions?

    Answer: Both Call to Copy of Action and calls to existing action are used to call another reusable action.
    On inserting a call to copy of an action, the called action is completely copied in the test together with resources including Object Repositories, data, and checkpoint. We can edit the script stored in action and make changes to the resources like Object repositories associated with the action. Changing the action does not have any impact on the original action and change in original action will not modify the copied action.
    Inserting a call to existing action allows viewing the steps of the action, but user cannot modify them. The called action’s local object repository is also read-only.

    Question 6: Which of the following can be used to transfer data between actions in a QTP test?

    a.    Using Global Data Sheet
    b.    Using Dictionary Object
    c.    Using Action or Test Output Parameters
    d.    Using Environment Variable
    e.     All of the above
    Answer: We can transfer data between actions using any of the above.

    Question 7: What is syntax for running an action in QTP?

    Answer: An action can be called from another action within the same test using RunAction.

    The syntax for RunAction is :  

    RunAction ActionName, IterationQuantity, Parameter

    Where IterationQuantity and Parameters are optional.

    e.g:   RunAction "Action1", oneIteration, Parameter("output"),DataTable("Outparam", dtLocalSheet)

     Similarly, if we need to run action from external test, we can use use 

    LoadandRunAction.Syntax : LoadandrunAction(Test Path, ActionName , iterations, Parameters)


    Question 8: Which of the following are specific to action and are created/associated at action level?

    a.      Object Repository
    b.      Local Data table
    c.      Checkpoints
    d.      Recovery Scenario.

    Answer: All except Recovery Scenario are associated at action level, recovery scenario are associated for the test.


    Understanding All about object Repository: Subjective and Multiple choice Questions

    In this article, we discuss about concepts of object Repository in QTP by subjective and multiple choice questions. Your suggestions are most welcome if I missed on anything in this article related to object repository.

    Question 1: What is object Repository?

    Answer: Object repository is a repository where collection of objects with identification properties are saved. Objects in an object repository are stored in a tree structure. E.g. a WebEdit object in object repository will have parent as Page, and page will have a parent browser. So for a browser object, we can have multiple page objects, and inside a page object we can have multiple web edit boxes. Object Repository stores objects and checkpoints.

    Understanding Object repository Window

    Question 2: Where can we see the object repository Window in UFT 11.5?    

    a. By clicking CTRL+R

    b. Navigating to Resources>Object Repository

    c. Navigating to Tools>Object Identification

    d. By clicking CTRL+A

    Answer: To view Object Repository window, Navigate to Resources>Object Repository or Click CTRL+ R. So option a) and b) are correct

    Question 3: Explain various menu items in the Object Repository Window?

    Answer: The various menu items in Object Repository Window:
          File:  File menu provides option to export object from local repository to a shared repository. When we learn object, objects are associated with an object repository for the particular Action and not be used by other actions. To use the same objects in other actions/ tests, we need to create shared OR. A shared OR is created by exporting objects from local repository. When we export local objects using File>Export Local Objects, a shared object repository is created at location defined. Instead if we use File>Export and Replace local objects, local object repository is removed, and a shared repository with action with all the local objects
    Adding a new test object 
            Edit: Provides option to cut, copy, find, replace, or delete an object in repository.
            Object: Object Menu allows us to do following tasks:
    a.       Define New Test Object – A new test object can be created based on environment, object class, and properties defined by user. This is useful in case the properties of object yet to be created by developer are known to tester.
    b.      Adds object to local – Allows to add objects from application to repository
    c.       Update object from application – this allows to update object properties for an object in repository with the properties of selected object from application
    d.      Add Insight Object to local – This adds insight object to the repository by user. An Insight object similar to other objects can be added during recording as well as manually by learning through application.
    e.      Copy to Local – An object from associated shared object Repository can be copied to Local using Copy to Local.
              View: Allows user with following tasks:
    a.       Compact view  Provides user option to view the object repository in compacts (Object Properties are not displayed in compact view)
    b.      Highlight in Application   this feature highlights the selected object in application and helps user know object is available
    c.       Locate in Repository – This is to verify object in application is already available in repository.
             Tools: Provides following tools to the user:
    a.       Object Spy – One of the first of features of QTP that we use in QTP to identify object properties is Object Spy. We can view the native properties and test object properties for an object and available methods based on object class.
    b.      Associate Repositories–  We can associate repositories with the action using associate repositories.
    c.       Delete Insight Objects
             Help: Provides help on object repository window

    Question 4: Which of the following are types of Object Repository?

    a.       Local Repository
    b.      Shared Repository
    c.      Global Repository
    d.      Test Repository.
    Answer: Local Repository and shared Repository are types of object repository. When we record on an application, or learn objects, objects are stored in the object repository specific to the action in which we learn or record in the application. This repository is known as Local Repository as is specific to the action. If we want to use same object in multiple test/action, we should use shared object repository. 
    When we export local object as explained in file section of Answer 3), a shared repository is created, We can merge object Repositories to form a large shared object Repository using Merge Object Repository feature in Object Repository manager. Shared Object repository can be used in multiple actions by associating the repository with action

    Question 5: We have associated different shared repositories and have some local object. How can we view object from local repository only in object Repository window?

    a.       Compact View shows only local objects in the repository
    b.      We cannot distinguish between Local and shared repository object.
    c.       Local objects are editable in Object Repository Window whereas objects from shared repository are non-editable and are displayed lighter/fade in color compared to Local object
    d.      Using Filter from Pane to filter objects from different repositories

    Answer: Option c.) and d.) are correct, Local objects are editable in Object Repository Window whereas objects from shared repository are non-editable and are displayed lighter/fade in color compared to Local object. Using Filter from Pane to filter objects from different repositories as shown below:


    Question 6: What is the extension of a Shared object repository in QTP?

    a.       .tsr
    b.      .qrs
    c.       .mts
    d.      .tsp
    Answer: Extension of a shared repository file is .tsr. qrs is extension for recovery file, .tsp is extension for a test, and .mts stores the script of an action


    Learning Object Identification in UFT/QTP with Question and Answers

    In this topic we will discuss in detail various questions on object identification with expectation that it covers and help reader understand the concepts of Object Identification with these topics:

    Question 1: What are the objects identified in QTP?

    Answer: When we record or learn object in QTP, QTP records properties of the object known as identification properties which are specific to the object class, for e.g. when we identify an input box, it is an object of WebEdit class and will store specific properties to the object. These objects are known as Test Objects.

    When we run a test in QTP, QTP matches properties stored for test objects with run-time objects, i.e. objects in the application during test run. If the properties of run time object matches with test objects, we can perform operations on the identified object.


    Question 2: What are native properties and Identification properties?

    Answer: Identification Properties are properties that QTP uses to identify objects in application. The identification properties for a test object are determined by its test object class and values for properties are used to identify object.

    We can retrieve and set test objects and properties using GetTOproperty and SetTOproperty. GetTOproperty method retrieves the property of object as stored in repository whereas SetTOproperty sets the property value of a test object in repository. Similar to this, GetROproperty is used to retrieve property of runtime object. Since we cannot change property of an object at runtime, there is nothing like SetROProperty

    Browser("google").Page("google").WebEdit("UserName").SetTOProperty "Name", "Nitin"
    strName= Browser("google").Page("google").WebEdit("UserName").GetTOProperty("Name")
    strName= Browser("google").Page("google").WebEdit("UserName").GetROProperty("Name")

    Native properties are properties as created by the creator of object, e.g. Microsoft is creator for IE explorer objects. We can retrieve native properties value for an object using .object

    e.g. : Set objReport = Browser("Google").Page("title:=.*").Frame("name:=ifrt5").Object.getelementbyid("username")
    objReport.innertext = “nitin”
    This code will search for element with html id as “username” in frame object and sets value nitin in the element.


    Question 3: How is an object identified in QTP?

    Answer: 
    1. UFT first identifies an object based on description properties, and if no match is found, it throws an error. In case unique match is found, QTP perform action of the matched object.
    2. If multiple matches are found based on description properties, and Visual Relation Identifier (Identifying object based on relative position of an object w.r.t other objects) is defined for test object, QTP searches for a match based on the relational identifier.
    3, In case 1) and 2) does not result in a unique match for object, QTP Searches for an object using smart identification.
    4. In case, step 1, 3) does not return a unique matching object and Visual Relation Identifier is not defined, QTP looks for ordinal identifier.
    Ordinal identifiers are not used in case visual relation identifiers are defined for object.


    Question 4: What are description properties?

     Answer: For every test object, there are identification properies by which QTP identifies the object. 
    Properties that QTP always learns as part of the description for test objects of the selected class are called mandatory property, in case object is not identified uniquely during learning or recording, QTP learns additional properties for test object of the selected class to create a unique test object description. These additional properties are known as Assistive properties. Assistive and mandatory properties used together to learn an object during learn or recording are known as Description properties.


    Question 5: Can we modify which properties to be learned as mandatory and which to be learned as assistive properties?

    Answer: By default in QTP, for each test object class, there are certain properties which are defined as mandatory properties and some other properties as Assistive properties, but we can change the properties to be learned as mandatory or assistive as described below:

    Navigate to Tools>Object Identification in UFT 11.5.  In the Object Identification window, for each object class there are properties marked as mandatory and assistive, we can add remove properties using add/remove button as shown below:
    Defining mandatory and assistive properties

    Question 6: What is Smart Identification?

    Answer: When an object is not uniquely recognized by the description properties and visual relation identifier defined for object, QTP uses smart identification mechanism to uniquely identify an object if smart identification is set as true at object properties in the object repositories. There are some set of properties known as base filter properties (most fundamental properties of a particular test object class) and optional filter properties (additional properties that can help identify objects of a particular class.).
    Smart Identication properties
    Smart identification process is as follows:
    QTP unlearns all the properties defined for object.
    Based on first base filter properties, QTP shortlists all the objects within the same parent class,
    QTP further shortlists based on other base filter properties followed by optional filter properties until a unique match for object is found. In case no unique match is found, post short listing by all optional filter properties, QTP selects unique object based on ordinal identifier defined for object.

    Question 7: What is the default ordinal identifier for web browser object?

    a.  Creation Time
    b.  Location
    c.  Index
    d.  Position.
    Answer: The default ordinal identifier is Creation time for browser object, for all other web object, the default ordinal identifier is Index.For Standard Windows object, it is Location.

    Please add any additional information that needs to be covered in topic on object Identification. Object Repository will be discusses in detail in another Question and Answer article