Sunteți pe pagina 1din 29

1) What are the extensions of QTP files? QTP Test / Test Script(.mts){.

mts=module/mercury test script} Local Repository file (.mtr){.mtr=module/mercury test repository} Shared repository files(.tsr){Test shared repository} Library files (.vbs) Environmental files (.xml) Test batch file (.mtb){module test batch} QTP result file (xml) optional: pdf, doc, xml-for reporting Recovery scenario file (.qrs){quick recovery scenario} 2) How to handle dynamic objects? By using Regular expressions we can handle dynamic objects. 3) What are the differences between checkpoint and output value? Both are same in insertion but different in purpose. Checkpoint is a verification point, it takes expected results from the user and compare with the actual results during execution and provides test results. Output value captures object properties values, database content and xml elements values and stores in run time data table. Checkpoints compare actual results with expected results, output values captures values and stores. 4) How to handle Repositories dynamically? With Repositoriescollection utility object, we can handle shared object repositories dynamically. Note: on Repositoriescollection object, we can use Add, Find, Remove, and Removeall like methods. 5) What is the use of environment variables? Environment variables are global variables that we can use from number of tests commonly. Whenever we want to use some variables from number of tests, instead of declaring as local variables, if we use environment variables concept then maintenance will be easy. 6) What is a Regular Expression, where we use this feature in QTP? Regular expression is nothing but matching patterns. In QTP, we use this feature for identifying dynamic objects 7) What is the advantage of Dynamic Descriptive Programming than Static? Incase of dynamic programming Tests generation is easy and maintenance also very easy.

8) What are the limitations of QuickTest? a. It supports MS Windows operating environment only b. It doesnt support CLI Applications (Command line interface) c. It supports IE only for generating scripts but it does not support Mozilla and other browsers. For executing tests it supports Mozilla like other browsers. d. It has limited support for web services testing. 9) How to capture a moving image in QTP? 10) What is Smart Identification in QTP and explain it? 11) How many folders are created in one Test creation in QTP? Two folders and six files. 12) What is Description object in QTP? 13) What are the Properties you use for identifying a Browser, a Page when using descriptive programming? title property for Browser title property for Page 14) How do you measure Transaction Time in QTP other than Using of Start and End Transaction Points? By using Timer function we can measure transaction times. 15) what is the Deference between Recovery Scenario and "On Error Resume Next"? 1) Both are for handling Error events, Recovery Scenario is a QTP Tool feature, whereas "On Error Resume Next" is a VB Script feature 2) "On Error Resume Next" is used when we are sure about the step where the error can occur. Recovery Scenario can be used to handle unexpected event or error. On Error Statement (Visual Basic) Enables an error-handling routine and specifies the location of the routine within a procedure; can also be used to disable an error-handling routine. Without an On Error statement, any run-time error that occurs is fatal: an error message is displayed, and execution stops. Whenever possible, we suggest you use structured exception handling in your code, rather than resorting to unstructured exception handling and the On Error statement.

16) Explain in brief about the QTP Automation Object Model. QTP Automation Object model deals with Automation of QTP itself. Almost all configuration and functionality provided by QTP is represented by QTP's Automation Object Model . Almost all dialog boxes in QTP have a corresponding automation object which can set or retrieved using the corresponding properties or methods in the Automation Object Model.QTP Automation Objects can be used along with standard VB programming elements like iterative loops or conditional statements to help you design a script of choice 17) What is Test Fusion Report ? Test Fusion Report , displays all aspects of a test run and is organized in a Tree format. It gives details of each step executed for all iterations. It also gives Run-time data table, Screen shots and movie of the test run if opted. 18) How can you handle exceptions in QTP? In QTP Exceptional handling is done by using a. Recovery Scenarios. b. Using On Error statement In Recovery scenario you have to define. 1. Triggered Events. 2. Recovery steps. 3. Post Recovery Test-Run. At Script Level you can use the On Error Resume Next and On Error Go to 0 statement. 19) What is the Difference between Bitmap Check point & Image Check point? Bitmap checkpoint does a pixel to pixel comparison of an image or part of an image. Image checkpoint does do a pixel to pixel comparison but instead compare image properties like alt text , destination url etc. 20) How would you export a Script from one PC to another in QTP ? We can make use of the "Generate Script" function available in Object Identification, Test Settings and Tools/Options tab to create a zip of the script at the source computer. These zip files then can be imported into QTP at the destination computer. 21) Can launch two instances of QTP on the same machine ? No. You can work with only single instance of QTP on the same machine. But QTP itself can work on multiple instances of the Application Under Test (AUT). Ex: QTP can handle multiple IE browser windows. 22) What is SetToProperty ? SetToProperty changes property of an object stored in the Object Repository. However these changes are not permanent.

23) What is Accessibility Checkpoint? World Wide Web Consortium (W3C) came up with some instructions and guidelines for Web-based technology and information systems to make it easy for the disabled to access the web. For example the standards make it mandatory to have an 'alt text' for an image. So a blind person who is accessing the website, will use text - to -speech converters and atleast understand what the image is about if not see it. All these standards are checked by Accessibility Checkpoints. 24) What is the difference between Properties and methods? A property is a named attribute of an object. Properties define the characteristics of an object such as Size, Color etc. or sometimes the way in which it behaves. A method is an action that can be performed on objects. For example, a dog is an object. Its properties might include long white hair, blue eyes, 3 pounds weight etc. Its methods might be move, jump, play, breath etc.

1) What are the differences between Actions and Functions and which are better? Actions: o Its a QTP feature and Local feature (not a global feature) o We can use check points in Actions o As it is QTP feature it may corrupt o Actions are slow execution Functions: o Its a VB script feature and global concept o We cant use checkpoints in functions, instead of checkpoints we can use validation points (Loops and Conditional statements) o It doesnt corrupt o Functions are faster in execution than Actions 2) How create methods in QTP? By associating procedures to test objects. 3) How to enhance tests with windows API functions? With the help of WSH (It is a Windows administration tool), we can use Windows API functions for enhancing Tests. 4) What are the major differences between functions and actions in QTP? What advantages there in functions than actions? Read 21st question and answer. 5) What is Automation Object Model? Its a process of Automating the Quick test operations. To do this we can use java script, VC++ and .NET Apart from VBscript. 6) What is Windows Script Host? WSH is a windows administration tool, it provides hosting environment for running VBscript, Jscript scripts. 7) What is exception handling? Handling expected and unexpected errors during execution 8) What is the difference between constants and variables in VB Script? We use constants for replacing literal values and constants never change. We use variables for storing values that returned by the program, functions, etc. Variable values may vary through out the script. 9) How test engineer identifies when programmatic descriptions are useful? o If application is not ready (using screenshots and documents we can prepare descriptive programming) o If we want to make our scripts global o If lengthy tests are there and that we want to execute fast

