QTP Interview material qtpdiscussions

98
QTP Interview Questions Introduction Quick Test Professional (QTP) is an automated functional Graphical User Interface (GUI) testing tool that allows the automation of user actions on a web or client based computer application. GA_googleFillSlot("OneStopTesting-MidBanner"); It is primarily used for functional regression test automation. QTP uses a scripting language built on top of VBScript to specify the test procedure, and to manipulate the objects and controls of the application under test. Contents: Testing Process Test Object Model Object Repositories Checkpoints QTP Recording Parameterizing Tests Keyword View Actions in QTP VBScript in QTP 1. What are the Features & Benefits of Quick Test Pro (QTP 8.0)? - Operates stand-alone, or integrated into Mercury Business Process Testing and Mercury Quality Center. Introduces next-generation zero-configuration Keyword Driven testing technology in Quick Test Professional 8.0 allowing for fast test creation, easier maintenance, and more powerful data-driving capability. Identifies objects with Unique Smart Object Recognition, even if they change from build to build, enabling reliable unattended script execution. Collapses test documentation and test creation to a single step with Auto-documentation technology. Enables thorough validation of applications through a full complement of checkpoints. 2. How to handle the exceptions using recovery scenario manager in QTP? - There are 4 trigger events during which a recovery scenario should be activated. A pop up window appears in an opened application during the test run: A property of an object changes its state or value, A step in the test does not run successfully, An open application fails during the test run, These triggers are considered as exceptions.You can instruct QTP to recover unexpected events or errors that occurred in your testing environment during test run. Recovery scenario manager provides a wizard that guides you through the defining recovery scenario. Recovery scenario has three steps: 1. Triggered Events 2. Recovery steps 3. Post Recovery Test-Run 3. What is the use of Text output value in QTP? - Output values enable to view the values that the application talks during run time. When parameterized, the values change for each iteration. Thus by creating output values, we can capture the values that the application takes for each run and output them to the data table. 4. How to use the Object spy in QTP 8.0 version?

description

QTP Interview material qtpdiscussions

Transcript of QTP Interview material qtpdiscussions

QTP Interview Questions IntroductionQuick Test Professional (QTP) is an automated functional Graphical User Interface (GUI) testing tool that allows the automation of user actions on a web or client based computer application.GA_googleFillSlot("OneStopTesting-MidBanner");It is primarily used for functional regression test automation. QTP uses a scripting language built on top of VBScript to specify the test procedure, and to manipulate the objects and controls of the application under test.Contents:Testing ProcessTest Object ModelObject RepositoriesCheckpointsQTP RecordingParameterizing TestsKeyword ViewActions in QTPVBScript in QTP

1. What are the Features & Benefits of Quick Test Pro (QTP 8.0)?- Operates stand-alone, or integrated into Mercury Business Process Testing and Mercury Quality Center. Introduces next-generation zero-configuration Keyword Driven testing technology in Quick Test Professional 8.0 allowing for fast test creation, easier maintenance, and more powerful data-driving capability. Identifies objects with Unique Smart Object Recognition, even if they change from build to build, enabling reliable unattended script execution. Collapses test documentation and test creation to a single step with Auto-documentation technology. Enables thorough validation of applications through a full complement of checkpoints. 2. How to handle the exceptions using recovery scenario manager in QTP? - There are 4 trigger events during which a recovery scenario should be activated. A pop up window appears in an opened application during the test run: A property of an object changes its state or value, A step in the test does not run successfully, An open application fails during the test run, These triggers are considered as exceptions.You can instruct QTP to recover unexpected events or errors that occurred in your testing environment during test run. Recovery scenario manager provides a wizard that guides you through the defining recovery scenario. Recovery scenario has three steps: 1. Triggered Events 2. Recovery steps 3. Post Recovery Test-Run 3. What is the use of Text output value in QTP? - Output values enable to view the values that the application talks during run time. When parameterized, the values change for each iteration. Thus by creating output values, we can capture the values that the application takes for each run and output them to the data table. 4. How to use the Object spy in QTP 8.0 version?- There are two ways to Spy the objects in QTP: 1) Thru file toolbar, In the File Toolbar click on the last toolbar button (an icon showing a person with hat). 2) True Object repository Dialog, In Object repository dialog click on the button object spy. In the Object spy Dialog click on the button showing hand symbol. The pointer now changes in to a hand symbol and we have to point out the object to spy the state of the object if at all the object is not visible. or window is minimized then, hold the Ctrl button and activate the required window to and release the Ctrl button. 5. How Does Run time data (Parameterization) is handled in QTP? - You can then enter test data into the Data Table, an integrated spreadsheet with the full functionality of Excel, to manipulate data sets and create multiple test iterations, without programming, to expand test case coverage. Data can be typed in or imported from databases, spreadsheets, or text files. 6. What is keyword view and Expert view in QTP? - Quick Testââ‚â„¢s Keyword Driven approach, test automation experts have full access to the underlying test and object properties, via an integrated scripting and debugging environment that is round-trip synchronized with the Keyword View. Advanced testers can view and edit their tests in the Expert View, which reveals the underlying industry-standard VBScript that Quick Test Professional

automatically generates. Any changes made in the Expert View are automatically synchronized with the Keyword View. 7. Explain about the Test Fusion Report of QTP? - Once a tester has run a test, a Test Fusion report displays all aspects of the test run: a high-level results overview, an expandable Tree View of the test specifying exactly where application failures occurred, the test data used, application screen shots for every step that highlight any discrepancies, and detailed explanations of each checkpoint pass and failure. By combining Test Fusion reports with Quick Test Professional, you can share reports across an entire QA and development team. 8. Which environments does QTP support? - Quick Test Professional supports functional testing of all enterprise environments, including Windows, Web,..NET, Java/J2EE, SAP, Siebel, Oracle, PeopleSoft, Visual Basic, ActiveX, mainframe terminal emulators, and Web services. 9. What is QTP? - Quick Test is a graphical interface record-playback automation tool. It is able to work with any web, java or windows client application. Quick Test enables you to test standard web objects and ActiveX controls. In addition to these environments, Quick Test Professional also enables you to test Java applets and applications and multimedia objects on Applications as well as standard Windows applications, Visual Basic 6 applications and.NET framework applications 10. Explain QTP Testing process? - Quick Test testing process consists of 6 main phases: 11. Create your test plan - Prior to automating there should be a detailed description of the test including the exact steps to follow, data to be input, and all items to be verified by the test. The verification information should include both data validations and existence or state verifications of objects in the application. 12. Recording a session on your application - As you navigate through your application, Quick Test graphically displays each step you perform in the form of a collapsible icon-based test tree. A step is any user action that causes or makes a change in your site, such as clicking a link or image, or entering data in a form. 13. 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 identify whether or not your application is functioning correctly. NOTE: Checkpoints can be added to a test as you record it or after the fact via the Active Screen. It is much easier and faster to add the checkpoints during the recording process. 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 statements to your test enables you to add sophisticated checks to your test. 14. Debugging your test - If changes were made to the script, you need to debug it to check that it operates smoothly and without interruption. 15. Running your test on a new version of your application - You run a test to check the behavior of your application. While running, Quick Test connects to your application and performs each step in your test. 16. Analyzing the test results - You examine the test results to pinpoint defects in your application. 17. Reporting defects - As you encounter failures in the application when analyzing test results, you will create defect reports in Defect Reporting Tool. 18. Explain the QTP Tool interface. - It contains the following key elements: Title bar, displaying the name of the currently open test, Menu bar, displaying menus of Quick Test commands, File toolbar, containing buttons to assist you in managing tests, Test toolbar, containing buttons used while creating and maintaining tests, Debug toolbar, containing buttons used while debugging tests. Note: The Debug toolbar is not displayed when you open Quick Test for the first time. You can display the Debug toolbar by choosing View — Toolbars — Debug. Action toolbar, containing buttons and a list of actions, enabling you to view the details of an individual action or the entire test flow. Note: The Action toolbar is not displayed when you open Quick Test for the first time. You can display the Action toolbar by choosing View — Toolbars — Action. If you insert a

reusable or external action in a test, the Action toolbar is displayed automatically. Test pane, containing two tabs to view your test-the Tree View and the Expert View ,Test Details pane, containing the Active Screen. Data Table, containing two tabs, Global and Action, to assist you in parameterizing your test. Debug Viewer pane, containing three tabs to assist you in debugging your test-Watch Expressions, Variables, and Command. (The Debug Viewer pane can be opened only when a test run pauses at a breakpoint.) Status bar, displaying the status of the test 19. How does QTP recognize Objects in AUT? - Quick Test stores the definitions for application objects in a file called the Object Repository. As you record your test, Quick Test will add an entry for each item you interact with. Each Object Repository entry will be identified by a logical name (determined automatically by Quick Test), and will contain a set of properties (type, name, etc) that uniquely identify each object. Each line in the Quick Test script will contain a reference to the object that you interacted with, a call to the appropriate method (set, click, check) and any parameters for that method (such as the value for a call to the set method). The references to objects in the script will all be identified by the logical name, rather than any physical, descriptive properties. 20. What are the types of Object Repositories in QTP? - Quick Test has two types of object repositories for storing object information: shared object repositories and action object repositories. You can choose which type of object repository you want to use as the default type for new tests, and you can change the default as necessary for each new test. The object repository per-action mode is the default setting. In this mode, Quick Test automatically creates an object repository file for each action in your test so that you can create and run tests without creating, choosing, or modifying object repository files. However, if you do modify values in an action object repository, your changes do not have any effect on other actions. Therefore, if the same test object exists in more than one action and you modify an objectââ‚â„¢s property values in one action, you may need to make the same change in every action (and any test) containing the object. 21. Explain the check points in QTP? - A checkpoint verifies that expected information is displayed in an Application while the test is running. You can add eight types of checkpoints to your test for standard web objects using QTP. A page checkpoint checks the characteristics of an Application. A text checkpoint checks that a text string is displayed in the appropriate place on an Application. An object checkpoint (Standard) checks the values of an object on an Application. An image checkpoint checks the values of an image on an Application. A table checkpoint checks information within a table on a Application. An Accessibilityy checkpoint checks the web page for Section 508 compliance. An XML checkpoint checks the contents of individual XML data files or XML documents that are part of your Web application. A database checkpoint checks the contents of databases accessed by your web site 22. In how many ways we can add check points to an application using QTP? - We can add checkpoints while recording the application or we can add after recording is completed using Active screen (Note : To perform the second one The Active screen must be enabled while recording). 23. How does QTP identify objects in the application? - QTP identifies the object in the application by Logical Name and Class. 24. What is Parameterizing Tests? - When you test your application, you may want to check how it performs the same operations with multiple sets of data. For example, suppose you want to check how your application responds to ten separate sets of data. You could record ten separate tests, each with its own set of data. Alternatively, you can create a parameterized test that runs ten times: each time the test runs, it uses a different set of data. 25. What is test object model in QTP? - The test object model is a large set of object types or classes that Quick Test uses to represent the objects in your application. Each test object class has a list of properties that can uniquely identify objects of that class and a set of relevant methods that Quick Test can record for it. A test object is an object that Quick Test creates in the test or component to represent the actual object in your application. Quick Test stores information about the object that will help it identify and check the object during the run session. 26. What is Object Spy in QTP? - Using the Object Spy, you can view the properties 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 and its properties and values in the Properties tab of the Object Spy dialog box. 27. What is the Diff between Image check-point and Bit map Check point? - Image checkpoints enable you to check the properties of a Web image. You can check an area of a Web page or application as a bitmap. While creating a test or component, you specify the area you want to check by selecting an object. You can check an entire object or any area within an object. Quick Test captures the specified object as a bitmap, and inserts a checkpoint in the test or component. You can also choose to save only the selected area of the object with your test or component in order to save disk Space. For example, suppose you have a Web site that can display a map of a city the user specifies. The map has control keys for zooming. You can record the new map that is displayed after one click on the control key that zooms in the map. Using the bitmap checkpoint, you can check that the map zooms in correctly. You can create bitmap checkpoints for all supported testing environments (as long as the appropriate add-ins are loaded). Note: The results of bitmap checkpoints may be affected by factors such as operating system, screen resolution, and color settings. 28. How many ways we can parameterize data in QTP? - There are four types of parameters: Test, action or component parameters enable you to use values passed from your test or component, or values from other actions in your test. Data Table parameters enable you to create a data-driven test (or action) that runs several times using the data you supply. In each repetition, or iteration, Quick Test uses a different value from the Data Table. Environment variable parameters enable you to use variable values from other sources during the run session. These may be values you supply, or values that Quick Test generates for you based on conditions and options you choose. Random number parameters enable you to insert random numbers as values in your test or component. For example, to check how your application handles small and large ticket orders, you can have Quick Test generate a random number and insert it in a number of tickets edit field. 29. How do u do batch testing in WR & is it possible to do in QTP, if so explain? - Batch Testing in WR is nothing but running the whole test set by selecting Run Test set from the Execution Grid. The same is possible with QTP also. If our test cases are automated then by selecting Run Test set all the test scripts can be executed. In this process the Scripts get executed one by one by keeping all the remaining scripts in Waiting mode. 30. If I give some thousand tests to execute in 2 days what do u do? - Adhoc testing is done. It Covers the least basic functionalities to verify that the system is working fine. 31. What does it mean when a check point is in red color? what do u do? - A red color indicates failure. Here we analyze the cause for failure whether it is a Script Issue or Environment Issue or a Application issue. 32. What is Object Spy in QTP? - Using the Object Spy, you can view the properties 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 and its properties and values in the Properties tab of the Object Spy dialog box. 33. What is the file extension of the code file & object repository file in QTP? - Code file extension is.vbs and object repository is.tsr 34. Explain the concept of object repository & how QTP recognizes objects? - Object Repository: displays a tree of all objects in the current component or in the current action or entire test (depending on the object repository mode you selected). We can view or modify the test object description of any test object in the repository or to add new objects to the repository. Quicktest learns the default property values and determines in which test object class it fits. If it is not enough it adds assistive properties, one by one to the description until it has compiled the unique description. If no assistive properties are available, then it adds a special Ordinal identifier such as objects location on the page or in the source code. 35. What are the properties you would use for identifying a browser & page when using descriptive programming? - Name would be another property apart from title that we can use. 36. Give me an example where you have used a COM interface in your QTP project? - com interface appears in the scenario of front end and back end. for eg:if you r using oracle as back end and front end as VB or any language then for better compatibility we will go for an interface. of which COM will be one among those interfaces. Create object creates handle to the instance of the specified object so that we program can use the methods on the specified object. It is used for implementing Automation(as defined by Microsoft).

37. Explain in brief about the QTP Automation Object Model. - Essentially all configuration and run functionality provided via the Quick Test interface is in some way represented in the Quick Test automation object model via objects, methods, and properties. Although a one-on-one comparison cannot always be made, most dialog boxes in Quick Test have a corresponding automation object, most options in dialog boxes can be set and/or retrieved using the corresponding object property, and most menu commands and other operations have corresponding automation methods. You can use the objects, methods, and properties exposed by the Quick Test automation object model, along with standard programming elements such as loops and conditional statements to design your program.

38.How do you test Siebel Application using QTP?In SWE section you need to add automation enable = True. Under the same time you need to use SWE Cmd = Auto On in the URL.39. How many types of actions are there in QTP?QTP supports three types of actions.1) non re-usable actions2) re usable actions3) external actions.40.How do you data drive an external spreed sheet?Import from external spreed sheet file by selecting import then from file. Which imports a tabbed text file or a single sheet from an existing Microsoft excel file in to the table. The sheet you import replace all data in a currently selected sheet.41. I want to open a notepad window without recording a test and I do not want to use system util. run command as well how do I do this?Another alternative to open a notepad is to use shell object. Check out with the following example.Dim aset a = wscript.create object (”wscript.shell”)a.run “notepad.exe”.42. how many types of recording modes in QTP? Describe each type with an examplewhere we use them?Three types of recording modes in QTP.1) NORMAL2) ANALOG MODE3) LOW LEVEL RECORDING MODE.43. How can we do the frame work in QTP?Depending upon the project and client requirements.44.Testing > QTP which features of QTP would you like improve? How would you go about implementing it?We are not implementing any concept in QTP.45.Explain how would you design the driver code for a keyboard based test script?Test script prepare in QTP.Keywords prepare in a excel sheet and objects description prepare in a notepad.46.What is the file extension of shared object repository?The shared object repository is .tsr extension.47. How to handle java tree in QTP?First of all we need to handle a java add- in to handle a java tree. In tools we have the object identification drop down list. There we have the java option to recognize the objects there select the tree option. Add the properties.48. How to fetch test data from data base by using QTP?In order to fetch test data from dat base we have to create a Adodb connection object to connect with data base. The syntax is create object (”Adodb.connectin”).49. What is the procedure to test flash application using QTP?Using multimedia add- in support.50. If a error aoccur during the execution of QTP scropt? How can we handle it?Using recovery scenario manager.51. How to merge the object repository files?

