SlideShare ist ein Scribd-Unternehmen logo
1 von 16
www.advancedqtp.com




             Chapter 5
            Introduction to Test Objects


Chapter Topics
 What is an Object?
 Object Properties
 Object Methods
 The Object Spy
 How QTP identifies objects?
 The Object Repository




                                              QTP0100-5.001
QTP0100 - First Steps - Windows                      www.advancedqtp.com




What is an Object?




   In strictly mathematical branches of computer science the term object is used in a
    purely mathematical sense to refer to any "thing".
   Something that is perceived as an entity and referred to by a name


Object Properties




                                                                               QTP0100-5.002
QTP0100 - First Steps - Windows                       www.advancedqtp.com




What is an Object Property?
   A property of an object is some quality of that object. A physical property is any
    aspect of an object or substance that can be measured or perceived.




Object Methods




What is an Object Method?
   A method usually consists of a sequence of statements to perform an action, a set
    of input parameters to customize those actions, and possibly an output value.
   Methods are associated with a particular object.




                                                                                QTP0100-5.003
QTP0100 - First Steps - Windows                       www.advancedqtp.com




Object Spy
Windows Objects
QuickTest recognizes objects in an supported application and determines what type
of object each is




     The Object Spy
   Using the Object Spy pointing hand mechanism, you can view the supported
    properties and methods of any object in an open application.
   As you move the pointing hand over the objects in the application, their details are
    displayed in the Object Spy.




                                                                                QTP0100-5.004
QTP0100 - First Steps - Windows                     www.advancedqtp.com




                                     These details may include the test object's
                                      hierarchy tree, its properties and values,
                                      and the methods associated with the object.




Choose Tools > Object Spy or click the Object Spy toolbar button     to open the
Object Spy dialog box and display the Properties tab.




                                                                            QTP0100-5.005
QTP0100 - First Steps - Windows                        www.advancedqtp.com




Understanding the Object Spy Dialog Box
                                     Using the Object Spy, you can view the run-time
                                      or test object properties and methods of any
                                      object in an open application.
                                     You use the Object Spy pointer to point to an
                                      object.
                                     The Object Spy displays the selected object's
                                      hierarchy tree.
                                     It displays the run-time or test object properties
                                      and values of the selected object in the
                                      Properties tab.
                                     It displays the run-time or test object methods
                                      associated with the selected object in the
                                      Methods tab.




Task - Spying Objects

   Open and login to the Flight Reservation application.
   Be sure that the form is empty of data.
   In QuickTest, open the object Spy.
   Select the WinComboBox "Fly From" with the Spy finger point.
   Answer the following :
        o How many items does the list have?
        o What kind of Test Object is the list parent?
        o What is the second item in the list?
        o Which item is currently selected?
        o How many arguments have the method Select?
        o What is the purpose of the GetSelection method?


Object Identification Properties
   Object identification properties can be used in the object repository description, in
    programmatic descriptions, in checkpoint and output value steps, and as argument
    values for the GetROProperty method.
   GetROProperty - Returns the current value of the test object property from the
    object in the application.



                                                                                 QTP0100-5.006
QTP0100 - First Steps - Windows                      www.advancedqtp.com




Displaying Messages during the Run Session
Use the MsgBox VBScript function in your test to display information during the run
session. The run session pauses until the message box is closed.




Use the Print Utility statement in your test to display information in the QuickTest
Print Log window while still continuing the run session.




                                                                              QTP0100-5.007
QTP0100 - First Steps - Windows                 www.advancedqtp.com




             Interactive Quiz - How am I?


                                        I am a Win______________________

                                        I am a Win______________________

                                        I am a Win______________________

                                        I am a Win______________________

                                        I am a Win______________________



Common Methods and Properties




How QTP Identifies Objects?
In the Object > Method > Value model, how do you think QuickTest came up with
“Fly From:?”



                                                                       QTP0100-5.008
QTP0100 - First Steps - Windows                      www.advancedqtp.com




                       Discussion: How QuickTest Recognize Objects