10) How to retrieve data from application objects? Using loop statements and GetROProperty method 11) How to build scripts that access data from external resources? We can fetch test data directly from external files and databases by creating automation objects Ex:ADODB, Filesystemobject 12) What is object spy used for? It is a feature of QTP, used for getting the objects information (all properties and values) .It is available in QTP tool main window, in Local repository and in object Repository Manager 13) What is the purpose of input parameters? For Passing values 14) What is an Action? How many types of Actions are there in QTP? Set of statements to perform a task or tasks is called an Action. Three types of actions are there. 1. non reusable actions 2. reusable actions 3. External actions In QTP 9.2 default action is: Non reusable In QTP 10.0 default action is: Reusable Example: Let there are two tests : test:1 and test:2 In test:1 let there are two actions a.login (reusable)and b. insert order(nonreusable) in test:2 let there are two actions a.open order(reusable) and b. fax order(non reusable) If we call login action from test:1 in test :2 then login action is called External action. In test :2 login is reusable but calling point of view its external action 15) What is a virtual object? How to configure virtual objects? Whenever QTP is not recognizing an area or user defined object as an object that we can make as a virtual object. For making virtual objects QTP is providing a feature called Virtual object manager. Through this we can configure virtual objects. 16) What are dynamic objects? The object, which properties change dynamically (frequently). We can use Regular Expressions to handle dynamic objects. 17) What is the purpose of description object? The purpose of description object is to store multiple properties values of a test object. 18) What is the advantage of associating a procedure to a test object? By associating a procedure to a test object we can use this as a method on that test object.

19) How to create a Library File? Open an Editor (Ex: Notepad), Generate some script statements and save with .vbs extension. In a library file we can put more than one function also 20) What are the disadvantages of using actions? o Action is a QTP tool feature that occupies QTPs more memory space. o It may be corrupted. o It is not a global feature. Test engineer may not have the control on action. 21) What is the difference between Test Objects and Run Time Objects ? Test objects are basic and generic objects that QTP recognize. Run time object means the actual object to which a test object maps. 22) Can i change properties of a test object? Yes. You can use SetTOProperty to change the test object properties. It is recommended that you switch off the Smart Identification for the object on which you use SetTOProperty function. Can i change properties of a run time object? No (but Yes also). You can use GetROProperty("outerText") to get the outerText of a object but there is no function like SetROProperty to change this property. But you can use WebElement().object.outerText="Something" to change the property. 23) When and Why to use Descriptive programming? Below are some of the situations when Descriptive Programming can be considered useful: The objects in the application are dynamic in nature and need special handling to identify the object. The best example would be of clicking a link which changes according to the user of the application, Ex. Logout <<UserName>>. When object repository is getting huge due to the no. of objects being added. If the size of Object repository increases too much then it decreases the performance of QTP while recognizing a object. When you dont want to use object repository at all. Well the first question would be why not Object repository? Consider the following scenario which would help understand why not Object repository Scenario 1: Suppose we have a web application that has not been developed yet. Now QTP for recording the script and adding the objects to repository needs the application to be up, that would mean waiting for the application to be deployed before we can start of with making QTP scripts. But if we know the descriptions of the objects that will be created then we can still start off with the script writing for testing Scenario 2: Suppose an application has 3 navigation buttons on each and every page. Let the buttons be Cancel, Back and Next. Now recording action on these buttons would add 3 objects per page in the repository. For a 10 page flow this would mean 30 objects which could have been represented just by using 3 objects. So instead of adding these 30 objects to the repository we can just write 3 descriptions for the object and use it on any page. Modification to a test case is needed but the Object repository for the same is Read only or in shared mode i.e. changes may affect other scripts as well. When you want to take action on similar type of object i.e. suppose we have 20 textboxes on the page and there names are in the form txt_1, txt_2, txt_3 and so on. Now adding all 20 the Object repository would not be a good programming approach. 24) How to use Descriptive programming? There are two ways in which descriptive programming can be used: a) Static Programming: By giving the description in form of the string arguments. b) dynamic Programming: By creating properties collection object for the description

2) What are the important factors in test tool selection? a. Technical factors: i. Nature of the AUT (Application Under Test) ii. Tool Features (Facilities available) iii. Availability of Skilled professionals iv. Organizations experience v. Technical support from vendor b. Business factors: i. Budget ii. Vendors Reputation iii. Clients Interest 3) What test cases can be automated? Test cases that we want to execute on number of versions of the software Ex: Regression test cases Test cases that we want to execute with multiple sets of data Ex: Data driven test cases Test cases having complex functionality 4) What test cases cannot be automated Dynamically changing functionality Test cases that require more Human interaction CUI (command user interface) based test cases 5) Explain about the Testing process in QTP? Planning: Analyzing the Application Automation Framework Implementation Selecting/Generating Test cases for Automation Collecting Test Data Configuring Tool Settings Generating the basic tests Using Object Repository method or using Descriptive Programming, we can generate Tests Enhancing Tests With respect to our project requirements, we have to enhance our tests. For enhancing tests QTP is providing various features like: Inserting Transaction points Synchronization Parameterization Inserting VB script Flow Control statements Adding comments Calling Functions/ calling Actions Using Environment variables Entering Regular Expressions Inserting Checkpoints Inserting Output values Etc.. Note: For any Test all enhancement methods not required. Debugging Tests (if required) It is optional; basically scripting languages are Light weight languages, no need to compile them separately. During execution Scripts can be compiled and Run. If we have any doubts about some scripts, then we can execute them step by step with the support of VBScript Debug commands and Break points Running tests

Generally, many companies are using Framework feature for Running Tests. QTP Supports Individual Test execution, Batch execution, Tests execution through AOM Scripting, and Scheduled execution with the support of Windows Operating system. Analyzing Results It is not the Responsibility of QTP; Test engineer has to do this manually. QTP is providing Result window in XML format. QTP is providing Result deletion tool also. QTP is providing Test results exporting facility. It supports HTML, Word document and PDF (portable document format) formats. Reporting defects Reporting defects also not a QTP responsibility that we have to do manually after analyzing the results, but if we are using Quality Center, from QTP result window we can send defects directly. 6) Explain about the object identification configuration process in QuickTest? 7) What types of License available for QTP? a) Seat License or Node locked: Fixed for one System (Machine), we can use from that System only b) Concurrent License or Floating License: This License, we can use from different Systems but one at a time 8) How to generate Basic scripts/tests from Manual Test cases in QTP? For generating basic tests QTP is providing 1) Object repository 2) Descriptive Programming a) Object repository: Recording (Local Repository) And/or Shared object Repository b) Descriptive programming or Programmatic Descriptions 9) What is the difference between Local and Shared object Repository? Local: QTP creates a Local Repository for every Action during Recording automatically It cant be shared among other tests Its a QTP internal file Users no need to maintain separately (auto save) Extension is .mtr (mercury test repository/module test repository) Shared: User creates shared repository by adding objects That can be shared among number of tests User has to maintain shared object repository files Extension is .tsr (test shared repository) 10) How to maintain objects in Object Repository? Same as above 9th 11) What is Synchronization? It is a process of matching the speeds of both QTP and AUT in order to get proper execution and results 12) How to synchronize QTP and AUT? For synchronizing QTP and AUT, QTP is providing below methods (features) Wait statements Synchronizations points Increasing tool default synchronization time (Increase timeout) Sync method (Only for web) Using Exit property also we can use (GUI and web) Limited usage 13) How to parametrize tests? It is a process of passing parameters for replacing constant values. In QTP several methods are available a. Through Looping : Here some limitations are there :