Using a repository merge tool. It is available with QT Plus Tool.52. Can we update the data base through QTP?Yes. We can.. How many tabs are available to view your test in a test pane and what are they?Two. These are tree and expert.53. What are the three main stages involved in testing with QTP?Creating test , running tests , analyzing test.54. Write a function to capture the pop-ups?Here I am writing steps handle pop-up exceptions.1) select the recovery scenario manager2) press the new scenario3) click next4) select the pop up exceptions5) select the pop window which we want to handle (capture) by clicking the spy button.6) press next7) select the specified options like key board or mouse operations press nextselect the specified options click default or press enter9) click next and uncheck add another recovery operation10) click next and select proceed next step11) click next and give the scenario name and description12) click next and select add scenario to current test and add scenario to default settings. Click finish after word save that scenario.55. What is meant by hot keys?A hot keys or a combination of keys on a computer board when pressed performs a task. The specific task performed by a particular hot key where is by operating system or application. However , there are commonly _ used hot keys.56. For a triangle (sum of two sides is greater than or equal to third side ), what is the minimal number of test cases required?Generally, we will calculate the number of test cases that depends on the particular module and its complexity. Minimum number of test = ( number of outputs) multiply (1.6) ( approx calculation)57. What are the flaws in water fall module and how overcome it? Science testing comes at last stage , there are huge chances of defect multiplication, defects will be migrated to every stage wastage of human recourses and time delays are also introduced.58. How does you test the web link which is changing dynamically?This could be tested through the automated test tools like Rational Robot and Win Runner .59. What is system testing ? And what are the different types of tests you perform in system testing?System testing is a type of block box testing means testing the application. After the integration testing, usually will do testing. Functionality, regression and performance test comes under this. 60. How do we know about the build we are going to test? Where do you see this?In the test plan we are going to have all details about who should test which test in a team which is given by team leader. According to that the entire group will do their testing.61. What did you do as a team leader?The roles of a leader,1) before the project gets started, will conduct one team meeting and discuss briefly about the upcoming project.2) will distribute the work among the team members and let them know which part of application they are going to test. 62. What test you perform mostly? Regression or Retesting in your testing process?Retesting is a repeated execution of the test case which results in a fault, with the aim that fault occurred, Regression testing is the renewed testing of already tested program or part of that modification with the aim that the modified had. 63. With out using GUI map editor can we recognize the application in win runner?With out using GUI map editor, we can recognize the application objects using a descriptive programming. 64.How does Run Time data ( Parameterization ) is handle in QTP?

You can then enter test data into data table, an integrated spreadsheet with the full functionality or excel, to manipulate test data sets and create multiple test iterations, with out programming, to expand test case coverage. Data can typed in or imported from data bases, spreadsheets or text files.65. What is keyboard view and expert view in QTP?Quick tests key board driven approach test automation experts have full access to the underlying test and object properties, via an integrated scripting and debugging environment that is round trip synchronized with the key bored view. Advance testers can view and edit their tests in expert view, which reveals the underlying industry standards vb script that QTP automatically generates. Any changes made in expert view are automatically synchronized with the keyboard view.66. Explain about the test fusion report of QTP?Once a tester runs a test, a test fusion report displays all the aspects of the test run a high level results over view, an expandable tree view of the test specifying exactly where application failures occurred, the test data used , applications screen shots per every step that highlight any discrepancies, and detailed explanation of each check point pass and failure, by combining test fusion reports with QTP you can share reports across an entire QA and development team.67.To which environments does QTP supports?QTP supports functional testing of all enterprise environments, including Windows, Web, .Net, Java, j2EE, SAP, Sieble, Oracle, Peoplesoft, Visual Basic, ActiveX, Mainframe terminal emulators and Web services.68.What is QTP?Quick Test is a graphical interface record-playback automation tool. It is able to work with any web, java or windows client application. Quick Teat enables you to test standard web objects and ActiveX controls. In addition to these environments QTP also enables you to test java applets and applications and multimedia objects on applications as well as standard windows applications, Visual Basic 6 applications and .Net framework applications69.How QTP recognizes Objects in AUT?Quick Test stores the definitions for applications objects in a file called the Object Repository. As you record your test, Quick Test will add an entry for each item you interact with. Each Object Repository entry will be identified by a logical name ( determined automatically by Quick Test), and will contain a set of properties ( type, name etc ) that uniquely identify each object.Each line in the Quick Test script will contain a reference to the object that you interacted with a call to the appropriate method ( set, click,check) and any parameters for method ( such as the valve for a call to the set method). The references to objects in the script will all be identified by the logical name, rather than any physical, descriptive properties.70.What are the types of Object Repositories in QTP?Quick Test has two types of object repositories for storing object information: shared object repositories and action object repositories. You can choose which type of object repository you want to use as the default type for new test.The object repository per-action mode is the default setting.In this mode, Quick Test automatically creates an object repository file for each action in your test sothat you can create and run tests without creating, choosing, or modifying object repository files.However, if you do modify values in an object repository, your changes do not have any effect on other actions. Therefore, if the same test object exists in more than one action and you modify an object’s property values in one action, you may need to make the same change in every action (and any test) containing the object.71.Explain the Check Points in Qtp?A checkpoint verifies that expected information is displayed in application while the test is running. You can add eight types of checkpoints to your test for standard web objects using QTP.1. A page checkpoint checks the characteristics of Application.2. A text checkpoint checks that a text string is displayed in the appropriate place on a Application.3.An object checkpoint ( standard) checks the values of an object on a Application.4.An image checkpoint checks the values of an image on a Application.5.A table checkpoint checks information with in a table an a Application.6. An accessibility check point checks the web page per Section 508 compliance7. An XML checkpoint checks the contents of individual XML data files or XML documents that are part of your web applications.8. A database checkpoint checks the contents of data bases accessed by you.

9. In how many ways we can add checkpoints to an application using QTP?We can add check points while recording the application or we add after recording is completed using Active Screen (NOTE: to perform the second one the active screen must be enable while recording).72. How does QTP identifies the object in the application?QTP identifies the object in the application by logical name and class. For ex. the Edit box is identified byLogical Name:PSOPTIONS_TIME20Class:Web Edit73.If an application name changes frequently that is while recording it has name “Window1″ and then while running it’s “Window2″, in this case how does QTP handles?QTP handle those situations by “Regular Expressions”.74.What is parameterizing tests?When you test application, you may want to check how it performs the same operations with multiple set of data . For ex: suppose you want to check hoe your application responds to ten separate test of data. You could record ten separate tests, each with it’s own set of data. Alternatively you can create a parameterized test that runs ten times: each time the test run, it uses a different set of data.75.what is test object model in QTP?The object model is a large set of obkject types or classess that quick test uses to represent the objects in your applications. Each test object lcass has a list of properties that can uniquely identifiy objects of that class and a set of relevant methods that quick test can record for it .A test object is an object that quick test creates in the test or component to represent the actual object in your application. Quick Test stores information about the object that will help it identify and checks the object during the run session. A run time object is the actual object in your websites or in the application on which methods are performed during the run session.When you perform an operation on your application while you recording.• Identifies the quick test test object classes that represents the objects on which you performed the operation and creates the appropriate the test objects. • Reads the current value of the object properties in your application and stores the list of properties and values with the test object. • Choose a unique name for the object generally using the values of one of its prominent properties. • Records the operation that you performed on the object using the appropriate quick test test object method. For Example, Suppose you click on a Find button with the following HTML source code:

Then quick test identified the objects that you clicks as a web button test objectIt creates a web button object with the name find, and records the following properties and values for the find web button:It also records that you performed a click method on the Web button.Quick test displays your s step in the keyboard view like this:Quick Test displays your step in the expert view like this:Browser(”Mercury Interactive”) . Page(” Mercury Interactive”).Web button(”Find”).Click76.What is Object Spy in QTP?Using the object Spy you can view the properties of any object in open application. You can use the object spy pointer to pint to an object. The object spy displays the select object’s hierarchy tree and its properties and values in the properties tab of the object spy dialog box.77. What is the difference between image check point and bitmap checkpoint?Image check point enable due to check the properties of web page. You can check an area of a web page or application as a bitmap.While creating a test of component, you specify the area you want to check by selecting an object you can check an entire object or an any area within an object. Quick Test captures the specified object as a bitmap, and inserts a checkpoint in the test or component.You can also use to save the selected area of the object with your test or component in order to save disk space for example, suppose you have a website that can display a map of a city the user specify that map has control keys for zooming.You can record the new map i.e displayed after one check on the control key that zooms in the map. Using the bitmap checkpoint, you can check that the map zooms in correctly.You can create bitmap checkpoint, all supported testing environments (as long as the appropriate add-ins

are loaded)Note: The result of bitmap check point may be effected by factors such as OS, Screen Resolutions and color settings.78. How many ways we can parameterize data in QTP?There are four types of parameters1. Test Action or Component Parameters enable you to use values passed from your test or component or values from other actions in your test.2. Data Table parameters enable you to create a data driven test or an act.That runs several times using the data you supply.In each repeation or iteration quick test uses a Different value from the data table.3. Environment variable parameters enable you to use variable values from other sources during the run sessions. these may be values you supply, or values that QTP generates for you based on conditions and options you choose.4. Random number parameters enable you to insert random numbers as values in your test or component.For example, to check how your application handles small and large ticked orders, you can have QTP generate a random number and insert it in a number of tickets edit field.79. How do you do Batch testing Winrunner and is it possible to do in QTP? If So, Explain?Batch testing in Winrunner is nothing but running the whole test set by selecting “Run Test Set” from the “Execution Grid”. The same is possible with QTP also. If our test cases are automated then by selecting ” Run test Set” all the test scripts can be executed.With this process the scripts get executed one by one keeping all the remaining scripts in “Waiting Mode”.80. If I give some 1000 tests to execute in 2days what do you do?Adhoc Testing is done. It covers the least basic functionalities to verify that the system is working fine.81. What does it mean when a checkpoint is in red color? What do you do?Red color indicates failure. Here we analyze the cause for the failure whether it is a script issue or environmental issue or a application issue.82. What do you call the Window Testing Director test lab?“Execution grid” it is placed from where we run all the manual/automated scripts.83. How do you create new test sets in test director?Login to TD.Click on “Test Lab” Tab.Select the desired folder under which we need to create the test set.(Test sets can be grouped as per module).Click on “New test set or Control N” Icon to create a test set.84. How to import data from a “.XLS” file to data table during run time?Data table .Import “…XLS filename…”Datatable .Import sheet (FileName, SheetSource, SheetDest)Datatable>Importsheet “C:\name.Xls”, 1, “name”85. How to export data present in Database to an “.XLS” file?Datatable .Export “…xls filename…”86. How to get traceability matrix from TD?87. How to import a test case present in “.XLS” file to TD under a test set?88. How to attach a file to Test director?89. What do you do to script when objects or removed from application?90. Syntax for how to call one script from another? and syntax to call one action in another?Run Action Action Name,[IterationMode, IterationRange, Parameters] here the actions becomes reusable on making this call to any action.IterationRange string not always required. Indicates the rows for which action iterations will be performed. Valid only when the iterationMode is rnfinteration. Enter the row range (i.e “1.7″): or enter rngAll to run iterations on all rows.If the actions called by the RunAction statement includes an ExitAction statement, the Run ActionStatement can return the value of the ExitActions Ret Val arguement.91. How to export QTP results to an “.xls” file?By default it creates an “XML” file and displays the results.92. What are the Differences between QTP and Winrunner?

QTP is Object based scripting (VB) where as WR is TSL ( C based language) Scripting.QTP supports “.Net” application automation not available in WRQTP has “Active Screen” support which captures the application not available in WR.QTP has “Data Table to store script values, variables which WR does not have.Using a “point and click” capability you can easily interface with objects, their.Definitions and create checkpoints after having record script without having.To navigate back to that location in your application like you have to with WinRunner.This greatly speeds up script development.93. How to add a Run-time parameter data sheet?Datatable.localsheetThe following example, uses the Local Sheet property to return the Local Sheet of the run time data table in order to add a parameter(column) to it.My parameter = DataTable. LocalSheet.AddParameter(”Time”, “5.45″)94. What scripting language is used in QTP?VB scripting95. Analyzing the Checkpoint resultsStandard Checkpoint : By adding standard checkpoints to your checks or components, you can compare the expected values of objects properties to the object’s current values during the run session, if the results doesn’t match the check point fails.96. How to create a Run-time property for an object?97. Table and DataBase(DB) checkpointsBy adding Table checkpoints to your tests or components we can check that a specified value is displayed in a cell in a table on your application. By adding DB checkpoints to your tests or components you can check the contents of database accessed by your application. The Results displayed for table and database checkpoints are similar. When you run tests or components QTP compares the expected results of the checkpoints to the actual results of the run session, if the results do not match the checkpoint fails.You can check that a specified value is displayed in a cell in a table by adding a table checkpoint to your test or component.For ActiveX tables, you can also check the properties of the table objects. To add a table checkpoint you use the checkpoint properties of dialog box. Table checkpoints are supports for web and ActiveX applications as well as for variety of External Add-in environments.You can use Database checkpoints in your tests or components to check databases accessed by your websites or application and to delete defects. You define a query on your database, and then you create a database checkpoint that checks the results of the query. Database checkpoints are supported for all environments supported by QTP by default as well as for variety of external Add-in environments.There are two ways to define a database query.a. Use Microsoft Query. you can Install Microsoft Query from the custom installation of Microsoft office.b. Manually define an Sql statement.The checkpoints time out option is available only when creating a table checkpoint.That is not available when creating a database checkpoints.98. Checking Bitmaps.You can check an area of a web page or application as bitmap. While creating a test or a components you specify the area you want to check by selecting an object. You can check an entire object or any area with in an object. QTP captures the specified object as bit map and inserts a checkpoint in the test or component.You can also choose to save only the selected area of the object with your test or component in order to save disk space.When you run the test or component QTP compares the object or selected area of the object currently displayed of the web page or the application with the bitmap stored when the test or component was recorded. If there are any differences QTP captures bitmap of the actual object and displays it with the expected bitmap in the details portion of the test results window.By comparing the two bitmaps(Expected and Actual) you can identify the nature of the discrepancy for more information on the test results of a checkpoint, see viewing checkpoint results.For example, suppose you have a website that can display a map of a city the user specify that map has control keys for zooming.

You can record the new map i.e displayed after one check on the control key that zooms in the map. Using the bitmap checkpoint, you can check that the map zooms in correctly.You can create bitmap checkpoint, all supported testing environments (as long as the appropriate add-ins are loaded)Note: The result of bitmap check point may be effected by factors such as OS, Screen Resolutions and color settings.97. Text/Text area checkpointIn the Text/Text area checkpoint propertied dialog box, you can specify the text to be checked as well as which text is displayed before and after the checked text. These configuration options are particularly helpful when the text string you want to check appears several times or when it could change in a predictable way during the run sessionNote: In windows based environment. If there is more than one line of text selected, the checkpoint summary pane display (complex value ) instead of the selected text for the checkpoint.QTP automatically displays the checked text in red and the text before and after the checked text in blue.For text area checkpoints only the text string captured from the defined area is displayed(Text before and text after are not displayed)To designate the parts of the captured string as checked text and other parts as text before and text after, click configure button.The configure text selection dialog box opens.Checking XML : XML (Extensible Markup language)is a Meta-Markup language for test documents i.e endorsed as a standard by the WC3.XML makes the complex data structure portable between different computer environments or operating systems and programming languages, facilitating the sharing of data.XML files contain text with simple tags that describe the data within an XML documents these describe the data content, but not the presentation of the data.Application that display and XML documents or file use either cascading style sheets of the XSL formatting objects(XSL-FO) to present the data.You can verify the data content of XML files by inserting XML checkpoints. A few common uses of XML checkpoints are described belowAn XML file can be a static data file i.e accessed in order to retrieve commonly used data for which a quick response time is needed. For example, country names, zip codes or area codes although this data can be changes over time it is normally quite static.You can use an XML checkpoint to validate that the data has not changed from one application released to another.An XML file can consists of elements with attributes and values(character data).There is parent and child relationship between the elements, and elements can have attributes associated with them. If any part of the structure(including data) changes the applications ability to process the XML file may be effected. Using an XML checkpoint you can check the content of an element to make sure that its, attributes, and values have not changed.XML files are often an intermediary that retrieves dynamically changing data from 1 system.The data is then accessed by another system using document type definitions(DTD) enabling the accessing system to read and display the information in the file. You can use an xml checkpoint and parameterize the captured data values in order to check an xml document or file whose data changes in a predictable way.XML documents and files often needed a well defined structure in order to be portable across platforms and development systems. One way to accomplish elements this is by developing and XML scheme which describes the structure of XML elements and data types. You can use scheme validation to check that each item of content in an xml file adheres to the scheme description of the elements in which the content is to be placed.