The Object Repository
The Object Repository – The hidden object.
   When QuickTest runs a test, it simulates a human user by moving the pointer
    over the application, clicking objects, and entering keyboard input.
   Like a human user, QuickTest must learn the interface of an application to be able



                                                                              QTP0100-5.009
QTP0100 - First Steps - Windows                       www.advancedqtp.com




                   to work with it.
                QuickTest does this by learning the application's objects and their
                   corresponding property values and storing these object descriptions in
                   an object repository.
                The Object Repository window displays a tree of all test objects and
                   all checkpoint ( 9.5 only ) and output objects in the current component
      or in the selected action including all local objects and all objects in any shared
      object repositories associated with the selected action.




    Tree Structure
         and
    Logical Names




     For each object you select in the tree, the Object Repository window displays
      information on the object, its type, the repository in which it is stored, and its
      object details.
     Local objects are editable (black); shared objects are in read-only format (gray).
     You can use the Object Repository window to view the object description of any
      Test object in the repository.

Recording a Script




                     Based on the Instructor Presentation.


How QTP Identifies Objects
     Learns the object's parent window and the object properties...
     Recognizes the object type ( class name ).
     Collect unique physical properties for that object.
     Assigns a "Logical name" to the learned object.




                                                                                  QTP0100-5.010
QTP0100 - First Steps - Windows                      www.advancedqtp.com




"Playing" a script




                       Based on the Instructor Presentation.

   When the script is run, the process is reversed.
   The Object Repository translates logical names into physical descriptions.
   There is no link between the logical names appearing in the script and the objects
    in the AUT besides the one created by QuickTest in the Object Repository.
   So, all communication, both when recording and when running, passes through
    the Object Repository.


Logical Names
   Even if QuickTest has already learned the majority of GUI objects in the AUT, It
    is quite possible that at a later stage of development there will be new objects in
    the AUT that should be learned.
   Logical name must be identical in repository AND in test script, otherwise script
    won't run correctly




                                                                               QTP0100-5.011
QTP0100 - First Steps - Windows                        www.advancedqtp.com




Summary
In this chapter you learned about:
   property is a set of characteristics that define an object’s appearance, values, state
    and identity in an application
   A Method is a procedure or process for attaining an object.
   Objects have common and/or specific properties and methods, that's why that the
    most important property is the object type
   With the Object Spy you can overview test or run time properties and method of a
    specific object
   The Object Repository is one or more reusable file which maps logical names to
    a physical description
   Logical names are important for readability
   Physical descriptions are important for locating objects
   QuickTest creates an object repository while it records
   Objects are accessible from the object repository


Review Questions
Question 1
What are the two most important properties for a testing object?
1. _________________________________________________________________
2. _________________________________________________________________


Question 2
Which Test object will never have a parent? _________________________________


Question 3
The click method is used by almost all testing objects.
Why the method does have 2 optional arguments? ( x and y )
______________________________________________________________
______________________________________________________________


Question 4
Where the click method is going to "click" without x and y coordinates?
____________________________________________________________________




                                                                                 QTP0100-5.012
QTP0100 - First Steps - Windows              www.advancedqtp.com




Question 5
Which method is used to retrieve Object identification properties?
1. GetContent.
2. GetTOProperty.
3. GetROPrperty.
4. ItemsCount
5. Both 2 and 3
6. None of the options above.

Question 6
The drop-down list is represented by the test object:
1. WinList
2. WinDropDownList
3. WinObject
4. WinComboBox.



Question 7
The object spy can be activated from:
1. The Tools menu.
2. The Tools toolbar.
3. The Local Object Repository.
4. The Object Repository Manager.
5. All options above.
6. Options 1 and 2.

Question 8
What is the difference between an Object Logical Description and Object Physical
Description?
______________________________________________________________
______________________________________________________________


Question 9
Logical names in repository must identical to script object names
True     False




                                                                         QTP0100-5.013
QTP0100 - First Steps - Windows                    www.advancedqtp.com