We can use Looping for sequential numbers and logical numbers only, if it is a string we cant use. b. Through Data table c. Fetching test data directly from external files (excel, flat files) d. Fetching test data directly from databases e. Fetching data from AUT objects (front-end objects) 14) How to Generate Non-recordable steps? Using Step Generator, we can generate non recordable steps 15) What are the benefits of Step Generator? Its a library of functions and utility objects. Through this we can generate recordable and non recordable steps, utility statements and built in functions. 16) How to count Links in a web page without using page checkpoint? Using Description object and Childobjects method 17) How to count all available objects in a dialog box /a window/a web page? Using Childobjects method 18) What are the major disadvantages in record tests? Recording disadvantages: It occupies a lot of memory space due to this, QTP performance will be reduced Modifications are very difficult User may not have command on the script, if any modifications are there user may not understand properly Recorded scripts are QTP internal files, they may corrupt. 19) What are the disadvantages in using of checkpoints? They are QTP internal files we cant use in external functions As they are QTP internal files they may corrupt As it is ready made feature, that has limited usage 20) In QuickTest Pro can we insert Checkpoints programmatically? How? Yes. We can insert checkpoints programmatically with the help of GetRoProperty method. 21) What are Differences between Design time Data Table and Run-time Data Table? Design Time Data Table: It is viewed in the QTP Main Test It is created prior to the test execution It represents data from external Sources Run-Time Data Table: It is viewed in the QTP Test Result Window It is created in Test Results after test execution. It represents a live version of design Time Data table.

1) What is Recording in QTP? Ans : It is process of creating the main body of a test by recording the typical processes that users perform. QuickTest records the operations we perform, displays them as steps in the Keyword View, and generates them in a script (in the Expert View). 2) How many Recording Modes available in QTP? What are they? There are 3 Recording modes available in QTP. 1) Normal Recording 2) Analog Recording 3) Low Level Recording 3) What is Analog Recording mode? It Records exact mouse and keyboard operations, we can use this mode for recording continues mouse operations like digital signatures, paints etc.. This mode doesn't generate statements for each and every operation, generates all operations in a Track file. By default this mode is disabled, after selecting Normal Recording mode only it enables. 4) What is Low Level Recording? It Records some operations on Non-supported environments apart from Normal operations. 5) What are object and Software Objects? Object: Object is something, which has structure and properties. Software Object: an object is any entity that can be manipulated by the commands of a programming language, such as a value, variable, function, or data structure. Example: GUI (Windows) Environment: Window, Dialog box, Edit Box, Button, Check Box, Radio Button, List Box and Combo Box etc... Web Environment: Browser, Page, Link, Image, edit Box, Button, Grid, Frame Etc.. 6) What type of Objects available in QTP? There are 4 types of Objects available in QTP. 1) Run-time Objects 2) Test Objects 3) Utility Objects 4) Automation / User Defined Objects 7) What are Utility Objects? These are QTP reserved objects, used for Testing and Result reporting. Example: a) SystemUtil b) Reporter c) DataTable d) Services e) environment etc... 8) What is Automation Object? An object that is exposed to other applications or programming tools through Automation interfaces. 9) Explain about Object, Property and value? Object: It is something which has structure and properties Property: an attribute of an Object. Value: Value of the Property

10) What is Object Repository? It is a Storage place for Storing Objects, QTP has 2 types of Repositories. a) Local Repository b) Shared Repository 11) What are the differences between Local and Shared Repositories? Local Repository: QTP Creates a Local Repository for every Action during Recording automatically and also QTP maintenance Local Repositories, but user can edit these repositories. It is a QTP Internal file, extension is .mtr Shared Repository: User Creates Shared Repositories by adding objects in Object Repository Manager.This can be shared among nuber of tests. User has to maintain shared repository files Shared Repository files are External files, extension is .tsr 12) How to Start Test Automation Process, before the Application is ready? QTP is providing a feature called "Define New Test Object" for creating new objects without Application. This feature available in Local Repository and Object Repository Manager. 13) How to Combine Repositories? We Can combine Repositories using Object Repository Merge Tool. It is available in Object Repository Manager 14) Explain about Statement, Action and Test in QTP? a) Statement: an Instruction or a minimal executable unit b) Action: Set of Statements c) Test: One or more Actions 15) How Load repository files During run-time? We can Load Object Repositories during run-time using an Utility object called "RepositoriesCollection" Syntax: RepositoriesCollection.Add "path of the Repository file" Example: RepositoriesCollection.Add "D:\AHAMAD.tsr" QTP Basic Features 1) What are the advantages in Test Automation? a) Fast: Test Tool runs tests significantly faster than human users. b) Reliable: Automation tool can perform the same operation each time, if we repeated multiple times, so that we can eliminate human errors. c) Repeatable: We can check how application or website reacts after repeated the same operation with multiple times. d) Reusable: Automation scripts are reusable on different version of the application of websites even if the user interfaces changes. e) Comprehensive: In automation testing we can build a suit of tests that covers every feature in the application or website. f) Programmable: We can program sophisticated Tests that bring out hidden information from the application 2) What are the drawbacks in Test Automation? a) It is expensive b) We cannot automate all areas. c) Lack of Skill

d) It has some limitations (It cannot test every thing) 3) What type of test tools available in the industry? We can segregate Test tools in 2 categories a) Business Classification 1) Vendor Tools 2) Open Source Tools 3) In-house Tools b) Technical Classification 1) Functional and Regression Test Tools 2) Load/Stress/Performance Test Tools 3) Security Test Tools 5) Test Management Tools 6) Unit Test Tools 7) Requirement Management Tools Etc... 4) What are the important factors in test tool selection? a. Technical factors: i. Nature of the AUT (Application Under Test) ii. Tool Features (Facilities available) iii. Availability of Skilled professionals iv. Organizations experience v. Technical support from vendor b. Business factors: i. Budget ii. Vendors Reputation iii. Clients Interest 5) What test cases can be automated? Test cases that we want to execute on number of versions of the software Ex: Regression test cases Test cases that we want to execute with multiple sets of data Ex: Data driven test cases Test cases having complex functionality 6) What test cases cannot be automated? Dynamically changing functionality Test cases that require more Human interaction CUI (command user interface) based test cases 7) Explain about the Testing process in QTP? Planning: Analyzing the Application Automation Framework Implementation Selecting/Generating Test cases for Automation Collecting Test Data Configuring Tool Settings Generating the basic tests Using Object Repository method or using Descriptive Programming, we can generate Tests Enhancing Tests With respect to our project requirements, we have to enhance our tests. For enhancing tests QTP is providing various features like: Inserting Transaction points Synchronization Parameterization Inserting VB script Flow Control statements