98.Object Repository types, which and when to use?Deciding which object repository mode to choose the default object repository mode and appropriate object repository mode for each test, you need to understand the differences between the two modes.In general; the object repository per action mode is easiest to use when you r creating simple recored and run tests, especially under the following conditions.You have only one or very few, tests that correspond to a given application interface or set of objects.

You do not expert to frequently modify test object properties. You generally create single action tests conversely, the shared object repository mode is generally the preferred mode when you have several test that test elements of the same application, interface or set of objects.you expert the object properties in your application to change from time to time and / or you regularly need to up date or modify test object properties.You often work with multi action tests and regularly use insert copy of action and insert called to action options.

99. Can we script any test case with out having object repository ? or using object repository is a must?No. You can script with out object repository by knowing the window handlers, spying and recognizing the objects logical names and properties available.

100. How to execute a WR script in QTP?a)TSL tset.run test, test path, test set.[parameters]–>used in QTP 6.0 for backward compatibility.Parameters:the test set with in quality center, in which test runs are stored. Note that this argument is relevant only when working with a test in a quality center project.When the test is not saved in a quality center, this parameter is ignored. Ex . TSL test.run test “D:\Tset1″B) TSL test.runtestex testpsth,run minimize, close app [parameter] TSL test.runtestex “C:\Win Runner/Tests/Basic_Flight”,True,False,”My Value”.Close App:indicates whether to close the WR application when the WR tset run ends.Parameter: up to 15 WR function argument.

101.How to handle time errors?On Error Resume next:causes execution to continue with the statement immediately following the statement that causes the run time error, or with the statement immediately following tie most recent call out of the procedure containing the on error resumes next statement.This allows execution to continue despite a run time error. you can then build the error handling routine inline with in the procedure using “Err” object MSG box “error no:” “&Err.no&”.”&Err.description” “&Err.source&Err.help context”.

102.How to change the run time value of property for an object?Set to property changes the property values used to identify an object during the test run. Only properties that are included in the test object description can be set.

103. How to retrieve the property of an object?Using GETRO property.

104. How to open any application during scripting?Systemutil, object used to open and close applications and processes during a run session. A systemutil.run statement is automatically added to your test when you run an application from the start menu or the run dialog box while recording a test. Ex. sytemutil.run “notepad.exe”systemutil.close descendant processes (closes all the processes open by QTP ).

105.Types of properties that QTP learns while recording?Mandatory and assistive. In addition to recording the mandatory and assistive properties specified in the object identification dialog box, QTP can also record a backup ordinal identifier for each test object. The ordinal identifier assigns the object in numerical value that indicates it’s order relative to other objects with an otherwise identical description (objects that have the same vales foe all properties specified in the mandatory and assistive property list). This ordered value enable QTP to create a unique description when the mandatory and assistive properties are not sufficient to do so.

106.What is the extension of script and object repository files?Object repository: .TSR, script: .MTS, Excel: default.ELS

107. How to suppress warning from the test result page?

From the test result viewer “tools > filters > warnings ” must be unchecked.

108.When we try to use test run option run from step, the browser is not launching automatically? Why?This is default behavior.

109. Does QTP is unicode compatible ?QTP 6.5 is not but QTP 8.0 is expected to be Unicode compatible by end of Dec 2004.

110.How to turn off QTP results after running a script?Go to tools > option > run tab and deselect view results when run session ends. But this suppresses only the result window, but a log will be created and can viewed manually which can not be restricted from getting created.

111.How to get font size of a web edit?

112. Is there any way to automatically update the data source name in data base checkpoints object when we migrate test to a new release?

113. How to verify the cursor focus of a certain field?Use focus property of GETRO property method

114.Any limitation to XML check points ?Mercury has determined that 1.4mb is the maximum size of XML file that QTP 6.5 can handle.

115. How to make arguments optional in a function?This is not possible as default VBS does not support this. Instead you can pass a blank scoring and have a default value if arguments are not required.

116. How to convert a sting to an integer?CInt ()—> a conversion function available.

117. Inserting a call to action is not importing all columns in data table of global sheet. Why?Inserting a call to action will only import the columns of the action called.

_________ ---------------------------------------------------------------------- --________________________

QTP IntroductionQuick Test Professional (QTP) is an automated functional Graphical User Interface (GUI) testing tool that allows the automation of user actions on a web or client based computer application.GA_googleFillSlot("OneStopTesting-MidBanner");It is primarily used for functional regression test automation. QTP uses a scripting language built on top of VbScript to specify the test procedure, and to manipulate the objects and controls of the application under test.

Contents:1) Testing Process2) Test Object Model3) Object Repository4) Checkpoints5) QTP Recording6) Parameterization7) Test Keyword View8) Actions

9) Descriptive Programming10)Framework Designing

_________ ---------------------------------------------------------------------- --________________________

Content: Testing Process Testing ProcessQTP (QuickTest Professional) lets you create tests and business components by recording operations as you perform them in your application.GA_googleFillSlot("OneStopTesting-MidBanner");Test - A compilation of steps organized into one or more actions, which we can use to verify that our application performs as expected. A test is composed of actions (3 kinds of actions are there in QTP Non-reusable action, Reusable action and External action).

1) First step is Planning Before starting to build a test, you should plan it and prepare the required infrastructure. For example, determine the functionality you want to test, short tests that check specific functions of the application or complete site.Decide how you want to organize your object repositories.

2)Second step in QTP is Creating Tests or ComponentsWe can create a test or component bya) Either recording a session on your application or Web site.As we navigate through the application or site, QuickTest graphically displays each step we perform as a row in the Keyword View. The Documentation column of the Keyword View also displays a description of each step in easy-to-understand sentences. A step is something that causes or makes a change in your site or application, such as clicking a link or image, or submitting a data form.OR b) Build an object repository and use these objects to add steps manually in the Keyword View or Expert View. We can then modify your test or component with special testing options and/or with programming statements.

3)Third step is Inserting checkpoints into your test or component. A checkpoint is a verification point that compares a recent value for a specified property with the expected value for that property. This enables you to identify whether the Web site or application is functioning correctly.

4)Fourth step isBroaden the scope of your test or component by replacing fixed values with parameters. To check how your application performs the same operations with different data you can parameterize your test or component.When you parameterize your test or component, QuickTest substitutes the fixed values in your test or component with parameters Each run session that uses a different set of parameterized data is called an iteration.We can also use output values to extract data from our test or component. An output value is a value retrieved during the run session and entered into the DataTable or saved as a variable or a parameter. We can subsequently use this output value as input data in your test or component.We can use many functional testing features of QuickTest to improve your test or component and/or add programming statements to achieve more complex testing goals.

5)Fifth step is running the testAfter creating test or component, we run it.Run test or component to check the site or application.When we run the test or component, QuickTest connects to your Web site or application and performs each operation in a test or component, checking any text strings, objects, or tables you specified. If we parameterized the test with Data Table parameters, QuickTest repeats the test (or specific actions in your test) for each set of data values we defined. Run the test or component to debug it.We can control the run session to identify and eliminate defects in the test or component. We can use theStep Into,Step Over, And Step Outcommands to run a test or component step by step. We can also set breakpoints to pause the test or component at pre-determined points. We can view the value of variables in the test or component each time it stops at a breakpoint in the Debug Viewer.

6)Sixth step is analyzing the resultsAfter we run test or component, we can view the results. ? View the results in the Results window.After running the test or component, we can view the results of the run in the Test Results window. We can view a summary of the results as well as a detailed report.? Report defects identified during a run session.If Quality Center is installed, we can report the defects fond out to a database. We can instruct QuickTest to automatically report each failed step in the test or component, or we can report them manually from the Test Results window.

_________ ---------------------------------------------------------------------- --________________________

QuickTest Window

The QuickTest window displays your testing documents in the document area.

You can work on one test and one or more function libraries simultaneously. (For your convenience, you can display one active document in the document area, or you can cascade or tile your open documents.) For more information, see Working With Multiple Documents.

Document Area

The document area of the QuickTest window can display the following document types:

Test. Enables you to create, view, and modify your test in Keyword View or Expert View.Function Library. Enables you to create, view, and modify functions (operations) for use with your test. For more information, see Working with User-Defined Functions and Function Libraries.

Key Elements in the QuickTest Window

In addition to the document area, the QuickTest window contains the following key elements:

QuickTest title bar. Displays the name of the active document. If changes have been made since it was last saved, an asterisk (*) is displayed next to the document name in the title bar.Menu bar. Displays menus of QuickTest commands.Standard toolbar. Contains buttons to assist you in managing your document.Automation toolbar. Contains buttons to assist you in the testing process.Debug toolbar. Contains buttons to assist you in debugging your document. (Not displayed by default)Edit toolbar. Contains buttons to assist you in editing your test or function library.Insert toolbar. Contains buttons to assist you when working with steps and statements in your test or function library.Tools toolbar. Contains buttons with tools to assist you in the testing process.View toolbar. Contains buttons to assist you in viewing your document.Action toolbar. Contains buttons and a list of actions, enabling you to view the details of an individual action or the entire test flow. (Not displayed by default)Document tabs and scroll arrows. Enables you to navigate open documents in the document area by

selecting the tab of the document you want to activate (bring into focus). When there is not enough space in the document area to display all of the tabs simultaneously, you can use the left and right arrows to scroll between your open documents.Keyword View. Contains each step, and displays the object hierarchy, in a modular, icon-based table.Expert View. Contains each step as a VBScript line. In object-based steps, the VBScript line defines the object hierarchy.Active Screen. Provides a snapshot of your application as it appeared when you performed a certain step during the recording session.Information pane. Displays a list of syntax errors found in your test and function library scripts.Missing Resources pane. Provides a list of the resources that are specified in your test but cannot be found, such as missing calls to actions, unmapped shared object repositories, and parameters that are connected to shared object repositories. (Not displayed by default)Data Table. Assists you in parameterizing your test. The Data Table contains the Global tab and a tab for each action.Debug Viewer pane. Assists you in debugging your document. The Debug Viewer pane contains the Watch, Variables, and Command tabs. (Not displayed by default)Status bar. Displays the status of the QuickTest application and other relevant information.

You can customize the layout of the QuickTest window by moving, resizing, displaying, or hiding most of the elements. QuickTest remembers your preferred layout settings and opens subsequent sessions with your customized layoutNote: By default, the QuickTest window uses the Microsoft Office 2003 theme. You can change the look and feel of the main QuickTest window, as required

_________ ---------------------------------------------------------------------- --________________________

The Keyword View The Keyword View enables you to create and view the steps of your test in a keyword-driven, modular, table format. The Keyword View is comprised of a table-like view, in which each step is a separate row in the table, and each column represents different parts of the steps. You can modify the columns displayed to suit your requirements.

You create and modify tests by selecting items and operations in the Keyword View and entering information as required. Each step is automatically documented as you complete it, enabling you to view a description of your test steps in understandable English.

Each operation performed on your application or Web site during a recording session is recorded as a row in the Keyword View.

For each row in the Keyword View, QuickTest displays a corresponding line of script in the Expert View. If you focus on a specific step in the Keyword View and switch to the Expert View, the cursor is located in that corresponding line of the test. Note: The Keyword View replaces the Tree View found in earlier versions of QuickTest. Many of the operations you could perform from the Tree View can be performed in a similar manner from the Keyword View. For example, right-click on a step to access context-sensitive options for that step, such as checkpoint, output value and action-related operations.

_________ ---------------------------------------------------------------------- --________________________

Expert View In the Expert View, QuickTest displays each operation performed on your application in the form of a script, comprised of VBScript statements. The Expert View is a script editor with many script editing

capabilities. For each object and method in an Expert View statement, a corresponding row exists in the Keyword View.

_________ ---------------------------------------------------------------------- --________________________

Function Libraries QuickTest provides a built-in editor that enables you to create and debug function libraries using the same editing features that are available in the Expert View. Each function library is a separate QuickTest document containing VBscript functions, subroutines, classes, modules, and so forth. Each function library opens in its own window, in addition to the test that is already open. You can work on one or several function libraries at the same time. After you finish editing a function library, you can close it, leaving your QuickTest session open. You can also close all open function libraries simultaneously.

_________ ---------------------------------------------------------------------- --________________________

Active Screen The Active Screen provides a snapshot of your application as it appeared when you performed a certain step during a recording session. Additionally, depending on the Active Screen capture options that you used while recording, the page displayed in the Active Screen can contain detailed property information about each object displayed on the page. To view the Active Screen, click the Active Screen button or choose View > Active Screen

_________ ---------------------------------------------------------------------- --________________________

Information Pane The Information pane provides a list of syntax errors in your test or function library scripts. To show or hide the Information pane, choose View > Information or click the Information button .

When you switch from the Expert View to the Keyword View, QuickTest automatically checks for syntax errors in your script, and shows them in the Information pane. If the Information pane is not currently displayed, QuickTest automatically opens it when a syntax error is detected.

You can double-click a syntax error to locate the error in the script or function library, and then correct it.

_________ ---------------------------------------------------------------------- --________________________

Missing Resources Pane The Missing Resources pane provides a list of the resources that are specified in your test but cannot be found, such as missing calls to actions, unmapped shared object repositories, and parameters that are connected to shared object repositories. To show or hide the Missing Resources pane, choose View > Missing Resources or click the Missing Resource button .

Each time you open your test or function library, QuickTest automatically checks that all specified resources are accessible. If it finds any resources that are not accessible, QuickTest lists them in the Missing Resources pane. If the Missing Resources pane is not currently displayed, QuickTest automatically opens it when a missing resource is detected.

You can double-click a missing resource to remap it or remove it. You resolve each type of missing resource in a different way

_________ ---------------------------------------------------------------------- --________________________

Automation Framework There are several test automation frameworks available, among these the selection is made based on the factors such as reusability of both the scripts and the test assets. The different test automation frameworks available are as follows,

1) Test Script Modularity2) Test Library Architecture3) Data-Driven Testing4) Keyword-Driven or Table-Driven Testing5) Hybrid Test Automation

1) Test Script Modularity The test script modularity framework is the most basic of the frameworks. It's a well-known programming strategy to build an abstraction layer in front of a component to hide the component from the rest of the application. This insulates the application from modifications in the component and provides modularity in the application design. When working with test scripts (in any language or proprietary environment) this can be achieved by creating small, independent scripts that represent modules, sections, and functions of the application-under-test. Then these small scripts are taken and combined them in a hierarchical fashion to construct larger tests. The use of this framework will yield a higher degree of modularization and add to the overall maintainability of the test scripts.

2) Test Library Architecture The test library architecture framework is very similar to the test script modularity framework and offers the same advantages, but it divides the application-under-test into procedures and functions (or objects and methods depending on the implementation language) instead of scripts. This framework requires the creation of library files (SQABasic libraries, APIs, DLLs, and such) that represent modules, sections, and functions of the application-under-test. These library files are then called directly from the test case script. Much like script modularization this framework also yields a high degree of modularization and adds to the overall maintainability of the tests.

3) Data-Driven Testing A data-driven framework is where test input and output values are read from data files (ODBC sources, CVS files, Excel files, DAO objects, ADO objects, and such) and are loaded into variables in captured or manually coded scripts. In this framework, variables are used for both input values and output verification values. Navigation through the program, reading of the data files, and logging of test status and information are all coded in the test script. This is similar to table-driven testing (which is discussed shortly) in that the test case is contained in the data file and not in the script; the script is just a "driver," or delivery mechanism, for the data. In data-driven testing, only test data is contained in the data files.