Exercise: Identification Properties
Part 1 - Open the Basic Script
   From menu File > Open > Test
   Select QTP0100_1


Part 2 - Handling Dynamic Data
   In The Flight Reservation application press on the New button or File > Menu
    print the number of items in the dropdown list Fly to:




   Run the script.
   Why two different methods return the same value?
    __________________________________________________________________
   After the Step "Select London" ( Fly From ) Step, print again the number of items
    on the dropdown list Fly to:
   Run the script.
   Why the values are now different?
    __________________________________________________________________
   After the Step Select "London", print the "enabled" value of the Flights button.
   After the Step Select "Paris", print the "enabled" value of the Flights button.
   Put in the right location within the script to print the "enabled" identification
    property of the button "Insert Order" to be True
   Print the final message in the progress bar ( "Insert Done..." )
   Run the script and describe your conclusions :
    __________________________________________________________________
    __________________________________________________________________
    __________________________________________________________________
    __________________________________________________________________
    __________________________________________________________________


Part 3 - Investigating the Object Spy
   Open the Flight Reservation application if it closed.
   Login to the Flight Reservation Application.



                                                                             QTP0100-5.014
QTP0100 - First Steps - Windows                     www.advancedqtp.com




   Enter Date: "010110", Fly From: "Seattle".
   Activate the Object Spy.
   Spy the test object "Fly From:"
   What is the value of the identification property all items?
    __________________________________________________________________
   What is the value of the selected property?
    __________________________________________________________________
   What is the value of the text property?
    __________________________________________________________________
   What is the difference between them (selected and text)?
    selected: __________________________________________________________
    text: ______________________________________________________________
   Spy the test object "Fly To:"
   What is the value of the selected property?
    __________________________________________________________________
   What is the value of the text property?
    __________________________________________________________________
   Close the Spy.
   Minimize the Flight Reservation application.
   Activate the Spy again.
   "Spy" on the Flights button.
   Retrieve the identification property of the Flights button?
   Why the text property value different from the actual text value?
    __________________________________________________________________
    __________________________________________________________________


Part 4 - Runtime Properties
   Spy on the object "Name:" and answer the following:
   How many run-time object properties "Name:" has? ______________________
   How many run-time object methods "Name:" has? _______________________
   "Spy" on the Date of Flight field ( ActiveX object ) and answer the following:
   How many run-time object properties "MaskEdBox:" has? ________________
   How many run-time object methods "MaskEdBox:" has? __________________




                                                                              QTP0100-5.015
QTP0100 - First Steps - Windows                  www.advancedqtp.com




Part 5 - The Object Repository
   Open the Object Repository form the basic test ( CTRL + R )
   How many "Dialog" test objects do you see?
    __________________________________________________________________
   Locate the "Fly From:" test object.
   Who is the "parent" of "Fly From:"?
    __________________________________________________________________
   Why we don't see the identification properties" text" and "items count"?
    __________________________________________________________________
    __________________________________________________________________
   Locate the "Date of Flight" field
   Why logical name is not "Date of Flight"? _____________________________
   How many "OK" buttons you see in the object repository? ________________
   If you find more than one, what is the difference between them?
    __________________________________________________________________
    __________________________________________________________________
   Why the WinRadioButton "Economy" is not in the OR?
    __________________________________________________________________
    __________________________________________________________________
   The "native class" value of the t "Fly To:" test object is WinComboBox
    .
    True       False

   The "class" value of the "Fly To:" test object is WinComboBox.

    True       False




                                                                             QTP0100-5.016

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Oops
OopsOops
Oops
 
Jist of Java
Jist of JavaJist of Java
Jist of Java
 
JAVA CONCEPTS AND PRACTICES
JAVA CONCEPTS AND PRACTICESJAVA CONCEPTS AND PRACTICES
JAVA CONCEPTS AND PRACTICES
 
Junit and testNG
Junit and testNGJunit and testNG
Junit and testNG
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Unit 4 exceptions and threads
Unit 4 exceptions and threadsUnit 4 exceptions and threads
Unit 4 exceptions and threads
 