Adding comments Calling Functions/ calling Actions Using Environment variables Entering Regular Expressions Inserting Checkpoints Inserting Output values Etc.. Note: For any Test all enhancement methods not required. Debugging Tests (if required) It is optional; basically scripting languages are Light weight languages, no need to compile them separately. During execution Scripts can be compiled and Run. If we have any doubts about some scripts, then we can execute them step by step with the support of VBScript Debug commands and Break points Running tests Generally, many companies are using Framework feature for Running Tests. QTP Supports Individual Test execution, Batch execution, Tests execution through AOM Scripting, and Scheduled execution with the support of Windows Operating system. Analyzing Results It is not the Responsibility of QTP; Test engineer has to do this manually. QTP is providing Result window in XML format. QTP is providing Result deletion tool also. QTP is providing Test results exporting facility. It supports HTML, Word document and PDF (portable document format) formats. Reporting defects Reporting defects also not a QTP responsibility that we have to do manually after analyzing the results, but if we are using Quality Center, from QTP result window we can send defects directly. 8) What types of License available for QTP? a) Seat License or Node locked Fixed for one System (Machine), we can use from that System only b) Concurrent License or Floating License This License, we can use from different Systems but one at a time 9)What are the QTP supported environments? QTP Supports Software Applications based on Add-ins only Add-in means Technology supporting files QTP Add ins available for following technologies: a) Default Add ins 1) Activex 2) Visual Basic 3) Web b) Other Add-ins 1) Delphi 2) Java 3) .NET Web forms 4) .NET Windows forms 5) WPF (Windows Presentation Foundation) 6) Oracle 7) People Soft 8) Power Builder 9) SAP for Web 10) SAP GUI for windows environment 11) Siebel Environment

12) Standard Windows 13) Terminal Emulator (TE) 14) Visual Age Smalltalk Environment 15) Web Services Environment 10) Does QTP Support UNIX Environment? No, QTP doesnt support UNIX/Linux Environment, Supports Windows Operating Environment only, but LoadRunner and Quality Center have support both Windows and UNIX Operating Environments. 11) What is the scripting language that used in QTP for applying programming logic? Micro Soft Visual Basic Scripting edition (VBScript) engine embedded with QTP. 12) Does QTP Support Database Testing and Data driven Testing? Yes, SQL Engine embedded with QTP Tool, so we use SQL Statements directly in QTP Test Pane as well as in Function Library. QTP has an integrated Spread sheet(Excel like) for Performing Data Driven Testing, otherwise we can fetch test data directly from external files and databases using VB Script. Creating Tests (Recording & Running, Object Repository and Object Identification Configuration) 1) What is Recording in QTP? It is process of creating the main body of a test by recording the typical processes that users perform. QuickTest records the operations we perform, displays them as steps in the Keyword View, and generates them in a script (in the Expert View). 2) How many Recording Modes available in QTP? What are they? There are 3 Recording modes available in QTP. 1) Normal Recording 2) Analog Recording 3) Low Level Recording 3) What is Analog Recording modes It Records exact mouse and keyboard operations, we can use this mode for recording continues mouse operations like digital signatures, paints etc.. This mode doesn't generate statements for each and every operation, generates all operations in a Track file. By default this mode is disabled, after selecting Normal Recording mode only it enables. 4) What is Low Level Recording? It Records some operations on Non-supported environments apart from Normal operations. 5) What are object and Software Objects? Object: Object is something, which has structure and properties. Software Object: an object is any entity that can be manipulated by the commands of a programming language, such as a value, variable, function, or data structure. Example: GUI (Windows) Environment: Window, Dialog box, Edit Box, Button, Check Box, Radio Button, List Box and Combo Box etc... Web Environment: Browser, Page, Link, Image, edit Box, Button, Grid, Frame Etc.. 6) What type of Objects available in QTP? There are 4 types of Objects available in QTP. 1) Run-time Objects 2) Test Objects 3) Utility Objects 4) Automation / User Defined Objects 7) What are Utility Objects? These are QTP reserved objects, used for Testing and Result reporting. Example

a) SystemUtil b) Reporter c) DataTable d) Services e) environment etc... 8) What is Automation Object? An object that is exposed to other applications or programming tools through Automation interfaces. 9) Explain about Object, Property and value? Object: It is something which has structure and properties Property: an attribute of an Object. Value: Value of the Property 10) What is Object Repository? It is a Storage place for Storing Objects, QTP has 2 types of Repositories. a) Local Repository b) Shared Repository 11) What are the differences between Local and Shared Repositories? Local Repository: QTP Creates a Local Repository for every Action during Recording automatically and also QTP maintenance Local Repositories, but user can edit these repositories. It is a QTP Internal file, extension is .mtr Shared Repository: User Creates Shared Repositories by adding objects in Object Repository Manager.This can be shared among nuber of tests. User has to maintain shared repository files Shared Repository files are External files, extension is .tsr 12) How to Start Test Automation Process, before the Application is ready? QTP is providing a feature called "Define New Test Object" for creating new objects without Application. This feature available in Local Repository and Object Repository Manager. 13) How to Combine Repositories? We Can combine Repositories using Object Repository Merge Tool. It is available in Object Repository Manager 14) Explain about Statement, Action and Test in QTP? a) Statement: an Instruction or a minimal executable unit b) Action: Set of Statements c) Test: One or more Actions Design Time Data Table: It is viewed in the QTP Main Test It is created prior to the test execution It represents data from external Sources Run-Time Data Table: It is viewed in the QTP Test Result Window It is created in Test Results after test execution. It represents a live version of design Time Data table. QTP Interview Questions Part-IV 1) What are the differences between Actions and Functions and which are better? Actions: Its a QTP feature and Local feature (not a global feature) We can use check points in Actions As it is QTP feature it may corrupt Actions are slow execution

