Test Scripts The test scripts name Must consist of alphabets, numbers and ‘_’. Must start with an upper case letter. If more than one word is used, the starting of every word must be in Upper case.
(Eg: Test_Script) Name of the script must be in the format – Application/Test group, Feature/Action Number (XYZ_01).
VBS Files A VBScript file name must consist of alphabets. Name should preferably be in the format Project_Module_Function Functions Must consist of alphabets. Must start with ‘func’. Name must stand for the functionality of the function. If more than one word is used, the starting of every word should be in capitals. Numerical are not allowed in the names Eg: Public function funcOpenWindow (in window_name) Constants and Variables Name of a constant must be in upper case letters with underscores in it. Eg: public const OR_PATH_DIR= c:\\mytests\\Action1; Name of a variable must be of lowercase letters and can contain underscores and digits. Eg: public my_variable_name=”This is my variable”; · Declare all the variables using DIM. Object Repository Object repository file name must consist of alphabets and should be like project_Module_Function.tsr. If the name of an object or window is ambiguous, then it must be renamed in the format ObjectType_Label. Eg: Button_Done, Window_EngagementSummry, Checkbox_Overage, Radio_Awarded etc. If more than one word is used, the starting of every word should be in capitals.
Recovery Manager Name of a Recovery Manager file must be of alphabets and if necessary digits. The files must be of the format Project_Module_Function_in.qrs.
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 Modularity 2) Test Library Architecture 3) Data-Driven Testing 4) Keyword-Driven or Table-Driven Testing 5) 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 progress b) 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 scripts c) If functionality changes, only the specific "Business Function" script needs to be updated d) 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 Case c) Tester must not only maintain the Detail Test Plan with specific data, but must also re-enter this data in the various required data-files d) 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 incorrect 4) 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 Framework 5.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.
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
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.
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
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.
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.
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.
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 layout Note: 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
Testing Process QTP (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.
Testing Process QTP (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 Data Table 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.
Testing Process QTP (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 Data Table 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.
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 Process 2) Test Object Model 3) Object Repository 4) Checkpoints 5) QTP Recording 6) Parameterization 7) Test Keyword View 8) Actions 9) Descriptive Programming 10)Framework Designing
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.
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 actions 2) re usable actions 3) 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 a set a = wscript.create object (”wscript.shell”) a.run “notepad.exe”. 42. how many types of recording modes in QTP? Describe each type with an example where we use them? Three types of recording modes in QTP. 1) NORMAL 2) ANALOG MODE 3) 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 manager 2) press the new scenario 3) click next 4) select the pop up exceptions 5) select the pop window which we want to handle (capture) by clicking the spy button. 6) press next 7) select the specified options like key board or mouse operations press next select the specified options click default or press enter 9) click next and uncheck add another recovery operation 10) click next and select proceed next step 11) click next and give the scenario name and description 12) 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 applications 69.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 so that 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 compliance 7. 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 by Logical Name:PSOPTIONS_TIME20 Class:Web Edit 73.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 object It 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”).Click 76.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 parameters 1. 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 Action Statement 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 WR QTP 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.localsheet The 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 scripting 95. Analyzing the Checkpoint results Standard 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) checkpoints By 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 checkpoint In 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 session Note: 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 below An 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.