Junit
JunitJunit
Junit
 
Java unit 7
Java unit 7Java unit 7
Java unit 7
 
Java tutorials
Java tutorialsJava tutorials
Java tutorials
 
Renraku - The One Static Analysis Model to Rule Them All
Renraku - The One Static Analysis Model to Rule Them AllRenraku - The One Static Analysis Model to Rule Them All
Renraku - The One Static Analysis Model to Rule Them All
 
Java Programming - 05 access control in java
Java Programming - 05 access control in javaJava Programming - 05 access control in java
Java Programming - 05 access control in java
 
Oop14
Oop14Oop14
Oop14
 
Unit3 part1-class
Unit3 part1-classUnit3 part1-class
Unit3 part1-class
 
What Do You Mean By NUnit
What Do You Mean By NUnitWhat Do You Mean By NUnit
What Do You Mean By NUnit
 
Java Reflection
Java ReflectionJava Reflection
Java Reflection
 
Java inheritance
Java inheritanceJava inheritance
Java inheritance
 
Java tutorials
Java tutorialsJava tutorials
Java tutorials
 
Inter thread communication & runnable interface
Inter thread communication & runnable interfaceInter thread communication & runnable interface
Inter thread communication & runnable interface
 
Synapseindia reviews.odp.
Synapseindia reviews.odp.Synapseindia reviews.odp.
Synapseindia reviews.odp.
 
Viva file
Viva fileViva file
Viva file
 

Ähnlich wie Solmar QTP0100 Sample

QTP Automation Testing Tutorial 3
QTP Automation Testing Tutorial 3QTP Automation Testing Tutorial 3
QTP Automation Testing Tutorial 3Akash Tyagi
 
Qtp Training Deepti 2 Of 44780
Qtp Training Deepti 2 Of 44780Qtp Training Deepti 2 Of 44780
Qtp Training Deepti 2 Of 44780Azhar Satti
 
SAP Testing Training
SAP Testing TrainingSAP Testing Training
SAP Testing TrainingVGlobal Govi
 
Hp Quick Test Professional
Hp Quick Test ProfessionalHp Quick Test Professional
Hp Quick Test Professionalsunny.deb
 
QTP Training by INFOTECH
QTP Training by INFOTECHQTP Training by INFOTECH
QTP Training by INFOTECHPravinsinh
 
Qtp Basics
Qtp BasicsQtp Basics
Qtp Basicsmehramit
 
Qtp 8.0 basic
Qtp 8.0 basicQtp 8.0 basic
Qtp 8.0 basicmedsherb
 
Qtp Mgl Presentation
Qtp Mgl PresentationQtp Mgl Presentation
Qtp Mgl Presentationtechgajanan
 
What are the features in qtp
What are the features in qtpWhat are the features in qtp
What are the features in qtpRamu Palanki
 
Qtp material for beginners
Qtp material for beginnersQtp material for beginners
Qtp material for beginnersRamu Palanki
 
Interview questions in qtp
Interview questions in qtpInterview questions in qtp
Interview questions in qtpRamu Palanki
 
Automation Tool QTP
Automation Tool  QTPAutomation Tool  QTP
Automation Tool QTPBugRaptors
 
Qtp interview questions and answers
Qtp interview questions and answersQtp interview questions and answers
Qtp interview questions and answersRamu Palanki
 

Ähnlich wie Solmar QTP0100 Sample (20)

QTP Automation Testing Tutorial 3
QTP Automation Testing Tutorial 3QTP Automation Testing Tutorial 3
QTP Automation Testing Tutorial 3
 
Qtp Training Deepti 2 Of 44780
Qtp Training Deepti 2 Of 44780Qtp Training Deepti 2 Of 44780
Qtp Training Deepti 2 Of 44780
 
QTP Faqs
QTP FaqsQTP Faqs
QTP Faqs
 
SAP Testing Training
SAP Testing TrainingSAP Testing Training
SAP Testing Training
 
Qtp basic stuff
Qtp basic stuffQtp basic stuff
Qtp basic stuff
 