Functions: Its a VB script feature and global concept We cant use checkpoints in functions, instead of checkpoints we can use validation points (Loops and Conditional statements) It doesnt corrupt Functions are faster in execution than Actions 2) How create methods in QTP? By associating procedures to test objects. 3) How to enhance tests with windows API functions? With the help of WSH (It is a Windows administration tool), we can use Windows API functions for enhancing Tests. 4) What are the major differences between functions and actions in QTP? What advantages there in functions than actions? Read 21st question and answer. 5) What is Automation Object Model? Its a process of Automating the Quick test operations. To do this we can use java script, VC++ and .NET Apart from VBscript. 6) What is Windows Script Host? WSH is a windows administration tool, it provides hosting environment for running VBscript, Jscript scripts. 7) What is exception handling? Handling expected and unexpected errors during execution 8) What is the difference between constants and variables in VB Script? We use constants for replacing literal values and constants never change. We use variables for storing values that returned by the program, functions, etc. Variable values may vary through out the script. 9) How test engineer identifies when programmatic descriptions are useful? If application is not ready (using screenshots and documents we can prepare descriptive programming) If we want to make our scripts global If lengthy tests are there and that we want to execute fast 10) How to retrieve data from application objects? Using loop statements and GetROProperty method 11) How to build scripts that access data from external resources? We can fetch test data directly from external files and databases by creating automation objects Ex:ADODB, Filesystem object 12) What is object spy used for? It is a feature of QTP, used for getting the objects information (all properties and values) .It is available in QTP tool main window, in Local repository and in object Repository Manager 13) What is the purpose of input parameters? For Passing values 14) What is an Action? How many types of Actions are there in QTP? Set of statements to perform a task or tasks is called an Action. Three types of actions are there. 1. non reusable actions 2. reusable actions 3. External actions In QTP 9.2 default action is: Non reusable In QTP 10.0 default action is: Reusable Example: Let there are two tests : test:1 and test:2

In test:1 let there are two actions a.login (reusable)and b. insert order(nonreusable) in test:2 let there are two actions a.open order(reusable) and b. fax order(non reusable) If we call login action from test:1 in test :2 then login action is called External action. In test :2 login is reusable but calling point of view its external action 15) What is a virtual object? How to configure virtual objects? Whenever QTP is not recognizing an area or user defined object as an object that we can make as a virtual object. For making virtual objects QTP is providing a feature called Virtual object manager. Through this we can configure virtual objects. 16) What are dynamic objects? The object, which properties change dynamically (frequently). We can use Regular Expressions to handle dynamic objects. 17) What is the purpose of description object? The purpose of description object is to store multiple properties values of a test object. 18) What is the advantage of associating a procedure to a test object? By associating a procedure to a test object we can use this as a method on that test object. 19) How to create a Library File? Open an Editor (Ex: Notepad), Generate some script statements and save with .vbs extension. In a library file we can put more than one function also 20) What are the disadvantages of using actions? Action is a QTP tool feature that occupies QTPs more memory space. It may be corrupted. It is not a global feature. Test engineer may not have the control on action. 21) What is the difference between Test Objects and Run Time Objects ? Test objects are basic and generic objects that QTP recognize. Run time object means the actual object to which a test object maps. 22) Can i change properties of a test object? Yes. You can use SetTOProperty to change the test object properties. It is recommended that you switch off the Smart Identification for the object on which you use SetTOProperty function. Can i change properties of a run time object? No (but Yes also). You can use GetROProperty("outerText") to get the outerText of a object but there is no function like SetROProperty to change this property. But you can use WebElement().object.outerText="Something" to change the property. 23) When and Why to use Descriptive programming? Below are some of the situations when Descriptive Programming can be considered useful: The objects in the application are dynamic in nature and need special handling to identify the object. The best example would be of clicking a link which changes according to the user of the application, Ex. Logout <<UserName>>. When object repository is getting huge due to the no. of objects being added. If the size of Object repository increases too much then it decreases the performance of QTP while recognizing a object. When you dont want to use object repository at all. Well the first question would be why not Object repository? Consider the following scenario which would help understand why not Object repository Scenario 1: Suppose we have a web application that has not been developed yet. Now QTP for recording the script and adding the objects to repository needs the application to be up, that would mean waiting for the application to be deployed before we can start of with making QTP

scripts. But if we know the descriptions of the objects that will be created then we can still start off with the script writing for testing Scenario 2: Suppose an application has 3 navigation buttons on each and every page. Let the buttons be Cancel, Back and Next. Now recording action on these buttons would add 3 objects per page in the repository. For a 10 page flow this would mean 30 objects which could have been represented just by using 3 objects. So instead of adding these 30 objects to the repository we can just write 3 descriptions for the object and use it on any page. Modification to a test case is needed but the Object repository for the same is Read only or in shared mode i.e. changes may affect other scripts as well. When you want to take action on similar type of object i.e. suppose we have 20 textboxes on the page and there names are in the form txt_1, txt_2, txt_3 and so on. Now adding all 20 the Object repository would not be a good programming approach. 24) How to use Descriptive programming? There are two ways in which descriptive programming can be used: a) Static Programming: By giving the description in form of the string arguments. b) dynamic Programming: By creating properties collection object for the description. 1) What are the extensions of QTP files? QTP Test / Test Script(.mts){.mts=module/mercury test script} Local Repository file (.mtr){.mtr=module/mercury test repository} Shared repository files(.tsr){Test shared repository} Library files (.vbs) Environmental files (.xml) Test batch file (.mtb){module test batch} QTP result file (xml) optional: pdf, doc, xml-for reporting Recovery scenario file (.qrs){quick recovery scenario} 2) How to handle dynamic objects? By using Regular expressions we can handle dynamic objects. 3) What are the differences between checkpoint and output value? Both are same in insertion but different in purpose. Checkpoint is a verification point, it takes expected results from the user and compare with the actual results during execution and provides test results. Output value captures object properties values, database content and xml elements values and stores in run time data table. Checkpoints compare actual results with expected results, output values captures values and stores. 4) How to handle Repositories dynamically? With Repositoriescollection utility object, we can handle shared object repositories dynamically. Note: on Repositoriescollection object, we can use Add, Find, Remove, and Removeall like methods. 5) What is the use of environment variables? Environment variables are global variables that we can use from number of tests commonly. Whenever we want to use some variables from number of tests, instead of declaring as local variables, if we use environment variables concept then maintenance will be easy. 6) What is a Regular Expression, where we use this feature in QTP? Regular expression is nothing but matching patterns. In QTP, we use this feature for identifying dynamic objects 7) What is the advantage of Dynamic Descriptive Programming than Static? Incase of dynamic programming Tests generation is easy and maintenance also very easy. 8) What are the limitations of QuickTest? a. It supports MS Windows operating environment only b. It doesnt support CLI Applications (Command line interface)