3.1) Merits of data-driven testing The merits of the Data-Driven test automation framework are as follows,a) Scripts may be developed while application development is still in progressb) Utilizing a modular design, and using files or records to both input and verify data, reduces redundancy and duplication of effort in creating automated test scriptsc) If functionality changes, only the specific "Business Function" script needs to be updatedd) Data input/output and expected results are stored as easily maintainable text records. Ø Functions return "TRUE" or "FALSE" values to the calling script, rather than aborting, allowing for more effective error handling, and increasing the robustness of the test scripts. This, along with a well-designed "recovery" routine, enables "unattended" execution of test scripts.3.2) Demerits of data-driven testing The demerits of the Data-Driven test automation framework are as follows,a) Requires proficiency in the Scripting language used by the tool (technical personnel)b) Multiple data-files are required for each Test Case. There may be any number of data-inputs and verifications required, depending on how many different screens are accessed. This usually requires data-files to be kept in separate directories by Test Casec) Tester must not only maintain the Detail Test Plan with specific data, but must also re-enter this data in the various required data-filesd) If a simple "text editor" such as Notepad is used to create and maintain the data-files, careful attention must be paid to the format required by the scripts/functions that process the files, or script-processing errors will occur due to data-file format and/or content being incorrect4) Keyword-Driven Testing This requires the development of data tables and keywords, independent of the test automation tool used to execute them and the test script code that "drives" the application-under-test and the data. Keyword-driven tests look very similar to manual test cases. In a keyword-driven test, the functionality of the application-under-test is documented in a table as well as in step-by-step instructions for each test. In this method, the entire process is data-driven, including functionality.4.1) Example In order to open a window, the following table is devised, and it can be used for any other application, just it requires just changing the window name. Test Table for Opening a Window Window Control Action Arguments Window Name Menu Click File, Open Window Name Menu Click Close Window Name Pushbutton Click Folder Name Window Name Verify Results Once creating the test tables, a driver script or a set of scripts is written that reads in each step executes the step based on the keyword contained the Action field, performs error checking, and logs any relevant information.4.2) Merits of keyword driven testing The merits of the Keyword Driven Testing are as follows,a) The Detail Test Plan can be written in Spreadsheet format containing all input and verification data.b) If "utility" scripts can be created by someone proficient in the automated tool’s Scripting language prior to the Detail Test Plan being written, then the tester can use the Automated Test Tool immediately via the "spreadsheet-input" method, without needing to learn the Scripting language.c) The tester need only learn the "Key Words" required, and the specific format to use within the Test Plan. This allows the tester to be productive with the test tool very quickly, and allows more extensive training in the test tool to be scheduled at a more convenient time.

4.3) Demerits of keyword driven testing The demerits of the Keyword Driven Testing are as follows, Ø Development of "customized" (Application-Specific) Functions and Utilities requires proficiency in the tool’s Scripting language. (Note that this is also true for any method) Ø If application requires more than a few "customized" Utilities, this will require the tester to learn a number of "Key Words" and special formats. This can be time-consuming, and may have an initial impact on Test Plan Development. Once the testers get used to this, however, the time required to produce a test case is greatly improved.

2.5) Hybrid Test Automation Framework The most commonly implemented framework is a combination of all of the above techniques, pulling from their strengths and trying to mitigate their weaknesses. This hybrid test automation framework is what most frameworks evolve into over time and multiple projects. The most successful automation frameworks generally accommodate both Keyword-Driven testing as well as Data-Driven scripts.This allows data driven scripts to take advantage of the powerful libraries and utilities that usually accompany a keyword driven architecture. The framework utilities can make the data driven scripts more compact and less prone to failure than they otherwise would have been. The utilities can also facilitate the

gradual and manageable conversion of existing scripts to keyword driven equivalents when and where that appears desirable. On the other hand, the framework can use scripts to perform some tasks that might be too difficult to re-implement in a pure keyword driven approach, or where the keyword driven capabilities are not yet in place. The following sections describe its architecture, merits and demerits. Our test automation framework is a Hybrid Test Automation Framework5.1) Hybrid Test Automation Framework Architecture The framework is defined by the Core Data Driven Engine, the Component Functions, and the Support Libraries. While the Support Libraries provide generic routines useful even outside the context of a keyword driven framework, the core engine and component functions are highly dependent on the existence of all three elements.The test execution starts with the LAUNCH TEST(1) script. This script invokes the Core Data Driven Engine by providing one or more High-Level Test Tables to CycleDriver(2). CycleDriver processes these test tables invoking the SuiteDriver(3) for each Intermediate-Level Test Table it encounters. SuiteDriver processes these intermediate-level tables invoking StepDriver(4) for each Low-Level Test Table it encounters. As StepDriver processes these low-level tables it attempts to keep the application in synch with the test. When StepDriver encounters a low-level command for a specific component, it determines what Type of component is involved and invokes the corresponding Component Function(5) module to handle the task. The Application Map is referred to App Map. This App Map in WRAFS is the Application Map file created from GUI Map of WinRunner All of these elements of the framework rely on the information provided in the App Map to interface or bridge the automation framework with the application being tested. The App Map is the only means by which the framework could identify the objects in the application under test. Each of these elements is described in more detail in the following sections. The following figure shows the diagrammatic representation of the Hybrid Test Automation Framework.

_________ ---------------------------------------------------------------------- --________________________

QTP Test Automation Framework TABLE OF CONTENTS

1 KEYWORD-DRIVEN SCRIPTING .......................................

2 CREATING NEW TEST .............................................

2.1 Test Creation in QTP ....................................................

2.2 Test Generation from QC ..................................................

3 TEST SETTINGS FOR KEYWORD-DRIVEN SCRIPTING .........................

3.1 Run Settings ............................................................

3.2 Resources Settings .......................................................

3.3 Environment Tab Settings .................................................

4 MANAGING OBJECT REPOSITORY .....................................

5 CALL TO FRAMEWORK .............................................

6 USAGE OF KEYWORDS .............................................

7 TEST RESULTS FOR A KEYWORD-DRIVEN SCRIPT ..........................

8 KEYWORD-DRIVEN SCRIPTING WITH A QUALITY CENTER CONNECTION .......

8.1 Connecting Quality Center ...............................................

8.2 Resource Files in Quality Center .......................................

8.3 Execution from Quality Center .......................................

8.3.1 Test Results from QC ..........................................................

1 Keyword-driven Scripting This document drives the settings and how to get started with keyworddrivenscripting in HP QuickTest Professional (QTP).

2 Creating New Test A new test in QTP can be created from QTP or can be generated fromQuality Center (QC).

2.1 Test Creation in QTP To create a new test, select File > New > Test or click on thetoolbar button. A blank test will be created. The test can then be savedin the preferred location.

2.2 Test Generation from QC New QTP tests can be generated corresponding to a particular test case by following the below steps. 1. Launch QC and login with valid credentials. 2. Navigate to the desired test in the Test Plan area. 3. Select the test and click on the ‘Design Steps’ tab in the righthandpane. 4. Click the dropdown button. Select Quick Test. 5. A new test script will be generated for the selected test and stored in the QC Test Plan section. The test can be accessed by selecting File > Open > Test or by clicking the toolbar button and navigating to the corresponding location in QC.

3 Test Settings for Keyword-driven Scripting

With the keyword-driven approach, the entire script is developed with keywords. The script is developed in a spreadsheet that is interpreted by the main driver script, which then uses the function library to execute the complete script. The QTP Settings.vbs file can be used to easily perform the test settings that are needed before proceeding with the Keyword-driven Scripting. This file associates the Function libraries, recovery scenarios, Environment Variables and the Object Repository files that are needed for a script. The QTP Settings file needs to be customized before usage. Edit the.vbs file in notepad and make the necessary changes (mentioned below) in the ‘Input Data’ section of the file. 1. Function Libraries – Specify the path where the Framework Files, Common Functions and the User Defined Functions are stored.

2. Recovery Scenario File - Specify the path of the file where the Recovery scenarios are placed. 3. Recovery Scenarios Name - Specify the names of the Recovery scenarios that need to be associated to the test script. 4. Environment File - Specify the path of the xml file for the Global Environment Variables. 5. Object Repository files - Specify the path of the Object Repository. Open the test script in QTP for which the settings are needed and double click on the QTP Settings.vbs file. This file will perform the preferred settings automatically. If there are multiple items of libraries, object repositories or global variables file, they can be specified as an array separated by ‘,’ Set the Flag envi_flag, recover_flag, repos_flag, library_flag to "Yes" if the corresponding files need to be associated to test, Else set it to "no"

libraries= array ("C:\WebFramework.vbs","C:\common functions.vbs") recovery_file= "C:\recover.qrs"recovery_name=array("Scenario1","Scenario2")environment_file= "C:\Environment.xml"repository_name= array ("C:\repository1.tsr","C:\repository2.tsr")

'NOTE: Please set the Flag to "Yes" if the files are to be associated totest, otherwise set it to "no"envi_flag="yes"recover_flag=" yes"repos_flag=" yes"library_flag=" yes" There should be just one Recovery file which holds all the Recovery scenarios. MultipleRecovery files cannot be used.There should be no unsaved tests currently open in QTP. The test script for which the test settings need to be done should be open in QTP. 3.1 Run Settings On the Run tab of the Test Settings dialog, 1. The Run one iteration only radio button will be selected. 2. The Disable Smart Identification during the run session the check box will be checked. 3. The Object Synchronization timeout value will be set as 20 seconds.

3.2 Resources Settings After the run settings are completed, the QTP Settings file associates the framework with the test script. Here, the path and the names of the framework files need to be specified in the QTP Settings file. The framework will be taken from the location specified and associated with the test as shown in the figure below.

3.3 Environment Tab Settings

QTP can insert a value from the environment variable list, which is a list of variables and corresponding values that can be accessed from the test. Throughout the test run, the value of an environment variable remains the same, regardless of the number of iterations, unless the value of the variable is changed programmatically in the script.Associating user-defined environment variables files with the test is handled by the QTP Settings file. The environment variables xml file will be taken from the path specified in the QTP Settings file and be associated with the test.

4 Managing Object Repository

QTP must learn the interface of an application to be able to work with it. It does this by learning the application's objects and their corresponding property values and storing these object descriptions in an object repository file. There are two types of object repositories:the shared object repository and the per-action object repository. The same object repository file can be used for multiple tests if the tests include the same objects. Object information that applies to many tests is kept in one central location and the read-only copy of the repository is associated with the tests. After the test settings are done, the QTP Settings file continues to associate the specified shared object repositories with the test. The objects from the shared repository will be uploaded and made available for the tests.

5 Call to Framework

The call to Keyword_Driver() needs to be specified in the Expert View as shown below. This will call the framework file associated with the test and perform the actions by interpreting the keywords specified in

the data table.

6 Usage of Keywords

The keywords should be entered in the global sheet of the data table of the test according to the syntax. To access the data table, choose View > Data Table or click on the toolbar button. Below is an example of a simple keyword-driven scripting.

7 Test Results for a Keyword-driven Script Test execution results can be viewed and analyzed as soon as the run session ends. To access the test results, choose Automation > Results or click on the toolbar button. The Results window will be displayed.

8 Keyword-driven Scripting with a Quality Center Connection

8.1 Connecting Quality Center An QC connection needs to be established if the test, or the object repository, framework, or the environment variables are stored in QC. Follow the steps given below to connect to QC. 1. Choose Tools > Quality Center Connection or click the Quality Center. Connection toolbar button . The Quality Center Connection dialog box opens. 2. In the Server box, type the URL of the Web server where QC is installed. 3. In the Server connection area, click Connect. After the connection to the server is established, the server's name is displayed in read-only format in the Server box. 4. In the Domain box, select the domain that contains the QC project. 5. In the Project box, select the project you want to work with. 6. In the User name box, type a user name for opening the selected project. 7. In the Password box, type the password for the selected project. 8. In the Project connection area, click Connect to connect QTP to the selected project.

After the connection to the selected project is established, the fields in the Project Connection area are displayed in read-only format. To automatically reconnect to the QC server and the selected project the next time you open QuickTest, select the Reconnect on startup check box.

8.2 Resource Files in Quality Center The resource files such as Framework Files, Shared Object Repositories, and Environment Variables that are associated with the test can be stored in QC and obtained during test execution.Function libraries of the file type .vbs, environment variables of file type .xml, and object repositories of file type .tsr can be placed in the attachment section of the Quality Center Test Plan area and associated with the test.

8.3 Execution from Quality Center Test scripts can also be executed from QC. The test results will be stored along with the test scripts and launched from QC. Before executing tests from QC, QTP has to be instructed to allow other HP products run tests. To do this, select Tools > Options in QTP. In the Run tab of the Options dialog, check the ‘Allow other HP products to run tests and components’ check box.

To execute test scripts from QC,1. Login to QC with valid user ID and password.2. Select the test or tests from the ‘Test Lab’ area.3. Click on the button in the right-hand pane.4. The Automatic Runner window will be displayed with the selected tests.5. Select the host machine on which the test needs to be run from the Run on Host field.6. Click the button to run only the highlighted test or the button to run all the selected tests.

8.3.1 Test Results from QC For the tests run from QC, results can be accessed by double-clicking on the test name in the Test Lab and clicking on the Launch Report button in the Test Instance Properties dialog. Test results related to every execution instance will be available in QC. Highlighting the specified instance and clicking on Launch Report will display the Results Summary window corresponding to the selected instance.

_________ ---------------------------------------------------------------------- --________________________

Automation Fundamental Concepts What is Test Automation ?

Software Test Automation is the process of automating the steps of manual test cases using an automation tool Or utility to shorten the testing life cycle with respect to time…

When application undergoes regression, some of the steps might be missed out or skipped which can be avoided in Automation…

Automation helps to avoid human errors and also expedite the testing process…

To implement the Test Automation detailed planning and effort is required

Automation saves time and effort which results in reduction of the Test life cycle…

Benefits of Automation- Consistency of Test Execution- Reducing cycle time of regression test cycles- Data driven testing- Repeatability- Coverage- Reliability- Reusability of test wares

Automation life cycle is a subset of the entire test life cycle…

Automation planning can be initiated in parallel to the test planning phase…

Factors to be considered in automation planning,Stability of AUT (Application under test)No of regression cycles to be performedCompatibility of App platform with testing toolsCost benefit analysis (ROI)Availability of skilled resources

_________ ---------------------------------------------------------------------- --________________________

Regression Testing & Automation When Automation is applicable?

Regression Testing Cycles are long and iterative.

If the application is planned to have multiple releases / builds

If it’s a long running application where in small enhancements / Bug Fixes keeps happening

Test Repeatability is required

_________ ---------------------------------------------------------------------- --________________________

Automation Object Model AOM Usage:

Users can use these objects, and their associated methods and properties, to write the programs that automatically configure Quick Test options and run tests

Explanation and demo on Object model

QTP Utility Functions - Database

msgbox My_dbquery(10)Dim My_Query, MyDesc

Public Function My_dbquery(ord_no)

DataConn = "C:\Das\tozip\lib\flight32.mdb"Set Conn = CreateObject("ADODB.Connection")ConStr = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & DataConn & ";"Conn.open(ConStr)

SQL = "SELECT Orders.Customer_Name FROM Orders Orders WHERE (Orders.Order_Number=" &ord_no &")"Set recordset = Conn.execute(SQL)while not recordset.EOFMy_Query = recordset("Customer_Name") recordset.movenextwend

recordset.closeConn.Close

set recordset = NothingSet Conn = Nothing

My_dbquery = My_QueryEnd Function

QTP Utility Functions – File Operations

File Creation

CreateFile "C:","mytextfile.txt","hi how are you?"Public Function CreateFile(filpath,filname,filcontent)xml_file = filpath & "\" & filnameDim fileobject, tfSet fileobject = CreateObject("Scripting.FileSystemObject")Set tf = fileobject.CreateTextFile(xml_file, True)tf.Write (filcontent) tf.Close

End Function

File Operations

Function CheckFileExists (FilePath)' check if file existCheckFileExists = oFSO.FileExists(FilePath)End Function

' *************************************************************************************' Write data to file

' Parameters:' FileRef - reference to the file' str - data to be written to the file' *************************************************************************************Function WriteToFile (byref FileRef,str)' write str to the text fileFileRef.WriteLine(str)End Function

' *************************************************************************************' Read line from file

' Parameters:' FileRef - reference to the file' *************************************************************************************

Function ReadLineFromFile (byref FileRef)' read line from text fileReadLineFromFile = FileRef.ReadLineEnd Function

' *********************************************************************************************' Closes an open file.' Parameters:' FileRef - reference to the file' *********************************************************************************************Function CloseFile (byref FileRef)FileRef.closeEnd Function

'*********************************************************************************************' Opens a specified file and returns an object that can be used to ' read from, write to, or append to the file.

