Your SlideShare is downloading. ×
QTP Tutorial
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

QTP Tutorial

717
views

Published on

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
717
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
17
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. HP QTP forSoftware Automation Testing
  • 2. What is HP QTP? HP Quick Test Professional is automated testing software designed for testing various software applications and environments. It performs functional and regression testing through a user interface such as a native GUI or web interface. It works by identifying the objects in the application user interface or a web page and performing desired operations (such as mouse clicks or keyboard events); it can also capture object properties like name or Object ID. HP Quick Test Professional uses a VBScript scripting language to specify the test procedure and to manipulate the objects and controls of the application under test. To perform more sophisticated actions, users may need to manipulate the underlying VBScript. HP Quick Test Professional is usually used for "UI Based" Test Case Automation, it also can automate some "Non-UI" based Test Cases such as file system operations, database testing or Web services testing
  • 3. Benefits of Automation Testing
  • 4. What is Automation Framework? A test automation framework is a set of assumptions, concepts and tools that provide support for automated software testing. The main advantage of such a framework is the low cost for maintenance. If there is change to any test case then only the test case file needs to be updated and the Driver Script or Startup script will remain the same. Ideally, there is no need to update the scripts in case of changes to the application. Choosing the right framework/scripting technique helps in maintaining lower costs. The costs associated with test scripting are due to development and maintenance efforts. The approach of scripting used during test automation has effect on costs.
  • 5. Types of Automation Frameworks Linear - procedural code, possibly generated by tools like those that use record and playback Structured - uses control structures - typically ‘if-else’, ‘switch’, ‘for’, ‘while’ conditions/ statements Data Driven - data is persisted outside of tests in a database, spreadsheet, or other mechanism Keyword Driven – based on the Keywords Hybrid - two or more of the patterns above are used
  • 6. Testing Process1. Analyzing your application The first step in planning your test is to analyze your application to determine your testing needs. What are your application’s development environments (for example Web, Java, or .NET)? You will need load Quick Test add-ins for these environments to enable Quick Test to identify and work with the objects in your application. What business processes and functionality do you want to test? To answer this, think about the various activities that customers perform in your application to accomplish specific tasks. Consider how to divide these business processes into smaller units. You will be creating actions based on these tasks. Smaller and more modular actions make your tests easier to read and follow, and help ease maintenance in the long run. At this stage, you can already begin creating test skeletons and adding actions to them.
  • 7. Testing Process (Contd.)2. Preparing the testing infrastructure Based on your testing needs, you determine what resources are required and create these resources, accordingly. Resources include shared object repositories containing test objects (which are representations of the objects in your application), function libraries containing functions that enhance Quick Test functionality, and so on. You also need to configure Quick Test settings so that Quick Test will perform the tasks you need, such as displaying a results report every time you run a test.
  • 8. Testing Process (Contd.)3. Building your tests and adding steps to them After the testing infrastructure is ready, you can begin building your tests. You can create one or more empty tests and add actions to them to create the testing skeletons. You associate your object repositories with the relevant actions, and associate your function libraries with the relevant tests, so that you can insert steps using keywords. You may also need to configure test preferences at this point.
  • 9. Testing Process (Contd.)4. Enhancing your test Inserting checkpoints into your test lets you search for a specific value of a page, object, or text string which helps you determine whether your application is functioning correctly. Broadening the scope of your test, by replacing fixed values with parameters, lets you check how your application performs the same operations with multiple sets of data. Adding logic and conditional or loop statements enables you to add sophisticated checks to your test.
  • 10. Testing Process (Contd.)5. Debugging, running, and analyzing your test You debug a test to ensure that it operates smoothly and without interruption. After the test is working correctly, you run it to check the behavior of your application. While running, Quick Test opens and performs each step in your test. You examine the test results to pinpoint defects in your application.
  • 11. Testing Process (Contd.)6. Reporting defectsIf you have Quality Center installed, you can report the defects youdiscover to a database. Quality Center is the HP test managementsolution.
  • 12. TOM & TOC Test Object Model is a set of object types or Classes that Quick Test uses to represents the objects in our application. A Test Object Class comprises of a list of properties that can individually (uniquely) identify objects of that class and a set of appropriate methods that Quick Test can record for it. * A Test Object is an object that Quick Test creates in the test to correspond to (represent) the actual object in the application. Quick Test uses the stored information about the object during the run session to identify and check the object. * A run-time object is the real (actual) object in the application or Web site on which methods are performed during the run session.
  • 13. Properties and Methods of Objects  The property set for each test object is created and maintained by Quick Test.  The property set for each run-time object is created and maintained by the object architect (creator) (Microsoft for Internet Explorer objects, Netscape for Netscape objects).  Similarly, methods of test objects are methods that Quick Test recognizes and records when they are executed (performed) on an object while we are recording and that Quick Test executes when the test or component runs.  Methods of Run-time object are the methods of the object in the application as defined by the object architect (creator). We can access and execute run- time object methods using the Object property.
  • 14. *Some Important Points Each test object method we execute (perform) while recording is recorded as a separate step in the test. When we run the test, Quick Test executes (performs) the recorded test object method on the run-time object. Properties of test object are captured from object while recording. Quick Test uses the values of these properties to identify runtime objects in the application during a run session. Property values of objects in the application may change .To make the test object property values match the property values of the run-time object, we can modify test object properties manually while designing the test or component or using SetTOProperty statements during a run session. We can also use regular expressions to identify property values. We can view or modify the test object property values that are stored with the test or component in the Object Properties or Object Repository dialog box.
  • 15. *Some Important Points (Contd.) We can view the syntax of the test object methods as well as the run-time methods of any object on our desktop using the Methods tab of the Object Spy. We can retrieve or modify property values of the TEST OBJECT during the run session by adding GetTOProperty and SetTOProperty statements in the Keyword View or Expert View. We can retrieve property values of the RUNTIME OBJECT during the run session by adding GetROProperty statements. If the available test object methods or properties for an object are not sufficient or they do not provide the functionality we need, we can access the internal methods and properties of any run-time object using the Object property. We can also use the attribute object property to identify Web objects in the application according to user-defined properties.