c. It supports IE only for generating scripts but it does not support Mozilla and other browsers. For executing tests it supports Mozilla like other browsers. d. It has limited support for web services testing. 9) How to capture a moving image in QTP? 10) What is Smart Identification in QTP and explain it? 11) How many folders are created in one Test creation in QTP? Two folders and six files. 12) What is Description object in QTP? 13) What are the Properties you use for identifying a Browser, a Page when using descriptive programming? title property for Browser title property for Page 14) How do you measure Transaction Time in QTP other than Using of Start and End Transaction Points? By using Timer function we can measure transaction times. 15) what is the Deference between Recovery Scenario and "On Error Resume Next"? 1) Both are for handling Error events, Recovery Scenario is a QTP Tool feature, whereas "On Error Resume Next" is a VB Script feature 2) "On Error Resume Next" is used when we are sure about the step where the error can occur. Recovery Scenario can be used to handle unexpected event or error. ******************************************************** On Error Statement (Visual Basic) Enables an error-handling routine and specifies the location of the routine within a procedure; can also be used to disable an error-handling routine. Without an On Error statement, any run-time error that occurs is fatal: an error message is displayed, and execution stops. Whenever possible, we suggest you use structured exception handling in your code, rather than resorting to unstructured exception handling and the On Error statement. 16) Explain in brief about the QTP Automation Object Model. QTP Automation Object model deals with Automation of QTP itself. Almost all configuration and functionality provided by QTP is represented by QTP's Automation Object Model . Almost all dialog boxes in QTP have a corresponding automation object which can set or retrieved using the corresponding properties or methods in the Automation Object Model.QTP Automation Objects can be used along with standard VB programming elements like iterative loops or conditional statements to help you design a script of choice 17) What is Test Fusion Report ? Test Fusion Report , displays all aspects of a test run and is organized in a Tree format. It gives details of each step executed for all iterations. It also gives Run-time data table, Screen shots and movie of the test run if opted. 18) How can you handle exceptions in QTP? In QTP Exceptional handling is done by using a. Recovery Scenarios. b. Using On Error statement In Recovery scenario you have to define. 1. Triggered Events. 2. Recovery steps. 3. Post Recovery Test-Run. At Script Level you can use the On Error Resume Next and On Error Go to 0 statement. 19) What is the Difference between Bitmap Check point & Image Check point? Bitmap checkpoint does a pixel to pixel comparison of an image or part of an image.

Image checkpoint does do a pixel to pixel comparison but instead compare imageproperties like alt text , destination url etc. 20) How would you export a Script from one PC to another in QTP ? We can make use of the "Generate Script" function available in Object Identification, Test Settings and Tools/Options tab to create a zip of the script at the source computer. These zip files then can be imported into QTP at the destination computer. 21) Can launch two instances of QTP on the same machine ? No. You can work with only single instance of QTP on the same machine. But QTP itself can work on multiple instances of the Application Under Test (AUT). Ex: QTP can handlemultiple IE browser windows. 22) What is SetToProperty ? SetToProperty changes property of an object stored in the Object Repository. However these changes are not permanent. 23) What is Accessibility Checkpoint? World Wide Web Consortium (W3C) came up with some instructions and guidelines for Web-based technology and information systems to make it easy for the disabled to access the web. For example the standards make it mandatory to have an 'alt text' for an image. So a blind person who is accessing the website, will use text - to -speech converters and atleast understand what the image is about if not see it. All these standards are checked by Accessibility Checkpoints. 24) What is the difference between Properties and methods? A property is a named attribute of an object. Properties define the characteristics of an object such as Size, Color etc. or sometimes the way in which it behaves. A method is an action that can be performed on objects. For example, a dog is an object. Its properties might include long white hair, blue eyes, 3 pounds weight etc. Its methods might be move, jump, play, breath etc. Q. 100: What is a XML Check Point in QTP? It is a checkpoint which checks the data content of XML documents in XML files or XML documents in Web pages and frames. The XML Checkpoint option is supported for the Web add-in environment & for all add-in environments. Q. 101: What is the process of capturing visible portion of an object in QTP? QTP captures the visible part of the specified object as a bitmap and inserts a checkpoint in the test. QTP does not capture any part of the screen which happens to be scrolled off the screen. We can check an area of an application as a bitmap. While creating a test, we specify the area you want to check by selecting an object. We can check an entire object or any area within an object. Q. 102: What is the process of comparing selected area of object with Bitmap stored in the checkpoint? When we run the test, QTP compares the object or selected area of the object in the application with the bitmap stored in the checkpoint. If there are differences, QTP captures a 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), we can identify the nature of the discrepancy. Q. 103: How can we define a time interval for QTP to perform a checkpoint successfully? For defining some time interval (say in seconds) during which QTP shopuld attempt to perform the checkpoint successfully, we need to specify the Checkpoint Timeout. QTP

continues to perform the checkpoint until it passes or until the timeout occurs. If the checkpoint does not pass before the timeout occurs, the checkpoint fails. For example, suppose it takes some time for an object to achieve an expected state. Increasing the checkpoint timeout value in this case can help ensure that the object has sufficient time to achieve that state, enabling the checkpoint to pass (if the data matches) before the maximum timeout is reached. Q. 104: How can we check the object property values in our application? We can check that a specified object in our application has the property values we expect, by adding a standard checkpoint step to our test while recording or editing the test. Standard checkpoints compare the expected values of object properties to the objects current values during a run session. We can use standard checkpoints to perform checks on images, tables, Web page properties, and other objects within our application. Q. 105: How can we identify a checkpoint in QTP? We identify a checkpoint by its name. By default, the checkpoint name is the same as the name of the test object on which the checkpoint was created. We can specify a different name for the checkpoint or accept the default name. If we want to rename a checkpoint, make sure that the name is unique, and it does not begin or end with a space, and does not contain the special charactesr like := @@ Q. 106: How can we Insert statement option when adding a checkpoint during the recording? The Insert statement option is not available when adding a checkpoint during recording or when modifying an existing object checkpoint. It is available only when adding a new checkpoint to an existing test while editing it. Q. 107: How can we compare the image files in the Image Checkpoint? We can compare the image files in the Image Checkpoint by using the Compare image content option in the Image Checkpoint Properties dialog box. It compares the expected image source file with the graphic of the actual image source file. If the expected and actual images are different, QTP displays them both in the Test Results. If the images are identical, only one graphic is displayed. Q. 108: How can we check the contents of tables in our application in QTP? We can check the contents of tables in our application by adding table checkpoints to the test. For example, we can check that a specified value is displayed in a particular cell. We can also check the properties of the table object. For example, we can check that a table has the expected number of rows and columns. When we run the test, the table checkpoint compares the actual data to the expected data, as defined in the checkpoint. If the results match, the checkpoint passes. Q. 109: How do we compare actual cell values with the expected cell values in Tables in QTP?. By using the Settings tab we can compare actual cell values with the expected cell values in tables. By using Verification type option we can compare following types of cell contents. 1) String Content: It is the default setting. It treats the cell values as strings and checks for the exact text, while ignoring spaces. For example, 2 and 2.00 are not recognized as the same string. 2) Numeric Content: Evaluates the content of the cell according to numeric values. For example, 2 and 2.00 are recognized as the same number.