' Parameters:' FilePath - location of the file and its name' mode options are:' ForReading - 1' ForWriting - 2' ForAppending - 8' *************************************************************************************

Function OpenFile (FilePath,mode)' open the txt file and retunr the File object

set OpenFile = oFSO.OpenTextFile(FilePath, mode, True)End Function

' *********************************************************************************************' Closes an open file.

' Parameters:' FilePathSource - location of the source file and its name' FilePathDest - location of the destination file and its name' *********************************************************************************************Sub FileCopy ( FilePathSource,FilePathDest)' copy source file to destination fileoFSO.CopyFile FilePathSource, FilePathDestEnd Sub

' *************************************************************************************' Delete a file.

' Parameters:' FilePath - location of the file to be deleted' *************************************************************************************Sub FileDelete ( FilePath)' copy source file to destination fileoFSO.DeleteFile ( FilePath)End Sub

' ************** Example of calling the file functions **********************FilePath1 = "D:\temp\FSO\txt1.txt"FilePath2 = "D:\temp\FSO\txt2.txt"FilePathDiff = "D:\temp\FSO\txt_diff.txt"

FilePath = "D:\temp\FSO\txt.txt"

set fold = FolderCreate ( "D:\temp\FSO\new")set f = OpenFile(FilePath,8)' = WriteToFile(f,"test line")d = CloseFile(f)

set f = CreateFile(FilePath)

Fexist= CheckFileExists(FilePath)d = WriteToFile(f,"first line")d = WriteToFile(f,"second line")d = CloseFile(f)FileCopy "D:\temp\FSO\txt.txt","D:\temp\FSO\txt1.txt"FileDelete "D:\temp\FSO\txt1.txt"

Excel Sheet Operations

Set objExcel = CreateObject("Excel.Application")strPathExcel = "C:\Documents and Settings\Anandana\Desktop\QTPSamples\Reading From Excel Sheets\test.xls"objExcel.Workbooks.open strPathExcelSet objSheet = objExcel.ActiveWorkbook.Worksheets(1)

For i=1 to 3'For j=1 to 2'msgbox Trim(objSheet.Cells(i, j).Value)' NextDataTable.SetCurrentRow iDataTable("SL_No", dtGlobalSheet)=Trim(objSheet.Cells(i, 1).Value)DataTable("Name", dtGlobalSheet)=Trim(objSheet.Cells(i, 2).Value)

Next

objExcel.Application.QuitSet objExcel=Nothing

Email Operations

SendMail "[email protected]","hi","how r u",""

Function SendMail(SendTo, Subject, Body, Attachment)

Set ol=CreateObject("Outlook.Application")Set Mail=ol.CreateItem(0)Mail.to=SendToMail.Subject=SubjectMail.Body=BodyIf (Attachment <> "") Then

Mail.Attachments.Add(Attachment)

End IfMail.Sendol.QuitSet Mail = NothingSet ol = Nothing

End Function

XML

Option Explicit

Dim xmlFilePathDim xmlDocDim nodeBook, nodeId, sIdXml, currNode

msgbox GetXMLAttribute("C:\QTP 8.2\Day 4\database.xml", "database/contact", "company")

msgbox GetXMLElement("C:\QTP 8.2\Day 4\database.xml", "database/contact[4]", "phone")

'********************************************************************************' Function UpdateXMLAttribute'********************************************************************************Public Function UpdateXMLAttribute(xmlFilePath, xmlElement, xmlAttribute, NewXMLValue)

LoadXMLFile(xmlFilePath)ReplaceAttributeValue xmlElement, xmlAttribute, NewXMLValueSaveXMLFile (xmlFilePath)

Set xmlDoc = NothingEnd Function'********************************************************************************' End of Function UpdateXMLAttribute'********************************************************************************'********************************************************************************' Function UpdateXMLElementData'********************************************************************************Public Function UpdateXMLElementData(xmlFilePath, ElementPath,ElementName, ElementIndex, NewElementData)

Dim CurrentNode, CurrentValue

LoadXMLFile(xmlFilePath)Set CurrentNode = xmlDoc.selectSingleNode(ElementPath)Set CurrentValue = CurrentNode.getElementsByTagName(ElementName)CurrentValue.item(ElementIndex).text = NewElementDataSaveXMLFile (xmlFilePath)Set xmlDoc = Nothing

End Function'********************************************************************************' End of Function UpdateXMLElementData'********************************************************************************' Function GetXMLAttributePublic Function GetXMLAttribute(xmlFilePath, xmlElement, xmlAttribute)

Dim AttributeValueLoadXMLFile(xmlFilePath)AttributeValue = GetAttributeValue(xmlElement, xmlAttribute) Set xmlDoc = NothingGetXMLAttribute = AttributeValue

End Function'********************************************************************************' End of Function GetXMLAttribute'********************************************************************************' Function LoadXMLFile'********************************************************************************Public Function LoadXMLFile(Path)

Set xmlDoc = CreateObject("Msxml2.DOMDocument.3.0")xmlDoc.validateOnParse = FalsexmlDoc.async = FalsexmlDoc.load(Path)

End Function'********************************************************************************' End of Function LoadXMLFile'********************************************************************************'********************************************************************************' Function GetXMLElement'********************************************************************************Public Function GetXMLElement(xmlFilePath, xmlNode, xmlElement)Dim CurrentNode, CurrentValueLoadXMLFile(xmlFilePath)

Set CurrentNode = xmldoc.selectSingleNode(xmlNode)Set CurrentValue = CurrentNode.getElementsByTagName(xmlElement)GetXMLElement = CurrentValue.item(0).TextEnd Function

'********************************************************************************' End of Function GetXMLElement'********************************************************************************

MSDN Integration

extern.Declare micLong,"GetForegroundWindow","user32.dll","GetForegroundWindow"

hwnd = extern.GetForegroundWindow()

If hwnd = 0 ThenMsgbox "Window Not Found"ExitRunElseMsgbox "Window Found with Handle ”&hwnd

End ifTimed Msg-Box

MsgBoxTimeout (“Sample Text”,”Timed MsgBox”, 10)

Public Sub MsgBoxTimeout (Text, Title, TimeOut)Set WshShell = CreateObject("WScript.Shell")WshShell.Popup Text, TimeOut, TitleEnd Sub

Text Location

l = -1 ‘Leftt = -1 ‘Topr = -1 ‘Rightb = -1 ‘Bottom

Succeeded = TextUtil.GetTextLocation("16",0,l,t,r,b) If Not Succeeded Then MsgBox "Text not found" else x = (l+r) / 2 y = (t+b) / 2 Set dr = CreateObject("Mercury.DeviceReplay") dr.MouseClick x, y, 0 End If

Keystroke Functions

'An example that presses a key using DeviceReplay.Set obj = CreateObject("Mercury.DeviceReplay")

Window("Notepad").Activate

obj.PressKey 63

keyboard Values

Mouse Click Events

Solution: Use the custom user-defined sub RightMenuSelectNOTE:This function/sub is not part of Astra QuickTest/QuickTest Professional. It is not guaranteed to work and is not supported by Mercury Interactive Technical Support. You are responsible for any and all modifications that may be required.

The RightMenuSelect function selects the menu item at index "idx" from the pop-up menu that appears when right-clicking on an object.

Sub RightMenuSelect (menu, idx)Set obj = CreateObject("Mercury.DeviceReplay")Set WshShell = CreateObject("WScript.Shell")menu.MakeObjVisiblex = menu.QueryValue("abs_x")y = menu.QueryValue("abs_y")obj.MouseClick x+5, y+5, 2For i = 1 To idxWshShell.sendKeys "{DOWN}"NextWshShell.sendKeys "{ENTER}"set WshShell = nothingSet obj = nothingEnd Sub

Device Replay object to perform a right click operation on any object by retrieving the coordinates of the object. Sub RightClickObj(Obj, Offset_x, Offset_y)

 x_coord = Obj.GetROProperty("abs_x") y_coord = Obj.GetROProperty("abs_y") Set dr = CreateObject("Mercury.DeviceReplay") dr.MouseClick x_coord + Offset_x, y_coord + Offset_y, 2

End Sub

