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

Monday, 20 February 2017

How to Record a QTP Script

Before you start recording your QTP script, you need to identify the TEST STEPS that need to be automated.

There are many possible scenarios to test. We will select a simple Test Scenario to begin with. "Check that user successfully logs in to the application on inputting valid Agent Name & Password"
Here are the test steps for this scenario
Test Step 1) Open Flight Reservation Application
Test Step 2) Enter Valid Agent Name
Test Step 3) Enter Valid Password
Test Step 4) Press Ok
Test Step 5) Close Application After Successful Login.
Lets automate these 5 steps in QTP

Steps to Record a Script in QTP

Step 1 In QTP click the record button.The Record and Run settings Dialog Box Opens.This box opens automatically each time you  begin recording a new test
Step 2 Record & Run settings shows a tabs corresponding to add-ins installed and loaded for your test.So, for example if you have SAP Add-in Installed and loaded you will see a SAP tab. The Windows Application tab is always available and be used for  environments, such as  Visual Basic, ActiveX, and terminal emulators.
For any Environment, the Record and Run settings can be classified into two generic groups
1) Record & Run on ANY window belonging to that particular environment
2)Record & Run on a SPECIFIC window belonging to that particular environment - which is the recommended Option
For the time being , lets stick to default settings .Once settings are done , QTP remembers and uses the same settings for additional record sessions on the same test, unless you manually open the Record and Run Settings dialog box to modify the settings.

How to use QTP IDE

This tutorial introduces the Quick Test Professional IDE.

To launch QTP, In Start Menu,
Choose Programs > Quick Test Professional Folder > Quick Test Professional or double click on the QTP icon 
The first time you start QTP, the Add-in Manager dialog box opens.
It Displays list of all installed add-in. You can select the add-in you want to load for the test and click "OK". You can later add or remove an Add-in after QTP has launched. For now stick to default and move ahead.
Recommendation you select only the add-ins required for your particular testing session . Because at times , different add-in interfere with each other degrading object identification and QTP's performance. QTP will remember the add-ins you load so that the next time you open QTP the add-ins you selected in the previous session are selected by default. Also, If you do not want this dialog box to open the next time you start QTP clear the Show on startup check box. Click OK.
The Start Page describes the new features in the current release-including links to more information about these features. It also provides links to Process Guidance, a tool that offers best practices for working with QTP. You can open a document from the list of Recently Used Files, or you can click the buttons in the Welcome! area to open new or existing documents. 

Flight Reservation Application in QTP Tutorials

This tutorial introduces Flight Reservation Application which will be used for hands-on for the rest of the tutorials.


Notes:
  • Flight Reservation Application comes pre-installed with QTP
  • Using Flight Reservation , you can book a flight between two cities,  even modify or delete and existing booking.
  • You may also fax a booking to a customer with your custom signature.
  • Flight Reservation has a  Reports and Graphs section which helps analyze the  ticket selling trends.
  • A small number of bookings is pre-populated for any new agent , so that you do not have to create test data.
  • The application has been designed to help learn all the features provided by QTP.At times , you may find this application buggy but your focus should not be technical accuracy of the application, but on its use as a  tool, to learn various features of QTP.

Quick Test Professional (qtp) Tutorial


HP QTP is an automated functional testing tool that helps testers to execute automated tests in order to identify any errors, defects or gaps in contrary to the expected results of the application under test. It was designed by Mercury Interactive and later on acquired by HP.  
 Why QTP the best testing tool?
  • It is an icon based tool that automates the regression and functional testing of an application
  • Both technical as well as non-technical tester can use QTP
  • It provides both features- Record as well as Playback
  • We can test Desktop as well as the Web based applications
  • It allows Business Process Testing (BPT)
  • QTP is based on scripting language VB script
  • It supports largest pool of software development environments like SAP, Oracle etc.. 
Advantages of QTP
  • It supports record and playback
  • It uses active screen to record scripts and helps tester in referring the screen object properties
  • It has excellent object identification process or mechanism
  • It supports different add-ins like Oracle, Java, SAP, NET, Web Forms, People soft, etc..
  • It allows you to enhance the existing tests even without the AUT through an active screen
  • It supports popular automation frameworks- keyword driven testing approach, modular testing approach, data driven testing approach, etc..
  • It comes with an inbuilt IDE
  • It can be integrated with Test management tools like Quality Center, Test Director, and Winrunner
  • Different types of suites like Smoke, Regression, Sanity can be easily maintained
  • It supports XML
  • Test reporting is possible through QTP for analysis purpose
  • Easy to maintain