Hp Quick Test Professional
Hp Quick Test ProfessionalHp Quick Test Professional
Hp Quick Test Professional
 
QTP Training by INFOTECH
QTP Training by INFOTECHQTP Training by INFOTECH
QTP Training by INFOTECH
 
Qtp testing1
Qtp testing1Qtp testing1
Qtp testing1
 
Qtp testing1
Qtp testing1Qtp testing1
Qtp testing1
 
Qtp Basics
Qtp BasicsQtp Basics
Qtp Basics
 
Qtp 8.0 basic
Qtp 8.0 basicQtp 8.0 basic
Qtp 8.0 basic
 
Qtp 80 Basics3561
Qtp 80 Basics3561Qtp 80 Basics3561
Qtp 80 Basics3561
 
Qtp Mgl Presentation
Qtp Mgl PresentationQtp Mgl Presentation
Qtp Mgl Presentation
 
What are the features in qtp
What are the features in qtpWhat are the features in qtp
What are the features in qtp
 
Qtp day 1
Qtp day 1Qtp day 1
Qtp day 1
 
Qtp faqs
Qtp faqsQtp faqs
Qtp faqs
 
Qtp material for beginners
Qtp material for beginnersQtp material for beginners
Qtp material for beginners
 
Interview questions in qtp
Interview questions in qtpInterview questions in qtp
Interview questions in qtp
 
Automation Tool QTP
Automation Tool  QTPAutomation Tool  QTP
Automation Tool QTP
 
Qtp interview questions and answers
Qtp interview questions and answersQtp interview questions and answers
Qtp interview questions and answers
 

Kürzlich hochgeladen

4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 

Kürzlich hochgeladen (20)

4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 