HTML FunctionsSyntax:Browser(“Browser”).Page(“Page").Object.documentElement.innerHTML

Example:htmlSrc = Browser("Welcome to HP-GDIC").Page("Welcome: Mercury Tours").Object.documentElement.innerHTML

Msgbox htmlSrc

System Operations

Running and Closing Applications Programmatically Syntax:SystemUtil.Run “file, [params], [dir] “

Example:SystemUtil.Run “notepad.exe myfile.txt “

Clipboard ObjectsThe object has the same methods as the Clipboard object available in Visual Basic:ClearGetDataGetFormatGetTextSetDataSetTextSet cb = CreateObject("Mercury.Clipboard")cb.Clear cb.SetText "TEST" MsgBox cb.GetText

_________ ---------------------------------------------------------------------- --________________________

VB Script basics Data Types

Variables & ConstantsDeclaring VariablesNaming Restrictions Scope and Lifetime of VariablesAssigning Values to VariablesScalar Variables and Array Variables Creating Constants

Operators

Conditions & LoopingConditional StatementsIf...Then...Else statement Select Case statement LoopingDo...Loop: Loops while or until a condition is true.

While...Wend: Loops while a condition is true.

For...Next: Uses a counter to run statements a specified number of times.

For each...Next: Repeats a group of statements for each item in a collection or each element of an array.

Functions

Key areas in QTPAbout the script structureObject Identification MechanismActive screen customizationActions (Simple, Nested, External, Re-usable)Parameterization (Different Types)Checkpoints (Programmatic Methodology)Descriptive programmingAdv. Synchronization pointsException HandlingMicrosoft Automation Object Model

About the script structure

QTP Functionssample 1 - Capturing the snapshot of the combo box controlWindow("Flight Reservation").WinComboBox("Fly From:").CaptureBitmap "C:\mybmp.bmp",true

'sample 2 - Capturing the snapshot of the entire windowWindow("Flight Reservation").CaptureBitmap "C:\mybmp.bmp"

'sample 3 - Getting all the items from the combo boxMy_Cnt = Window("Flight Reservation").WinComboBox("Fly From:").GetItemsCountmsgbox My_Cnt

For i = 1 to My_Cnt' the combo box item index will start from zero.My_item = Window("Flight Reservation").WinComboBox("Fly From:").GetItem(i-1)Msgbox My_itemNext

'sample 4 - Getting the entire content of the combo boxVar_Content = Window("Flight Reservation").WinComboBox("Fly From:").GetContentMsgbox Var_Content

'sample 5 - Selecting an item from the combo - Using IndexWindow("Flight Reservation").WinComboBox("Fly From:").Select(5)

'sample 6 - Selecting an item from the combo - Using ValueWindow("Flight Reservation").WinComboBox("Fly From:").Select("London")

'sample 7 - Selecting an item from the combo - Using VariableVar_Item = "Zurich"Window("Flight Reservation").WinComboBox("Fly From:").Select(Var_Item)

'sample 8 - Getting the value of selected itemVar_Sel = Window("Flight Reservation").WinComboBox("Fly From:").GetSelectionMsgbox Var_Sel

'sample 9 - Edit box functionsWindow("Flight Reservation").ActivateCall wait(8)Window("Flight Reservation").WinEdit("Name:").Set "DasDas“Call wait(8)Window("Flight Reservation").WinEdit("Name:").Type "tryhard“Call wait(8)

Window("Flight Reservation").WinEdit("Name:").Set "DasDas“Call wait(8)Window("Flight Reservation").ActivateCall wait(8)Window("Flight Reservation").ActiveX("MaskEdBox").Set "111111“

QTP Functions' Some FUM's (Frequently Used Methods)

'GetROPropertyVar_Text = Window("Flight Reservation").WinEdit("Name:").GetROProperty("AttachedText")Msgbox Var_TextVar_Enab = Window("Flight Reservation").WinEdit("Name:").GetROProperty("Enabled")Msgbox Var_Enab

'ExistIf Window("Flight Reservation").WinEdit("Name:").Exist(5) ThenMsgbox "The Editbox exists"ElseMsgbox "The Editbox does not exist"End if

'WaitWait(10) ' The QTP will sleep for 10 seconds

'MsgboxMsgbox "Hello QTP"

Object Identification Mechanism

Object IdentificationSimple script for object identificationRenaming the logical name (‘ok’ to ‘cancel’)Change the text property of the control (“OK” to “Cancel”)Properties to be avoided in Mandatory Prop List (“Hwnd”,“OK_2“)Class Identification Mechanism (e.g. Winbutton up to the first level hierarchy QTP can classify)

User Defined & Virtual ObjectsDemo on User Defined objects and mapping them with the standard classDemo on virtual objects…

Active screen customizationSetting up the active screen with different options

Actions (Simple, Nested, External, Re-usable)

Standalone ActionsNested ActionsIntegration of Actions (Call from One Action to other)Driver Action (Main Action)

Re-usable ActionsExternal Call for ActionsAction Parameter

ParameterizationClassifications of ParameterizationTest and Action ParametersData Table (Global & Action Specific)Environment variablesRandom Number

Demo on data table parameter using two parameters

Checkpoints (Programmatic Methodology)Standard checkpoint

Update run

Descriptive ProgrammingEntering Programmatic Descriptions Directly into StatementsBrowser("Mercury Tours").Page("Title:=Mercury Tours").WebEdit("Name:=Author", "Index:=3").Set "Mark Twain"

Using Description Objects for Programmatic Descriptions Set MyDescription = Description.Create() MyDescription("text").Value = "OK" MyDescription("width").Value = 50 Window("Error").WinButton(MyDescription).Click

Adv. Synchronization PointsDemo: using tool menu optionsDemo: wait propertyDemo: programmaticallyDemo: wait & exist

Exception Handling

Recovery Scenario ConceptsRecovery Process Trigger EventsRecovery OperationPost-recovery Operation

_________ ---------------------------------------------------------------------- --________________________

Working with Test Objects in QTP Test Object Model Conceptualization

Applying the Test Object Model Concept

Viewing Object properties Using Object Spy

Demo on Test Object Model features of QTP

Mandatory properties:For each Test Object class, Quick Test has list of mandatory properties…

Assistive properties:Quick Test adds assistive properties one by one to the description until it has compiled a unique description…

Ordinal identifier:If the combination of all defined mandatory and assistive properties is not sufficient to create a unique test object description, Quickest also records the value for the selected ordinal identifier.

Smart Identification:A Smart Identification definition can help QuickTest identify an object, if it is present, even when the recorded description fails due to changes in one or more property values.

Test Object ModelHow Quick Test Identifies objects during the test run?Quick test searches for a run time object that exactly matches the description of the test object from the object repository it learned while recording…

Test Object :Test Object is an object that Quick Test creates in the test to represent the actual object in the application…

Run Time Object :It is the actual object in the web site or application on which methods are performed during the test run..

Test Object Model

Viewing object properties by Object Spy :Using the object spy, users can view the properties of any object in an open application…

Viewing object methods and methods syntax using object spy…

Object Spy enables users to view both the run time object methods, the test object methods associated with an object and to view the syntax for a selected method…

Managing Test objects

Object Repository Dialog box :- Per Action Mode- Shared Action Mode

Managing Test objects

Identifying the Object :- Logical Name- Class

Viewing the Objects Property :

Type - Constant, Data table property ,variable parameter.Property - Name of the PropertyValue - The value of the property- Smart Identifier- Add/ Remove

Adding or Viewing New objects :- Add New Objects - Object spy- Saves all the object properties and values from a per action object repository to a separate file for use as a shared object repository in another test…- Modify the Test object properties- Finding the Test object properties- Modifying the Logical NamesObject Properties Modification Users can modify the properties of the temporary version of the object during the test run with out affecting the permanent values in the object repository - SetTOProperty- GetTOProperty Main phases of QTP testing ProcessPreparing to record Recording a session on the application Executing the testEnhancing your test Debugging your test Re-executing the tests on a new version of the application Analyzing the test results Reporting defects Types of Checkpoints (Verification Process)

Parameterising Tests

Different Types of Parameters Test & Action ParametersData TableEnvironment VariableDefining a Data Table ParameterAdding Parameter Values to a Data TableModifying Steps Affected by ParameterizationRunning and Analyzing a Parameterized Test

Creating Output Values

Creating an Output Value Running and Analyzing a Test with Output Values

Using Regular Expressions

Regular Expression Syntax Working with Regular Expressions Running and Analyzing a Test with Regular Expressions

Dividing Tests into Multiple Actions

Working with Multiple Actions Creating New Actions Inserting Existing Actions Parameterizing an Action Running and Analyzing a Multi-action Test Different Types of Actions

Recovery Scenarios

Defining Recovery Scenarios Creating a Recovery File Understanding the Recovery Scenario Manager Dialog Box Understanding the Recovery Scenario Wizard Welcome to the Recovery Scenario Wizard Screen Select Trigger Event Screen

Specify Pop-up Window Conditions Screen Select Object Screen Set Object Properties and Values Screen Select Test Run Error Screen Select Processes Screen Recovery Operations Screen Recovery Operation Screen Recovery Operation – Click Button or Press Key Screen Recovery Operation – Close Processes Screen Recovery Operation – Function Call Screen Post-Recovery Test Run Options Screen Name and Description Screen Completing the Recovery Scenario Wizard Screen Saving the Recovery Scenario in a Recovery File Managing Recovery Scenarios

_________ ---------------------------------------------------------------------- --________________________

Automation Fundamental Concepts What is Test Automation ?

Software Test Automation is the process of automating the steps of manual test cases using an automation tool Or utility to shorten the testing life cycle with respect to time…

When application undergoes regression, some of the steps might be missed out or skipped which can be avoided in Automation…

Automation helps to avoid human errors and also expedite the testing process…

To implement the Test Automation detailed planning and effort is required

Automation saves time and effort which results in reduction of the Test life cycle…

Benefits of Automation- Consistency of Test Execution- Reducing cycle time of regression test cycles- Data driven testing- Repeatability- Coverage- Reliability- Reusability of test wares

Automation life cycle is a subset of the entire test life cycle…Automation planning can be initiated in parallel to the test planning phase…Factors to be considered in automation planning,Stability of AUT (Application under test)No of regression cycles to be performedCompatibility of App platform with testing toolsCost benefit analysis (ROI)Availability of skilled resources

Regression Testing & Automation

When Automation is applicable?

Regression Testing Cycles are long and iterative.

If the application is planned to have multiple releases / builds

If it’s a long running application where in small enhancements / Bug Fixes keeps happening

Test Repeatability is required

QTP At a Glance …..

Introduction to QTP (QuickTest Professional)“The Mercury advanced keyword-driven testing solution”Technologies SupportedDefault Support 1. Standard Windows applications2. Web objects / Applications3. ActiveX controls4. Visual Basic applications

Additional QuickTest add-ins Support,1. Java 2. Oracle 3. SAP Solutions,4. .NET Windows5. Web Forms, 6. Siebel, 7. PeopleSoft, 8. Web services, and terminal emulator applications.

Testing Process with QTP

Quick Test Pro involves 3 main stages:Creating Test scripts

Running Tests

Analyzing Test Results

Creating Tests Create a test script by recording a manual test scenario on the AUT (Application Under Test) using QTP.

Quick Test Pro graphically displays each step users perform in the form of a collapsible, icon based tree view in QTP’s Keyword View.

Running Tests & Analyzing Test ResultsRunning Tests:Once the test scripts are recorded / created, next step is to execute them…While running (executing) the tests Quick Test Pro connects to the web site or AUT and performs each operation in the test as performed manually while recording / creating tests (test scripts)…Debugging Test : To identify and eliminate the defects in the test scripts. Analyzing Test Results: Once the test scripts are executed, test results and the summary can be viewed for result analysis.

Add-in Manager

Default Add-insActiveXVisual basicWeb

Other Add-InsSiebelJavaSAPOracle .Net and many more

QTP’s Add-in Manager facilitates the users to select the technology / environment from variety of environments suitable for the AUT (Application Under Test)

Once an add-in is loaded, users can record that application in its supported environment and thus QTP recognizes the objects specific to the application under test (AUT) as loaded through Add-in Manager.

It is critical for the users to know the development technologies / environment of AUT, and load right Add-Ins while invoking Quick Test Pro.

Record & Run Modes

Recording ModesNormalAnalogLow level

Run ModesNormalFastUpdateOptions -> GeneralBest Practices for General Options:Deselect all check boxes except “Save data for integrating with performance testing …” and “Display Add-in Manager on startup” which is default setting.

Click on “Restore Layout” button to reset screens to the initial setting when QuickTest was first installed.

Options --> Run

Best Practices for Options for Run Mode:Run Mode as Normal: This ensures that the execution arrow appears to help with trouble shooting the tests.Synchronization becomes better for the AUT (Application Under Test)

Test Results: Deselect the option “View Results when run session ends”

Mercury Tool Integration: Select "Allow other Mercury products to run tests and components“

Screen Capture: Save step screen capture to results "On error and warnings"

Record and Run Settings

Best Practices for Record & Run Settings,Set the options to configure QTP to "Record and run test on any open Windows- based application“

Set the option - This window will appear the first time you click on the Record button in the new test.

Manually Record and Run settingsrecall this window by selecting Test

QTP - Main Window

QTP - Main WindowTest Pane:Test Pane contains two labs to view the tests, - Keyword View - Expert View

Keyword View: Quick Test Pro displays your test in the form of a collapsible, icon based tree…

Expert View:Quick Test Pro displays the source code (VB Script) of the tests in this view.

Data Table :Data table assists in Parameterizing the tests…

Debug Viewer Pane :It assists in debugging tests with the help of Watch Expressions, Variables, and Command.

Quick Test Pro Commands :The Quick Test Pro commands can be chosen from the menu bar or from a Tool bar.

File Tool bar :File tool bar contains buttons for managing the test.

Test Tool bar :Test tool bar contains buttons for the commands used when creating or maintaining the tests…

Debug Tool Bar :It contains buttons for commands used when debugging the steps in the tests…

Action Tool Bar :To view all actions in the test flow or to view the details of a selected action…

_________ ---------------------------------------------------------------------- --________________________

QTP Tips You can create multiple application areas to suit different components.1. Business components associated with an application area use only the resources and settings that are defined in the application area. In previous versions of QuickTest Professional, business components

could have custom settings.The RegisterUserFunc statement now has an optional argument that you can use to set a function as the default operation for a test object.You can use the new Function Definition Generator to easily generate user-defined functions (Insert > Function Definition Generator).Iterations for a business component are defined in Quality Center.The Operation item appears in the Keyword View only when functions are defined in function library files associated with the component’s application area.

2. You can manage the availability of keywords used to create keyword-driven components using the new Keywords pane in the application area of QuickTest Professional.The Function Definition Generator enables you to add documentation that specifies exactly what a step using your function does. This description is shown in the Documentation column of the Keyword View for steps that use the function.

3. You can associate a function library with the open test by opening the function library and choosing File > Associate Library 'library_name' with 'test_name'.

4. You can check syntax errors by clicking CTRL + F7. If your script contains errors you can view them in the new Information pane.When adding a new step using the Keyword View or Step Generator, you can select a new object from your application and it is automatically added to your object repository.You can specify which columns you want to display in the Keyword View. Choose Tools > View Options or right-click any column header in the Keyword View.You can specify the order in which columns are displayed in the Keyword View. Choose Tools > View Options or drag a column header to a new location in the Keyword View.You can print the contents of the Keyword View to your Windows default printer, or preview it on screen before printing. Click the Print button or choose File > Print.You can copy and paste or drag and drop steps in order to move them to a different location within the Keyword View.You can enter a comment about a step in the Keyword View by clicking in the Comment cell. You can also enter a comment on a new line below the currently selected step by choosing Insert > Comment.You can view the Documentation column in the Keyword View to read a summary of what the step does, in an easy-to-understand sentence.

5. You can copy the content of the Documentation column to the Clipboard by right-clicking any column header in the Keyword View and choosing Copy Documentation to Clipboard.The Select Object for Step dialog box enables you to select a new object from your application. If you select an object in your application that is not in the object repository, the object is added to the object repository when you insert the new step.If you are connected to Quality Center, you can view the current Quality Center connection by pointing to the Quality Center icon in the status bar. To open the Quality Center Connection dialog box, double-click the Quality Center icon.If a Quality Center test or shared file (such as a shared object repository or Data Table file) is open when you disconnect from Quality Center, then QuickTest closes it.To access QuickTest tests or components from Quality Center, select the 'Allow other Mercury products to run tests and components' check box (Tools > Options) and install the QuickTest Add-in for Quality Center (from the QuickTest Professional CD-ROM).

6. If a business component is currently open, clicking the New toolbar button creates a new business component document (and not a new test document). This also applies if an application area or function library is open.

7. You can open a recently used business component, application area, or function library by selecting it from the Recent Files list in the File menu.You can specify test, action, or component parameters to pass values to and from your test or business

component, and between actions in your test.You can define test or action parameter variables using the Parameter object and its methods in the Expert View.You can create test, action, or component parameter output values that retrieve values during the run session and store them for use at another point in the run session. You can then use these output values to parameterize a step in your test or business component.

8. You can create object repository parameters. When associating an object repository to a test asset, you map this parameter to a constant or a test asset parameter (test, action, or business component).You can select an object in the object repository and locate it quickly in your application using the Highlight button in the ORM or ORE.

9. You can locate an object in the object repository by pointing to an object in your application. If the object exists in the object repository, it is highlighted.

10. You can now add new objects to the object repository using filtering capabilities. For example, you can choose to add only a selected type of object residing in a window or a web page/frame.

11. You can now associate multiple object repositories with an action or application area. In previous versions of QuickTest Professional, you could associate only a single object repository with a test asset.

12. You can export object repository content to an XML file and import a new object repository from an XML file.The list of Utility objects available when you open the Step Generator from the Keyword View is a sub-group of the list available when you open the Step Generator from the Expert View.Open XML format used for report information now enables you to easily customize run reports and integrate result information with other applications. Refer to the QuickTest online documentation for a detailed description of the report's XML elements.You can export test results to an HTML file to easily view the test results when you are not working in a QuickTest environment.You can write automation scripts to control virtually every QuickTest feature and capability using the objects, methods, and properties included in the QuickTest Professional automation object model.Test object and method names are not case sensitive.When you type VBScript keywords in the Expert View, the relevant VBScript syntax or blocks are added to the test script.You can now locate specified text strings in the Expert View, and replace them with text strings that you specify. You can search for literal text or use advanced options to fine-tune your search.

13. You can select a block in the Expert View and press CTRL + M to comment this block. Press SHFT + CTRL + M to uncomment the block.

14. You can select a block in the Expert View and indent or outdent it by clicking the Indent or Outdent toolbar buttons.

15. You can control the layout of the QuickTest Professional Window by dragging and dropping panes to a dockable, floating, and tabbed mode.

16. To move a dockable pane without snapping it into place, press CTRL while dragging it to the required location.

17. To auto-hide all the tabbed panes, select the title bar of the active tabbed pane, right-click and choose Auto Hide.

18. When you rename a test object, you can choose whether to automatically update all occurrences of the test object, or manually change the names in steps that use the renamed test objects.

19. You can copy objects from a shared object repository to the local object repository in order to modify them.

20. You can use the Object Repository Merge Tool to merge objects from two shared object repositories into a single object repository.

21. You can associate shared object repositories with multiple actions simultaneously, using the Associate Repositories dialog box.

22. You can resolve missing resources (such as missing object repositories and actions), using the new Missing Resources pane.You can print a single action or business component from the Keyword View (in table format) or the from the Expert View (in statement format).In addition to Data Table output values, you can output values to environment variables or store a retrieved value in a test, action, or component parameter.You can use the Advanced Windows Applications Options dialog box to modify how QuickTest records and runs tests on Windows applications. Choose Tools > Options > Windows Applications tab > Advanced.You can save the resulting data from the run-time Data Table to a file by inserting a DataTable.Export statement to the end of your test.To instruct QuickTest to wait for an object to open or appear during test run, use an Exist or Wait statement.To stop an analog step in the middle of a test run, click Ctrl + Esc, then click the Stop toolbar button.If you want to create a bitmap checkpoint of multiple objects, select the object in the Object Selection dialog box that includes all the objects you want your bitmap checkpoint to contain.If you need to recover Active Screen files after you save a test without Active Screen files, re-record the necessary steps or use the Update Run option to recapture screens for all steps in your test.You can use a PathFinder.Locate statement in your test to retrieve the complete path that QuickTest uses for a specified relative path based on the folders specified in the Folders tab.To maximize performance, load only the add-ins you need.You can define a recovery scenario to handle unexpected behavior during your run session.You can add new objects to the Object Repository from the Active Screen or using the Add Objects option in the Object Repository dialog box and pointing to the object in your application.To record keyboard input, mouse clicks, and the exact path the mouse travels, switch to Analog Recording mode or Low Level Recording mode.If it takes time for an object you are checking to load all of its data, you can increase the checkpoint timeout.You can insert XML output values to your script.You can verify that your XML is structured according to a specific schema.You can specify a relative path when calling actions, functions, and other external files associated with or referenced by a test or business component.

23. You can create library files (containing VBScript functions, subroutines, classes, modules, and so forth) in QuickTest Professional and associate them with your test or application area. You can then call these functions (or other elements) from within your test assets.

24. You can debug functions, subroutines and classes defined in a function library file in QuickTest Professional.You can create a user-defined function and register it as a test object method in order to overwrite or add to existing test object functionality.You can use the Data Driver Wizard to automatically parameterize constants in your action or business component.You can use the Reporter object to disable or enable messages to the Test Results.You can record a test on one version of Microsoft Internet Explorer and then run it on other browsers or versions.To transfer control to the application while spying or inserting checkpoints on objects, press the CTRL

key.You can check the content of an image in a Web page when you create an image checkpoint using the Compare Image Content option.You can use the Data Table to run the test several times, each time using different data.By default, in order to conserve disk space, QuickTest does not save screen captures with your test results for steps that pass. You can change the default setting in the Tools > Options > Run tab.The Active Screen loads faster if you clear the Load Images check box in the Web Page Appearance dialog box (Tools > Options > Active Screen tab > Advanced button).You can create a custom report message from the Keyword View by choosing Insert > Report.You can teach QuickTest to recognize any area of your application as an object by defining it as a virtual object.From QuickTest, you can run WinRunner tests and call TSL functions in compiled modules. The results of the WinRunner test or function are integrated into the QuickTest test results.To modify the text used for a text checkpoint, click the Configure button in the Text Checkpoint Properties dialog box.You can configure an action for repeated use in your test and in other tests. Select the Reusable Action check box in the Action Properties dialog box (Edit > Action > Action Properties).You can use the ExitAction statement to terminate an action before it finishes running, based on conditions you specify in your test.You can run QuickTest tests from a Quality Center project and pass parameter values to the test.You can set breakpoints in your test, and then use the Debug Viewer pane to view, set, or modify the current value of objects or variables.You can call methods and retrieve and set COM object properties from the Expert View using the .Object property.You can configure how QuickTest records events in Web applications. Choose Tools > Web Event Recording Configuration.You can define custom environment variables for use in your test. You can add logic to a checkpoint by using a Data Table formula.You can set a parameter to use a random numeric value.You can use the Window Script Host and the VBScript Runtime Library to further extend your test. For more information choose Help > QuickTest Professional Help > VBScript Reference.You can use the Object Identification dialog box to configure the way QuickTest learns and recognizes objects.You can run your test in Update mode to update values in your test or business component. You can choose to update checkpoint data, Active Screen images, and/or the descriptions of the objects in the object repository. Choose Automation > Update Run Mode.You can choose a Web server accessible via a Local Area Network (LAN) or a Wide Area Network (WAN) when connecting to Quality Center. Click the Quality Center Connection button or choose File > Quality Center Connection.The Open Test from Quality Center Project dialog box displays icons that indicate the version control status of each test in your project.If you want to add the same comment to every action that you create, you can add the comment to an action template

_________ ---------------------------------------------------------------------- --________________________

Enhancements in QTP 10: 1. Upgrade from QTP 9.5 [Note - If you have QTP 9.2 or earlier version is installed, then you need to uninstall those version first. But if you have QTP 9.5 installed, then you can directly upgrade from QTP 9.5 to QTP 10.]

2. Improved IntelliSense Functionality

3. Added Control for Editing and Managing Actions in Automation Scripts

4. Improved Debugger Pane Design and Functionality

5. New Object Identification Solutions in Maintenance Run Mode

6. Additional Configuration Settings for Text Recognition Mechanism

7. New Look for Options, Settings, and File Dialog Boxes

8. QuickTest Toolbar Customization Options

9. Improved Web Extensibility

10. .NET Add-in and Extensibility Improvements

11. New Terminal Emulator Configuration Validation

Note - We will discuss each enhancement in the coming posts.

_________ ---------------------------------------------------------------------- --________________________

HR Interview Question 1. Tell me about yourself:The most often asked question in interviews. You need to have a shortstatement prepared in your mind. Be careful that it does not soundrehearsed. Limit it to work-related items unless instructed otherwise.Talk about things you have done and jobs you have held that relate tothe position you are interviewing for. Start with the item farthestback and work up to the present.2. Why did you leave your last job?Stay positive regardless of the circumstances. Never refer to a majorproblem with management and never speak ill of supervisors, co-workersor the organization. If you do, you will be the one looking bad. Keepsmiling and talk about leaving for a positive reason such as anopportunity, a chance to do something special or other forward-lookingreasons.3. What experience do you have in this field?Speak about specifics that relate to the position you are applying for.If you do not have specific experience, get as close as you can.4. Do you consider yourself successful?You should always answer yes and briefly explain why. A goodexplanation is that you have set goals, and you have met some and areon track to achieve the others.5. What do co-workers say about you?Be prepared with a quote or two from co-workers. Either a specificstatement or a paraphrase will work. Jill Clark, a co-worker at SmithCompany, always said I was the hardest workers she had ever known. Itis as powerful as Jill having said it at the interview herself.6. What do you know about this organization?This question is one reason to do some research on the organizationbefore the interview. Find out where they have been and where they aregoing. What are the current issues and who are the major players?7. What have you done to improve your knowledge in the last year?Try to include improvement activities that relate to the job. A widevariety of activities can be mentioned as positive self-improvement.Have some good ones handy to mention.8. Are you applying for other jobs?Be honest but do not spend a lot of time in this area. Keep the focuson this job and what you can do for this organization. Anything else isa distraction.9. Why do you want to work for this organization?This may take some thought and certainly, should be based on theresearch you have done on the organization. Sincerity is extremelyimportant here and will easily be sensed. Relate it to your long-termcareer goals.10. Do you know anyone who works for us?Be aware of the policy on relatives working for the organization. Thiscan affect your answer even though they asked about friends notrelatives. Be careful to mention a friend only if they are well thoughtof.11. What kind of salary do you need?A loaded question. A nasty little game that you will probably lose ifyou answer first. So, do not answer it. Instead, say something like,That’s a tough question. Can you tell

me the range for this position?In most cases, the interviewer, taken off guard, will tell you. If not,say that it can depend on the details of the job. Then give a widerange.12. Are you a team player?You are, of course, a team player. Be sure to have examples ready.Specifics that show you often perform for the good of the team ratherthan for yourself are good evidence of your team attitude. Do not brag,just say it in a matter-of-fact tone. This is a key point.13. How long would you expect to work for us if hired?Specifics here are not good. Something like this should work: I’d likeit to be a long time. Or As long as we both feel I’m doing a good job.14. Have you ever had to fire anyone? How did you feel about that?This is serious. Do not make light of it or in any way seem like youlike to fire people. At the same time, you will do it when it is theright thing to do. When it comes to the organization versus theindividual who has created a harmful situation, you will protect theorganization. Remember firing is not the same as layoff or reduction inforce.15. What is your philosophy towards work?The interviewer is not looking for a long or flowery dissertation here.Do you have strong feelings that the job gets done? Yes. That’s thetype of answer that works best here. Short and positive, showing abenefit to the organization.16. If you had enough money to retire right now, would you?Answer yes if you would. But since you need to work, this is the typeof work you prefer. Do not say yes if you do not mean it.17. Have you ever been asked to leave a position?If you have not, say no. If you have, be honest, brief and avoid sayingnegative things about the people or organization involved.18. Explain how you would be an asset to this organizationYou should be anxious for this question. It gives you a chance tohighlight your best points as they relate to the position beingdiscussed. Give a little advance thought to this relationship.19. Why should we hire you?Point out how your assets meet what the organization needs. Do notmention any other candidates to make a comparison.20. Tell me about a suggestion you have madeHave a good one ready. Be sure and use a suggestion that was acceptedand was then considered successful. One related to the type of workapplied for is a real plus.21. What irritates you about co-workers?This is a trap question. Think real hard but fail to come up withanything that irritates you. A short statement that you seem to getalong with folks is great.22. What is your greatest strength?Numerous answers are good, just stay positive. A few good examples:Your ability to prioritize, Your problem-solving skills, Your abilityto work under pressure, Your ability to focus on projects, Yourprofessional expertise, Your leadership skills, Your positive attitude23. Tell me about your dream job.Stay away from a specific job. You cannot win. If you say the job youare contending for is it, you strain credibility. If you say anotherjob is it, you plant the suspicion that you will be dissatisfied withthis position if hired. The best is to stay genetic and say somethinglike: A job where I love the work, like the people, can contribute andcan’t wait to get to work.24. Why do you think you would do well at this job?Give several reasons and include skills, experience and interest.25. What are you looking for in a job?See answer # 2326. What kind of person would you refuse to work with?Do not be trivial. It would take disloyalty to the organization,violence or lawbreaking to get you to object. Minor objections willlabel you as a whiner.27. What is more important to you: the money or the work?Money is always important, but the work is the most important. There isno better answer.28. What would your previous supervisor say your strongest point is?There are numerous good possibilities:Loyalty, Energy, Positive attitude, Leadership, Team player, Expertise,Initiative, Patience, Hard work, Creativity, Problem solver29. Tell me about a problem you had with a supervisorBiggest trap of all. This is a test to see if you will speak ill ofyour boss. If you fall for it and tell about a problem with a formerboss, you may well below the interview right there. Stay positive anddevelop a poor memory about any trouble with a supervisor.30. What has disappointed you about a job?Don’t get trivial or negative. Safe areas are few but can include:Not enough of a challenge. You were laid off in a reduction Company didnot win a contract, which would have given you more responsibility.31. Tell me about your ability to work under pressure.You may say that you thrive under certain types of pressure. Give anexample that relates to the type of position applied for.32. Do your skills match this job or another job more closely?Probably this one. Do not give fuel to the suspicion that you may wantanother job more than this one.33. What motivates you to do your best on the job?This is a personal trait that only you can say, but good

examples are:Challenge, Achievement, Recognition34. Are you willing to work overtime? Nights? Weekends?This is up to you. Be totally honest.35. How would you know you were successful on this job?Several ways are good measures:You set high standards for yourself and meet them. Your outcomes are asuccess.Your boss tell you that you are successful36. Would you be willing to relocate if required?You should be clear on this with your family prior to the interview ifyou think there is a chance it may come up. Do not say yes just to getthe job if the real answer is no. This can create a lot of problemslater on in your career. Be honest at this point and save yourselffuture grief.37. Are you willing to put the interests of the organization ahead ofyour own?This is a straight loyalty and dedication question. Do not worry aboutthe deep ethical and philosophical implications. Just say yes.38. Describe your management style.Try to avoid labels. Some of the more common labels, like progressive,salesman or consensus, can have several meanings or descriptionsdepending on which management expert you listen to. The situationalstyle is safe, because it says you will manage according to thesituation, instead of one size fits all.39. What have you learned from mistakes on the job?Here you have to come up with something or you strain credibility. Makeit small, well intentioned mistake with a positive lesson learned. Anexample would be working too far ahead of colleagues on a project andthus throwing coordination off.40. Do you have any blind spots?Trick question. If you know about blind spots, they are no longer blindspots. Do not reveal any personal areas of concern here. Let them dotheir own discovery on your bad points. Do not hand it to them.41. If you were hiring a person for this job, what would you look for?Be careful to mention traits that are needed and that you have.42. Do you think you are overqualified for this position?Regardless of your qualifications, state that you are very wellqualified for the position.43. How do you propose to compensate for your lack of experience?First, if you have experience that the interviewer does not know about,bring that up: Then, point out (if true) that you are a hard workingquick learner.44. What qualities do you look for in a boss?Be generic and positive. Safe qualities are knowledgeable, a sense ofhumor, fair, loyal to subordinates and holder of high standards. Allbosses think they have these traits.45. Tell me about a time when you helped resolve a dispute betweenothers.Pick a specific incident. Concentrate on your problem solving techniqueand not the dispute you settled.46. What position do you prefer on a team working on a project?Be honest. If you are comfortable in different roles, point that out.47. Describe your work ethic.Emphasize benefits to the organization. Things like, determination toget the job done and work hard but enjoy your work are good.48. What has been your biggest professional disappointment?Be sure that you refer to something that was beyond your control. Showacceptance and no negative feelings.49. Tell me about the most fun you have had on the job.Talk about having fun by accomplishing something for the organization.50. Do you have any questions for me?Always have some questions prepared. Questions prepared where you will be an asset to the organization are good. How soon will I be able to be productive? and What type of projects will I be able to assist on? areexamples.

_________ ---------------------------------------------------------------------- --________________________

Software Testing Interview Questions The order of STLC1) Test Strategy2) Test Plan3) Test Scenario4) Test Cases