3) Numeric Range: Compares the content of the cell against a numeric range, where the minimum and maximum values are any real number that we specify. Q. 110: How can we check the location of a cell to be checked in a Column of a table? By the use of Identify columns option available in Cell Identification tab. This specifies the location of the column containing the cells with which we want to compare the expected data. This is done in two ways: 1) By position: This is the Default option. It locates cells according to the column position. A shift in the position of the columns within the table results in a mismatch. 2) By column name: It locates cells according to the column name. A shift in the position of the columns within the table does not result in a mismatch. This option gets enabled only when the table contains more than one column. Q. 111: How can we check the location of a cell to be checked in a Row of a table? By the use of Identify columns option available in Cell Identification tab. This specifies the location of the row containing the cells with which you want to compare the expected data. This is done in two ways: 1) By row number: This is the Default option. It locates cells according to the row position. A shift in the position of any of the rows within the table results in a mismatch. 2) By selected key columns: It locates the rows containing the cells to be checked by matching the value of the cell whose column was previously selected as a key column. A shift in the position of the row does not result in a mismatch. If more than one row is identified, QTP checks the first matching row. We can use more than one key column to uniquely identify any row. Q. 112: How can we ensure that a text string appears in a specified area in QTP? With the help of Text Area Checkpoint, we can ensure that a particular text string appears within a defined area in a Windows application, according to the specified criteria. It is supported for a variety of QTP add-in environments, like Standard Windows, Java, Visual Basic, and ActiveX etc. Q. 113: How QTP retrieves Text while checking the text during the test? QTP tries to retrieve the text directly from the object. If QTP cannot retrieve the text in this manner in some case where the text happens to be the part of a picture, it tries to retrieve the text using an OCR commonly known as optical character recognition mechanism. Q. 114: How can we check the databases accessed by our application in QTP? We can use database checkpoints to check the databases accessed by your application. For this, we define a query on the database. Then we create a database checkpoint for checking the results of the query. A database query can be defined in two ways like: 1) By Microsoft Query: We can install Microsoft Query from the custom installation of the Microsoft Office. 2) By manually defining an SQL statement. Q. 115: How can we check a current data value with a value stored in a database in QTP? With the help of database checkpoint we can check a current data value with a value stored in the database. When we run the test, the database checkpoint compares the current data in the database to the expected data defined in the Database Checkpoint Properties dialog

box. If the expected data and the current results do not match, the database checkpoint fails. Q. 116: What is the maximum number of rows, which can be defined in a database in QTP? We can specify a maximum of 32,000 rows. Q. 117: What is XML? XML also called as Extensible Markup Language is a meta-markup language for text documents. This is recognized as a standard by the World Wide Web Consortium or called W3C in short. XML makes the complex data structures portable between different computer environments and programming languages, facilitating the sharing of data. XML files contain text with simple tags that describe the data within an XML document. These tags describe the data content, but not the presentation of the data. Applications that display an XML document or file use either Cascading Style Sheets (CSS) or XSL Formatting Objects (XSL-FO) to present the data. Q. 118: How can we verify the data content of XML files? With the help of XML checkpoints, we can verify the data content of XML files. Common uses of XML checkpoints are: 1) We can validate that the data has not changed from one application release to the other. 2) We can check the content of an element to make sure that its tags, attributes, and values have not changed. 3) We can verify that the web service returns the XML in the expected structure and with the expected values. Q. 119: What are the various types of XML checkpoints in QTP? We can create three types of XML checkpoints in QTP: 1) XML Web Page / Frame Checkpoint: This checks an XML document within a Web page or frame. 2) XML File Checkpoint: This checks a specified XML file. 3) XML Test Object Checkpoint: This checks the XML data for an object or operation. Q. 120: What is the use of XML Checkpoints on Web service operations? XML Checkpoints on Web service operations compare the expected values of the checkpoint to the actual values returned from the last native Web service operation performed on the test object. If a different Web service operation step is performed prior to the checkpoint, then the checkpoint will fail. Q. 121: What is the use of XML Tree? XML tree displays the hierarchical relationship between each element and value in the XML tree, enabling us to select the specific elements, attributes and values we want to check. Each element is displayed with a (X) icon. Each value is displayed with a (V) icon. Q. 122: How many types of element checks are available in XML Checkpoints in QTP? 1) Check number of attributes: It checks the number of attributes that are attached to the element. 2) Check number of child element occurrences in block: Displays the number of child elements associated with the selected parent element. If we select this option, QTP verifies that the number of child elements in your XML tree corresponds to the number that appears in the Check number of child element occurrences in block field.

Q. 123: What is Schema Validation? We can activate Schema Validation button to confirm that the XML in our application or file adheres to the structure defined in a specific XML schema or schemas. We can validate the structure of the XML we are checking using one or more external schema files or using schema embedded within our XML document. Q. 124: What are the methods to populate the XML Tree? We can use any one of the following three methods to populate the XML tree: 1) Updating the XML Tree Manually 2) Importing an XML Tree from a File 3) Updating the XML Tree Using Update Run Mode Q. 125: What are the special guidelines for Schema Validation? We consider following guidelines when specifying a schema file to validate our XML. 1) If we are validating an XML file using a schema defined in the XML file, the schema can be defined with an absolute or relative path. When we specify a relative path, QTP searches for the schema in the folders listed in the Folders tab of the Options dialog box. 2) If we are validating an XML document located on the Web with a schema file located on our file system, we cannot use UNC format (for example, \\ComputerName\Path\To\Schema) to specify the schema file location. Instead, map the schema file location to a network drive. 3) If there is a schema with a namespace defined in our XML document, the namespace of the external schema must be identical to the one defined in our document. 4) When we perform a schema validation, QTP validates all of the elements in the XML document, even if certain XML elements are not associated with a schema file. Any XML elements that are not associated with a schema file will cause the schema validation to fail. Q. 126: What is the use of Parameterizing in QTP? We can use the parameter feature in QTP to enhance our test by parameterizing the values that it uses. A parameter is a variable that is assigned a value from an external data source or generator. We can parameterize values in steps and checkpoints in your test. We can also parameterize the values of action parameters. Q. 127: What is the use of Data Driver when adding parameters in QTP? If we want to parameterize the same value in several steps in our test, it is better to use the Data Driver rather than adding parameters manually. Q. 128: How can we parameterize a step in QTP? We can parameterize a step by using a test or action input parameter. This enables the step to use values that have been passed from the application that ran our test. For example, we can use an input test parameter as the value for a method argument. Q. 129: What is the use of Data Table Parameters in QTP? We can supply the list of possible values for a parameter by creating a Data Table parameter. Data Table parameters enable us to create a data-driven test, or action that runs several times using the data you supply. In each repetition, or iteration, QTP uses a different value from the Data Table. We could conduct the test by accessing the Web site and recording the submission of numerous queries. This is a slow, laborious, and inefficient solution. By using Data Table parameters, we can run the test for multiple queries in succession. Q. 130: What are the options available for configuring Data Table Parameters?