Solmar QTP0100 Sample

  • 1. www.advancedqtp.com Chapter 5 Introduction to Test Objects Chapter Topics  What is an Object?  Object Properties  Object Methods  The Object Spy  How QTP identifies objects?  The Object Repository QTP0100-5.001
  • 2. QTP0100 - First Steps - Windows www.advancedqtp.com What is an Object?  In strictly mathematical branches of computer science the term object is used in a purely mathematical sense to refer to any "thing".  Something that is perceived as an entity and referred to by a name Object Properties QTP0100-5.002
  • 3. QTP0100 - First Steps - Windows www.advancedqtp.com What is an Object Property?  A property of an object is some quality of that object. A physical property is any aspect of an object or substance that can be measured or perceived. Object Methods What is an Object Method?  A method usually consists of a sequence of statements to perform an action, a set of input parameters to customize those actions, and possibly an output value.  Methods are associated with a particular object. QTP0100-5.003
  • 4. QTP0100 - First Steps - Windows www.advancedqtp.com Object Spy Windows Objects QuickTest recognizes objects in an supported application and determines what type of object each is The Object Spy  Using the Object Spy pointing hand mechanism, you can view the supported properties and methods of any object in an open application.  As you move the pointing hand over the objects in the application, their details are displayed in the Object Spy. QTP0100-5.004
  • 5. QTP0100 - First Steps - Windows www.advancedqtp.com  These details may include the test object's hierarchy tree, its properties and values, and the methods associated with the object. Choose Tools > Object Spy or click the Object Spy toolbar button to open the Object Spy dialog box and display the Properties tab. QTP0100-5.005
  • 6. QTP0100 - First Steps - Windows www.advancedqtp.com Understanding the Object Spy Dialog Box  Using the Object Spy, you can view the run-time or test object properties and methods of any object in an open application.  You use the Object Spy pointer to point to an object.  The Object Spy displays the selected object's hierarchy tree.  It displays the run-time or test object properties and values of the selected object in the Properties tab.  It displays the run-time or test object methods associated with the selected object in the Methods tab. Task - Spying Objects  Open and login to the Flight Reservation application.  Be sure that the form is empty of data.  In QuickTest, open the object Spy.  Select the WinComboBox "Fly From" with the Spy finger point.  Answer the following : o How many items does the list have? o What kind of Test Object is the list parent? o What is the second item in the list? o Which item is currently selected? o How many arguments have the method Select? o What is the purpose of the GetSelection method? Object Identification Properties  Object identification properties can be used in the object repository description, in programmatic descriptions, in checkpoint and output value steps, and as argument values for the GetROProperty method.  GetROProperty - Returns the current value of the test object property from the object in the application. QTP0100-5.006
  • 7. QTP0100 - First Steps - Windows www.advancedqtp.com Displaying Messages during the Run Session Use the MsgBox VBScript function in your test to display information during the run session. The run session pauses until the message box is closed. Use the Print Utility statement in your test to display information in the QuickTest Print Log window while still continuing the run session. QTP0100-5.007
  • 8. QTP0100 - First Steps - Windows www.advancedqtp.com Interactive Quiz - How am I? I am a Win______________________ I am a Win______________________ I am a Win______________________ I am a Win______________________ I am a Win______________________ Common Methods and Properties How QTP Identifies Objects? In the Object > Method > Value model, how do you think QuickTest came up with “Fly From:?” QTP0100-5.008
  • 9. QTP0100 - First Steps - Windows www.advancedqtp.com Discussion: How QuickTest Recognize Objects The Object Repository The Object Repository – The hidden object.  When QuickTest runs a test, it simulates a human user by moving the pointer over the application, clicking objects, and entering keyboard input.  Like a human user, QuickTest must learn the interface of an application to be able QTP0100-5.009
  • 10. QTP0100 - First Steps - Windows www.advancedqtp.com to work with it.  QuickTest does this by learning the application's objects and their corresponding property values and storing these object descriptions in an object repository.  The Object Repository window displays a tree of all test objects and all checkpoint ( 9.5 only ) and output objects in the current component or in the selected action including all local objects and all objects in any shared object repositories associated with the selected action. Tree Structure and Logical Names  For each object you select in the tree, the Object Repository window displays information on the object, its type, the repository in which it is stored, and its object details.  Local objects are editable (black); shared objects are in read-only format (gray).  You can use the Object Repository window to view the object description of any Test object in the repository. Recording a Script Based on the Instructor Presentation. How QTP Identifies Objects  Learns the object's parent window and the object properties...  Recognizes the object type ( class name ).  Collect unique physical properties for that object.  Assigns a "Logical name" to the learned object. QTP0100-5.010
  • 11. QTP0100 - First Steps - Windows www.advancedqtp.com "Playing" a script Based on the Instructor Presentation.  When the script is run, the process is reversed.  The Object Repository translates logical names into physical descriptions.  There is no link between the logical names appearing in the script and the objects in the AUT besides the one created by QuickTest in the Object Repository.  So, all communication, both when recording and when running, passes through the Object Repository. Logical Names  Even if QuickTest has already learned the majority of GUI objects in the AUT, It is quite possible that at a later stage of development there will be new objects in the AUT that should be learned.  Logical name must be identical in repository AND in test script, otherwise script won't run correctly QTP0100-5.011
  • 12. QTP0100 - First Steps - Windows www.advancedqtp.com Summary In this chapter you learned about:  property is a set of characteristics that define an object’s appearance, values, state and identity in an application  A Method is a procedure or process for attaining an object.  Objects have common and/or specific properties and methods, that's why that the most important property is the object type  With the Object Spy you can overview test or run time properties and method of a specific object  The Object Repository is one or more reusable file which maps logical names to a physical description  Logical names are important for readability  Physical descriptions are important for locating objects  QuickTest creates an object repository while it records  Objects are accessible from the object repository Review Questions Question 1 What are the two most important properties for a testing object? 1. _________________________________________________________________ 2. _________________________________________________________________ Question 2 Which Test object will never have a parent? _________________________________ Question 3 The click method is used by almost all testing objects. Why the method does have 2 optional arguments? ( x and y ) ______________________________________________________________ ______________________________________________________________ Question 4 Where the click method is going to "click" without x and y coordinates? ____________________________________________________________________ QTP0100-5.012
  • 13. QTP0100 - First Steps - Windows www.advancedqtp.com Question 5 Which method is used to retrieve Object identification properties? 1. GetContent. 2. GetTOProperty. 3. GetROPrperty. 4. ItemsCount 5. Both 2 and 3 6. None of the options above. Question 6 The drop-down list is represented by the test object: 1. WinList 2. WinDropDownList 3. WinObject 4. WinComboBox. Question 7 The object spy can be activated from: 1. The Tools menu. 2. The Tools toolbar. 3. The Local Object Repository. 4. The Object Repository Manager. 5. All options above. 6. Options 1 and 2. Question 8 What is the difference between an Object Logical Description and Object Physical Description? ______________________________________________________________ ______________________________________________________________ Question 9 Logical names in repository must identical to script object names True False QTP0100-5.013
  • 14. QTP0100 - First Steps - Windows www.advancedqtp.com Exercise: Identification Properties Part 1 - Open the Basic Script  From menu File > Open > Test  Select QTP0100_1 Part 2 - Handling Dynamic Data  In The Flight Reservation application press on the New button or File > Menu print the number of items in the dropdown list Fly to:  Run the script.  Why two different methods return the same value? __________________________________________________________________  After the Step "Select London" ( Fly From ) Step, print again the number of items on the dropdown list Fly to:  Run the script.  Why the values are now different? __________________________________________________________________  After the Step Select "London", print the "enabled" value of the Flights button.  After the Step Select "Paris", print the "enabled" value of the Flights button.  Put in the right location within the script to print the "enabled" identification property of the button "Insert Order" to be True  Print the final message in the progress bar ( "Insert Done..." )  Run the script and describe your conclusions : __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ __________________________________________________________________ Part 3 - Investigating the Object Spy  Open the Flight Reservation application if it closed.  Login to the Flight Reservation Application. QTP0100-5.014
  • 15. QTP0100 - First Steps - Windows www.advancedqtp.com  Enter Date: "010110", Fly From: "Seattle".  Activate the Object Spy.  Spy the test object "Fly From:"  What is the value of the identification property all items? __________________________________________________________________  What is the value of the selected property? __________________________________________________________________  What is the value of the text property? __________________________________________________________________  What is the difference between them (selected and text)? selected: __________________________________________________________ text: ______________________________________________________________  Spy the test object "Fly To:"  What is the value of the selected property? __________________________________________________________________  What is the value of the text property? __________________________________________________________________  Close the Spy.  Minimize the Flight Reservation application.  Activate the Spy again.  "Spy" on the Flights button.  Retrieve the identification property of the Flights button?  Why the text property value different from the actual text value? __________________________________________________________________ __________________________________________________________________ Part 4 - Runtime Properties  Spy on the object "Name:" and answer the following:  How many run-time object properties "Name:" has? ______________________  How many run-time object methods "Name:" has? _______________________  "Spy" on the Date of Flight field ( ActiveX object ) and answer the following:  How many run-time object properties "MaskEdBox:" has? ________________  How many run-time object methods "MaskEdBox:" has? __________________ QTP0100-5.015
  • 16. QTP0100 - First Steps - Windows www.advancedqtp.com Part 5 - The Object Repository  Open the Object Repository form the basic test ( CTRL + R )  How many "Dialog" test objects do you see? __________________________________________________________________  Locate the "Fly From:" test object.  Who is the "parent" of "Fly From:"? __________________________________________________________________  Why we don't see the identification properties" text" and "items count"? __________________________________________________________________ __________________________________________________________________  Locate the "Date of Flight" field  Why logical name is not "Date of Flight"? _____________________________  How many "OK" buttons you see in the object repository? ________________  If you find more than one, what is the difference between them? __________________________________________________________________ __________________________________________________________________  Why the WinRadioButton "Economy" is not in the OR? __________________________________________________________________ __________________________________________________________________  The "native class" value of the t "Fly To:" test object is WinComboBox . True False  The "class" value of the "Fly To:" test object is WinComboBox. True False QTP0100-5.016