1) Test Strategy: Test Strategy is a Document, developed by the Project manager, which contains what type of technique to follow and which module to test.2) Test Plan: Test plan is a Document, developed by the Test Lead, which contains "What to Test","How to Test", "When to Test", "Who to Test".3) Test Scenario: A name given to Test Cases is called Test Scenario. These Test Scenario was deal bythe Test Enggineer.4) Test Cases: It is also document andit specifies a Testable condition to validate a functionality. These Test Cases are deal by the Test Enggneer

SDLC1.Requirement phase,2.Desing phase(HLD,DLD(Program spec))3.Coding4.Testing5.Release6.MaintenanceSTLC1.Requirements knowledge transfer2.Test planning3.Writting Test case or scripts4.executing test case5.Bug tracking

Diff between system testing and functional testingFunctional testing is the technique utilized in the system tesing.Its a black box testing type... Functional testing is noting but testing or check whether a sytem functions properly as per the req..system testing is the phase after integration testing phase.After all modules get integrated and tested for integration, the system is tested as a whole.

1: Why a software needs to be tested? Why Software Testing is necessary?

Testing is the most important way of assuring (or controlling) the quality of software. Good practices throughout the development process contribute to the quality of the final product, but only testing can demonstrate that quality has been achieved and identify the problems and the risks that remain.

1. To Improve Quality of software

2. To Improve Reliability of software.

3. 50% of maintenance cost attributed to fixing bugs.

4. TO AVOID USER TO FIND BUGS

5. TO KEEP RELIABILITY IN UR PRODUCT

6. TO KEEP QUALITY IN UR PRODUCT

7. TO STAND IN BUSINESS

To fix a bug found during a test implies rework, which might go far back into the development cycle - possibly all the way back to the initial requirements. All that rework needs to be re-tested. The cost of fixing bugs increases exponentially at each stage of development. Rework and re-testing are time-consuming and expensive, and fixes are error-prone - studies have shown that each fix has a 50% chance of creating a new defect.

2: Why do software have bugs?# miscommunication or no communication - as to specifics of what an application should or shouldn't do (the application's requirements).# software complexity - the complexity of current software applications can be difficult to comprehend for anyone without experience in modern-day software development. Multi-tier distributed systems, applications utilizing mutliple local and remote web services applications, data communications, enormous relational databases, security complexities, and sheer size of applications have all contributed to the exponential growth in software/system complexity.# programming errors - programmers, like anyone else, can make mistakes.# changing requirements (whether documented or undocumented) - the end-user may not understand the effects of changes, or may understand and request them anyway - redesign, rescheduling of engineers, effects on other projects, work already completed that may have to be redone or thrown out, hardware requirements that may be affected, etc. #time pressures - scheduling of software projects is difficult at best, often requiring a lot of guesswork. When deadlines loom and the crunch comes, mistakes will be made. # poorly documented code - it's tough to maintain and modify code that is badly written or poorly documented; the result is bugs. In many organizations management provides no incentive for programmers to document their code or write clear, understandable, maintainable code. In fact, it's usually the opposite: they get points mostly for quickly turning out code, and there's job security if nobody else can understand it ('if it was hard to write, it should be hard to read').# software development tools - visual tools, class libraries, compilers, scripting tools, etc. often introduce their own bugs or are poorly documented, resulting in added bugs.

3: Who in the company is responsible for Quality

Every team member in a project is responsible for Quality of product build.But testing team is responsible to define the quality of product developed.Answer 4: Should we test every possible combination/scenario for a program?No. Exhaustive testing is not possible and also a time consuming process and hence not recommended. Its not mandatory.There are several points to be considered here. Delivery time available, personnel availability, complexity of the application under testing, available resources, budget etc. But we should test cover to the maximum extent satisfying the primary functionality which are must from the customer point of view.

5: How will you describe testing activities?

Testing activities start from the elaboration phase. The various testing activities are preparing the test plan, Preparing test cases, Execute the test case, Log teh bug, validate the bug & take appropriate action for the bug, Automate the test cases, View and report the test results etcThe testing activities are:- Effort estimation and project initiation- system study- test plan- designing test cases- automation (if required)- executing the test cases- reporting bugs- regression testing- analysis- summary reportsAnswer 6: Do you have a favorite QA book? Why?I have a couple of favorites, but my all time number one isSoftware testing In The Real World, by Edward KitI have bought and handed out multiple copies of this book I think it is so good.I love the easy to read style, the practicle application and the very usable appendicies.Answer 7: How do we perform regression testing?Regression testing is nothing but testing the application for an existing functionality. When ever a release for a software is made, some new functionality is introduced. In our normal test cycle we would test the application against the new functionality. But there should be some testing done to ensure that because of these new functionality, our old functionality are not affected. This testing is known as Regression TestingWhile performing regression testing we do not need create new Test case and all.So Each time that you modify a Code of application (class, method, or function), you should perform regression testing to ensure that your changes have not introduced errors.Regression testing is performed for the 3 scenarios1. When the defects are fixed2. when there is the change for request3. when new features are addedDeveloper fixed the defects and send to tester.Tester test the new functionality of the application with the co-existence of the application and verify that The new functionality of the application should not create any problem on the existence application.- the roles of glass-box and black-box testing tools?White-box or glass-box testing relies on analyzing the code itself and the internal logic of the software. White-box testing is often, but not always, the purview of programmers. It uses techniques which range from highly technical or technology specific testing through to things like code inspections.Although white-box techniques can be

used at any stage in a software product's life cycle they tend to be found in Unit testing activities.Glass-box testing also called as white-box testing refers to testing, with detailed knowledge of the modules internals. Thus these tools concentrate more on the algorithms, data structures used in development of modules. These tools perform testing on individual modules more likely than the whole application.Glass-box testing: It is based on internal design of an application code.Tests are based on path coverage,branch coverage,statement coverage. It is also known as White Box testing.White box test cases can check for..1) All independent paths with in a modules are executed atleast once2) Execute all loops3) Exercise all logical decisions4) Exercise internal data structure to ensure their validity- the difference between QA and Testing?Quality Assurance – the process of preventing defects from entering software through 'best practices'. Not be confused with testing!The process of critically evaluating software to find flaws and fix them and to determine its current state of readiness for releasethe difference between Smoke Testing and Sanity TestingAnswer: [From Wiki]In software development, the sanity test (a form of software testing which offers "quick, broad, and shallow testing"[1]) determines whether it is reasonable to proceed with further testing.Software sanity tests are commonly conflated with smoke tests [2]. A smoke test determines whether it is possible to continue testing, as opposed to whether it is reasonable[citation needed]. A software smoke test determines whether the program launches and whether its interfaces are accessible and responsive (for example, the responsiveness of a web page or an input button). If the smoke test fails, it is impossible to conduct a sanity test. In contrast, the ideal sanity test exercises the smallest subset of application functions needed to determine whether the application logic is generally functional and correct (for example, an interest rate calculation for a financial application). If the sanity test fails, it is not reasonable to attempt more rigorous testing. Both sanity tests and smoke tests are ways to avoid wasting time and effort by quickly determining whether an application is too flawed to merit any rigorous testing. Many companies run sanity tests on a weekly build as part of their development process [3]The Hello world program is often used as a sanity test for a development environment. If Hello World fails to compile the basic environment (or the compile process the user is attempting) has a configuration problem. If it works the problem may be a bug in the specific application being compiled.

_________ ---------------------------------------------------------------------- --________________________

Automated Test Script Creation Process Debugging and troubleshooting test scripts becomes extremely tedious when the test script has hundreds of lines of code, verification points, branching logic, error handling, parameters, and test correlation among various recorded business processes. A more manageable approach to debugging complex and lengthy test scripts is to record portions of the script and debug those portions individually before recording other parts of the test script. After testing individual portions, you can determine how one portion of the test script works with another portion and how data flows from one recorded process to the other. After all sections for a test script have been recorded, you can playback the entire test script and ensure that it properly plays back from the beginning to the end with one or more sets of data.