1) Name: Specifies the name of the parameter in the Data Table. We can create a new parameter by using the default parameter name or entering a new, descriptive name. Alternatively, we can select an existing Data Table parameter from the list. 2) Location in Data Table: Specifies whether to store the parameter in the global or current action sheet in the Data Table. Q. 131: What is the use of Data Table formula in parametrization of data tables? Data Table formula option inserts two columns in the Data Table. The first column contains a formula that checks the validity of output in the second column. QTP uses the data in the output column to compute the formula, and inserts a value of TRUE or FALSE in the table cell of the formula column. This option is available only for the checkpoints. Q. 132: What is the use of Global Data Table parameters in QTP? Global Data Table parameters take data from the Global sheet in the Data Table. The Global sheet contains the data that replaces global parameters in each iteration of the test. By default, the test runs one iteration for each row in the Global sheet of the Data Table. Using the Run tab of the Test Settings dialog box, we can also set the test to run only one iteration, or to run iterations on specified rows within the Global sheet of the Data Table. We can use the parameters defined in the Global data sheet in any action. Q. 133: What is the use of Local Data Table parameters in QTP? Local Data Table parameters take data from the actions sheet in the Data Table. The data in the actions sheet replaces the actions Data Table parameters in each iteration of the action. By default, actions run only one iteration. If we have multiple rows in a local data sheet, the corresponding action runs multiple times before running the next action in the test. Q. 134: What is the use of Environment parameters in QTP? Environment parameters are useful for localization testing, when we want to test an application where the user interface strings change, depending on the selected language. Environment parameters can be used for testing the same application on different browsers. We can also vary the input values for each language by selecting a different Data Table file each time we run the test. Q. 135: What are the types of Environment Variables in QTP? 1) User-Defined Internal Variables: These are the variables that we define within the test. These variables are saved with the test and are accessible only within the test in which they were defined. 2) User-Defined External Variables: These are the variables that we predefine in the active external environment variables file. We can create as many files as we want and select an appropriate file for each test, or change files for each test run. 3) Built-in Variables: These are the variables that represent information about the test and the computer on which the test is run, such as Test path and Operating system. These variables are accessible from all tests, and are designated as read-only. Q. 136: How do we use User-Defined External Environment Variables in QTP? We can create a list of variable-value pairs in an external file in .xml format. We can then select the file as the active external environment variable file for a test and use the variables from the file as parameters.

We can set up your environment variable files manually, or we can define the variables in the Environment tab of the Test Settings dialog box and use the Export button to create the file with the correct structure.

Q. 137: Can we create many external variable files with same names & different values? we can create several external variable files with the same variable names and different values and then run the test several times, using a different file each time. This is quite useful for localization testing. Q. 138: How to use Environment Variable Files with Quality Center? When working with Quality Center and environment variable files, we must save the environment variable file as an attachment in our Quality Center project before we specify the file in the Environment tab of the Test Settings dialog box. We can add a new or an existing environment variable file to our Quality Center project. Note that adding an existing file from the file system to a Quality Center project creates a copy of the file in Quality Center. Thus, once we save the file to the project, changes made to the Quality Center environment variable file will not affect the file system file and vice versa. Q. 139: Where do we use Built-in Environment Variables in QTP? QTP provides a set of built-in variables that enable us to use current information about the test and the QTP computer running our test. These can include the test name, the test path, the operating system type and version, and the local host name. For example, we may want to perform different checks in our test based on the operating system being used by the computer that is running the test. To do this, we could include the OSVersion built-in environment variable in an If statement. Q. 140: What are the options available for configuring Environment Variable Parameters? 1) Name option: Specifies the name of the parameter. For an internal user-defined environment variable parameter, we can create a new parameter by using the default parameter name or entering a new, descriptive name. Alternatively, we can select an existing internal user-defined environment variable parameter from the list. 2) Value option: Specifies the value of the parameter. We can enter the value for a new user-defined internal parameter, or modify the value for an existing user-defined internal parameter. External and built-in environment variable parameter values cannot be modified in this dialog box. 3) Type option: Specifies the type of environment variable parameter which are read-only: a) Internal User-Defined b) External User-Defined c) Built-in 4) Regular expression option: Sets the value of the parameter as a regular expression. This option is available only when parameterizing a checkpoint or object property text string value, and the selected environment variable parameter type is internal user-defined. Q. 141: What are the various options for configuring Random Number Parameters? 1) Numeric range: This option specifies the range from which the random number is generated. By default, the random number range is between 0 and 100. We can modify the

range by entering different values in the From and To boxes. The range must be between 0 and 2147483647 (inclusive). 2) Name: This option assigns a name to our parameter. Assigning a name to a random parameter enables us to use the same parameter several times in our test. We can select an existing named parameter or create a new named parameter by entering a new, descriptive name. 3) Generate new random number: This option defines the generation timing for a named random parameter. This box is enabled when we select the Name check box. We can select one of the following options: a) For each action iteration: This option generates a new number at the end of each action iteration. b) For each test iteration: This option generates a new number at the end of each global iteration. c) Once per entire test run: This option generates a new number the first time the parameter is used. The same number is used for the parameter throughout the test run. Q. 142: How do we use Random Number Parameters for Non-Numeric Values? Random number parameters are not suitable for non-numeric values, such as text or hypertext links. Q. 143: What is the use of Data Driver in parameterizing the tests? Data Driver help us to quickly parameterize several property values for test objects, checkpoints, and method arguments containing the same constant value within a given action. We can choose to replace all occurrences of a selected constant value with a parameter, in the same way that we can use a Find and Replace All operation instead of a step-by-step Find and Replace process. QTP can show us each occurrence of the constant so that we can decide whether or not to parameterize the value. Q. 144: Can we use Data Driver to parameterize the VBScript functions? We cannot use the Data Driver to parameterize the values of arguments for user-defined methods or VBScript functions. Q. 145: What is the use of Step-by-step parameterization option in Data Driver wizard? Step-by-step parameterization enables us to view the current values of each step containing the selected value. For each step, we can choose whether or not to parameterize the value and if so, which parameterization options we want to use. Q. 146: What is the use of Parameterize All option in Data Driver wizard? Parameterize all option enables us to parameterize all occurrences of the selected value throughout the action. We set our parameterization preferences one time and the same options are applied to all occurrences of the value. Q. 147: What is an Output Value Step in QTP? An output value step is a step in which one or more values are captured at a specific point in our test and stored for the duration of the run session. The values can later be used as input at a different point in the run session. Q. 148: What is the purpose of creating Output Value Steps in QTP When we create output value steps, we can determine where the values are stored during the run session and how they can be used. During the run session, QTP retrieves each value at the specified point and stores it in the specified location. When the value is needed later in the run session, QTP retrieves it from this location and uses it as required.

Q. 149: What are the various categories of output values in QTP? we can create following categories of output values: 1) Standard output values 2) Text and text area output values 3) Table output values 4) Database output values 5) XML output values Q. 150: What is the purpose of Standard Output Values in QTP? we can use standard output values for following: 1) To output the property values of most objects. For example, in a Web-based application, the number of links on a Web page may vary based on the selections a user makes on a form on the previous page. We can create an output value in our test to store the number of links on the page. 2) To output the contents of table cells. 3) To output text strings by specifying the text property of the object as an output value.

S-ar putea să vă placă și