Always create a test plan that will assist in the creation of the regression test script. A test script is only as good as the planning that takes place before it is written. This saves time and organizes the process.

Remember that all regression test scripts will be written to run in the QA environment as well as the production environment. The automated regression test use will be a part of the production test used to determine if a build truly does function as expected in production.

To manage the creation and edit of our automated regression tests QA will create automated tests in the following manner:

1.Record each individual process such as logging in and logging out. Save those recordings on your desktop.

2.Verify that the script will play back with no errors.

3.Continue recording and playing back throughout the test script creation process, verifying the script will play back with each step taken.

4.Add multiple sets of data driven tests for each individual portion of each test where that kind of test is applicable.

5.Verify the individual test scripts with multiple sets of data will play back with no errors.

6.Add various check points throughout the test.

7.Verify the individual test scripts with various check points will play back with no errors.

8.Now integrate all recorded processes into one large test script.

9.Verify the large test script will play back with no errors.

The key here is to ensure that each recorded process plays back successfully before proceeding to record the remaining portions of the entire test script. Do not string the individual tests together for playback without first verifying that all of the processes could play back successfully as individual processes.

Lesson to be learned here is to never, EVER wait to debug a script until the entire test script has been recorded.

Synchronization

Since QTP can play back recorded test scripts much faster than an end-user’s manual keystrokes all tests must be synchronized. Introduce artificial wait times in the test scripts to make sure the script will run appropriately without errors unattended. Take into account the fact that there will be times when the script will need to run slower than a manual test due to network issues, etc. The goal here is we want to make sure the scripts will run unattended through Test Director. Slowing down a script with wait times is not very scientific and does not contribute to the creation of a robust automated test script that plays back successfully without user intervention. That said, sync times will be edited after the test script has been written in its entirety and has been tested to ensure it runs with no errors.

Signed-off, Peer Reviewed

As part of the test readiness review criteria, test scripts will be formally accepted and approved prior to starting the test cycle. QA, Business Analysts and Developers should be involved in approving recorded test scripts. The QA Analyst writing the automated test script should demonstrate that the test script successfully plays back in the QA environment and, if possible, with various sets of data.

Recording, Playing Back Against Hidden Objects

Scripts might be recorded to populate or double click values for a field within a table grid or an array where the location of this field is not fixed. If the field’s location within a table grid or array changes from the time it was recorded, the script might fail during play back. Test scripts often fail during play back because the locations of objects that are not displayed or visible within the screen have changed.

In order to play back scripts that are location sensitive or where the location is subject to change, it might be necessary to enhance the script with functionality such as ‘scroll down’, ‘next page’, or ‘find’. Including such utilities ensures that hidden objects requiring play back will be identified, and/or double clicked regardless of their location within an array, table grid, or the displayed screen.

Create Automatic Notification for Critical Scripts

Test scripts should be enhanced with error handling programming logic that instantly sends error messages to a tester’s e-mail address when problems occur. Since some test scripts are business critical and must run as batch jobs in the middle of the night we need to know if something failed as soon as possible. The proper and successful execution of these business critical test scripts can serve as a dependency or pre-condition for other automated tasks. Always include logic in business critical test scripts that automatically sends notification in the event of a failure.

Documentation

To make test scripts reusable and easier to maintain, please document all relevant information for executing the test script, a test script header, and any special conditions for execution of the test script. Example:

1.Adjust dates within the application in QA environment for running reports.

2.Update any fields that require unique data.

3.Display settings for context sensitive/analog/bitmap recording.

4.List other test scripts that are dependencies.

5.Specify necessary authorization levels or user roles for executing the script.

6.Conditions under which the script can fail and work around for re-launching the script.

7.Applications that need to be either opened or closed during the script execution.

8.Specific data formats, etc.

Scripts should contain a header with a description (example: what it is used for) and its particular purpose (example: regression testing). The script header should also include the script author and owner, creation and modification date, requirement identifiers that the script traces back to, the product the script supports and the number of variables and parameters of the script. Providing this information in the test script header facilitates the execution, modification, and maintenance of the script for future testing efforts.

_________ ---------------------------------------------------------------------- --________________________

Test Automation What is Test Automation ?

Test automation is the use of software to control the execution of tests, the comparison of actual outcomes to predicted outcomes, the setting up of test preconditions, and other test control and test reporting functions. Commonly, test automation involves automating a manual process already in place that uses a formalized testing process

Overview

Although manual tests may find many defects in a software application, it is a laborious and time consuming process. In addition it may not be effective in finding certain classes of defects. Test automation is a process of writing a computer program to do testing that would otherwise need to be done manually. Once tests have been automated, they can be run quickly. This is often the most cost effective

method for software products that have a long maintenance life, because even minor patches over the lifetime of the application can cause features to break which were working at an earlier point in time.

There are two general approaches to test automation:

1) Code-driven testing:- The public (usually) interfaces to classes, modules, or libraries are tested with a variety of input arguments to validate that the results that are returned are correct.

2) Graphical user interface testing:- A testing framework generates user interface events such as keystrokes and mouse clicks, and observes the changes that result in the user interface, to validate that the observable behavior of the program is correct.

Test automation tools can be expensive, and it is usually employed in combination with manual testing. It can be made cost-effective in the longer term, especially when used repeatedly in regression testing.

One way to generate test cases automatically is model-based testing through use of a model of the system for test case generation, but research continues into a variety of alternative methodologies for doing so.[citation needed]

What to automate, when to automate, or even whether one really needs automation are crucial decisions which the testing (or development) team must make. Selecting the correct features of the product for automation largely determines the success of the automation. Automating unstable features or features that are undergoing changes should be avoided

What to test

Testing tools can help automate tasks such as product installation, test data creation, GUI interaction, problem detection (consider parsing or polling agents equipped with oracles), defect logging, etc., without necessarily automating tests in an end-to-end fashion.

One must keep following popular requirements when thinking of test automation:

a)Platform and OS independence b)Data driven capability (Input Data, Output Data, Meta Data) c)Customizable Reporting (DB Access, crystal reports) d)Easy debugging and logging e)Version control friendly – minimum or zero binary files f)Extensible & Customizable (Open APIs to be able to integrate with other tools) g)Common Driver (For example, in the Java development ecosystem, that means Ant or Maven and the popular IDEs). This enables tests to integrate with the developers' workflows. h)Supports unattended test runs for integration with build processes and batch runs. i)Continuous Integration servers require this. j)Email Notifications (Automated notification on failure or threshold levels). These may be the test runner or tooling that executes it. k)Support distributed execution environment (distributed test bed) l) Distributed application support (distributed SUT)

Software Test Automation is the process of automating the steps of manual test cases using an automation tool Or utility to shorten the testing life cycle with respect to time…

When application undergoes regression, some of the steps might be missed out or skipped which can be avoided in Automation…Automation helps to avoid human errors and also expedite the testing process…To implement the Test Automation detailed planning and effort is requiredAutomation saves time and effort which results in reduction of the Test life cycle…

Benefits of Automation

- Consistency of Test Execution- Reducing cycle time of regression test cycles- Data driven testing- Repeatability- Coverage- Reliability- Reusability of test wares

Automation life cycle is a subset of the entire test life cycle…Automation planning can be initiated in parallel to the test planning phase…Factors to be considered in automation planning,Stability of AUT (Application under test)No of regression cycles to be performedCompatibility of App platform with testing toolsCost benefit analysis (ROI)Availability of skilled resources

When Automation is applicable?

1) Regression Testing Cycles are long and iterative.2) If the application is planned to have multiple releases / builds3) If it’s a long running application where in small enhancements / Bug Fixes keeps happening4) Test Repeatability is required

_________ ---------------------------------------------------------------------- --________________________

QTP QuickTest Professional

QTP is an automated functional Graphical User Interface (GUI) testing tool created by the HP subsidiary Mercury Interactive that allows the automation of user actions on a web or client based and desktop computer application. It is primarily used for functional regression test automation. QTP uses a scripting language built on top of VBScript to specify the test procedure, and to manipulate the objects and controls of the application under test.

As part of a functional test suite, it works together with Mercury Interactive WinRunner and HP Quality Center and supports enterprise Quality Assurance.

Overview

QTP is UI automation software designed for testing Web-based and Windows based applications running on Microsoft Windows. Like other test automation tools, it works by identifying the objects in the application UI or a web page and performing the desired operations on them (like mouse clicks or keyboard events); it can also be used to capture object properties like name or handler ID etc. To perform these actions, QTP uses a scripting language built on top of VBScript to specify the test procedure, and to manipulate the objects and controls of the application under test. To perform sophisticated actions, users may need to manipulate the underlying VBScript.

Though QTP is usually used for "UI Based" Test Case Automation, it can automate some "Non-UI" based Test Cases. (e.g. API (Certification testing), Database Testing, etc.)

Different Releases or Versions are as follows:-1)10.0 - Released in 20092)9.53)9.2 - Released in 20074)9.0 - Released in 20065)8.2 - Released in 2005

License models

QTP comes with a 14-day demo license, and supports a node-locked seat license, as well as floating or concurrent licenses.

To execute, users select the playback button, which re-executes the commands against the application under test. In real world usage, simply recording and playing-back actions is generally not valuable, as it simply repeats a test already executed and may no longer be valid (because the record now exists in the system, for example).

User interfaceQuickTest provides two main views of a script: Keyword View and Expert View. They are selected from tabs at the bottom of the QuickTest Professional window.

Keyword viewKeyword View is QTP's default test procedure interface. It displays the automation steps of a test procedure as a descriptive tree of actions and functions. The tree contains columns listing the action or function name, parameters, and comments. This mode is useful for the beginners. This view allows the user to select the objects either from the application or from the Object Repository and the user can select the methods to be performed on those objects. The script is automatically generated. Users can also set checkpoints from the keyword view. Users without technical knowledge may be able to understand the Keyword View, but more experienced users and users needing to perform more complicated actions may need to switch to Expert View.

Expert viewIn Expert View, QTP allows display and editing of the test's source code using VBScript. All test actions can be edited here except for the root Global action. Expert View acts as an IDE for the test. It includes many standard IDE features, such as breakpoints and also the codes.

LanguagesQTP uses VBScript as its scripting language. VBScript supports classes but not polymorphism and inheritance. Compared with Visual Basic for Applications (VBA), VBScript lacks the ability to use some Visual Basic keywords, does not come with an integrated debugger, lacks an event handler, and does not have a forms editor. HP has added some of these features to QTP, such as a debugger, but QTP's functionality is more limited in these areas compared with testing tools that integrate a full-featured IDE, such as those provided with VBA, Java, or VB.NET.

QTP is widely/most popularly used Functional/Regression Test automation tool. It was developed by Mercury Interactive and acquired by HP.

But anyway, we need to do proper tool evaluation before selecting QTP for automating testing of our application.

Since QTP can support external add-ins, it can be used for many different applications.

Some add-ins (e.g ActiveX, VisualBasic,Web) are built-in with QTP, and some other add-ins (e.g Java, .net, TE (termial emulator))are external add-ins.

We can load only the required add-ins when opening the QTP IDE. So it will be helpful to improve the execution speed.

QTP will support Keyword Driven and Data Driven testing. We can create our own test automation

framework also based on our own requirements for test automation.

It is very important to understand how QTP works. Because it will help to learn any other feature in QTP easily. And also it will help to design an effective automation framework and also it help to resolve any issue faced during automation script development and also during script execution.

All we know that every test case should have Test Steps and Expected Results.

As QTP is used for executing these test cases, QTP also should have way for handling both Test Steps and Expected Results.

Handling Test Steps means QTP should be capable of navigating any path/page in any website or in any software application.So, for doing this QTP should be able to recognize any control/object in any application/webpage. For recognizing the object, it should know the properties of those objects beforehand. It is achieved by storing the properties of the objects in a centralized place known as Object Repository.

While running the test script, the objects in the application are identified/recognized by comparing the properties of them with the properties stored in the Object Repository. By doing this execution of Test Steps becomes possible.

QTP is having Datatables (similar to Excel sheet) for supporting execution for multiple iterations of same steps with different data. For example, assume that we need to execute two test cases, one for logging into a website using UPPER case username and another test case for logging into a website using lower case username.

For executing these two test cases, the steps will be same. The only difference is in the test data.

It can be easily done in QTP by putting these input usernames in Datatable and make the Script to execute it two times.

Next, we need to think about handling Expected Results. The purpose of testing is comparing the Actual result with the predefined Expected Results. It is achieved by using Checkpoints.

There are many checkpoints available in QTP. They are, Standard Checkpoint,Text Checkpoint, Bitmap Checkpoint, Database Checkpoint, accessibility Checkpoint and XML Checkpoint.

Actually QTP can be used simply as Record and Play type tool for automation of simple steps on simple applications. But it should be extensively used by writing user defined functions and many other features to get more benefit from it.

QTP is not using any Proprietary Script. It uses commonly available VBscript. So writing script will be simple. And also, vbscript is commonly used in many places such as Web development (ASP), and in windows administration works. So we can easily find lot of already available user-defined functions and help articles in the Internet.

And also, QTP supports COM model. i-e Any methods and properties of any COM based application can be easily accessed from QTP. For example IE(Internet Explorer) and Excel Objects can be created within QTP script. It is applicable for QTP itself. i-e Object of QTP itself can be created and handled. It is known as Automation Object Model.

Basically QTP is a functional/Regression testing tool. But it can be indirectly used for testing performance also. (i-e QTP scripts can be be called from performance testing tool "Load Runner"). And also, QTP is having limited performance testing options such as start and end transactions which will be helpful to find execution time for particular block of steps.

QTP can be closely integrated with the Test Management Tool Quality Center (QC). QC can be effectively used to run QTP scripts in multiple remote machines to complete execution of many test scripts in less time.

The user friendly IDE which has Keyword view, Expert view, Datatable, Active screen, object repository editor/manager,step generator, function generator,object highlight feature, intellisense, recovery scenario manager, update run feature and simple Test/Action handling features makes the Script developer/execution work easy. The IDE is integrated with useful tools such as ObjectSpy. The IDE has standard development features such as Debug.

_________ ---------------------------------------------------------------------- --________________________

QTP Testing Process

Powered by website analytics technology.

The QTP (QuickTest Professional) testing process consists of the following main phases:

1. 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 QTP add-ins for these environments to enable QTP 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.

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 QTP functionality, and so on.

You also need to configure QTP settings so that QTP will perform the tasks you need, such as displaying a results report every time you run a test.

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.

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.

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 behaviour of your application. While running, QTP opens the application and performs each step in your test.

You examine the test results to pinpoint defects in your application.

6. Reporting defects If you have Quality Center installed, you can report the defects you discover to a database. Quality Center is the HP test management solution.

_________ ---------------------------------------------------------------------- --________________________

QTP Interface Introduction to QTP (QuickTest Professional)

The Mercury advanced keyword-driven testing solution

Launch QTP

When you Launch QTP, first it will display Addin Manager Window.Addin Manager window giving information for all supporting technologies for your QTP.

Addin Manager Window

Technologies SupportedDefault Support 1. Standard Windows applications

2. Web objects / Applications3. ActiveX controls4. Visual Basic applications

Additional QuickTest add-ins Support,1. Java 2. Oracle 3. SAP Solutions,4. .NET Windows5. Web Forms, 6. Siebel, 7. PeopleSoft, 8. Web services, and terminal emulator applications.

QTP’s Add-in Manager facilitates the users to select the technology / environment from variety of environments suitable for the AUT (Application Under Test)

Once an add-in is loaded, users can record that application in its supported environment and thus QTP recognizes the objects specific to the application under test (AUT) as loaded through Add-in Manager.

It is critical for the users to know the development technologies / environment of AUT, and load right Add-Ins while invoking Quick Test Pro

QTP Interface

Powered by website analytics technology.

QTP - Main Window

1) Test Pane:

Test Pane contains two labs to view the tests, - Keyword View - Expert View

Keyword View:

Quick Test Pro displays your test in the form of a collapsible, icon based tree…

Expert View:

Quick Test Pro displays the source code (VB Script) of the tests in this view.

2) Data Table :

Data table assists in Parameterizing the tests…

3) Debug Viewer Pane :

It assists in debugging tests with the help of Watch Expressions, Variables, and Command.

4) Active Screen Pane :

_________ ---------------------------------------------------------------------- --________________________

_________ ---------------------------------------------------------------------- --________________________

_________ ---------------------------------------------------------------------- --________________________

_________ ---------------------------------------------------------------------- --________________________