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 action’s sheet in the Data Table. The data in the action’s sheet replaces the action’s 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.
Q. 151: What is the purpose of Text and Text Area Output Values in QTP?
We can use text output values to output text strings displayed in an application. When creating a text output value, we can output a part of the object’s text. We can also specify the text before and after the output text.
We can use text area output values to output text strings displayed within a defined area of a screen in a Windows-based application.
<<<<<< =================== >>>>>>
Q. 152: What is the purpose of Table Output Values in QTP?
Table output values are a subset of standard output values, described above. We can use table output values to output the contents of table cells. For some types of tables, we can specify a row range from which to choose the table cells. During the run session, QTP retrieves the current data from the specified table cells according to the settings that we specified and outputs the values to the Data Table.
<<<<<< =================== >>>>>>
Q. 153: What is the purpose of Database Output Values in QTP?
We can use database output values to output the value of the contents of database cells, based on the results of a query that we define on a database. We can create output values from the entire contents of the result set, or from a part of it. During the run session, QTP retrieves the current data from the database and outputs the values according to the settings that we specified.
<<<<<< =================== >>>>>>
Q. 154: What is the purpose of XML Output Values in QTP?
We can use XML output values to output the values of XML elements and attributes in XML documents.
For example, suppose that an XML document in a Web page contains a price list for new cars. We can output the price of a particular car by selecting the appropriate XML element value to output.
<<<<<< =================== >>>>>>
Q. 155: How the output values are stored during the run sessions?
When we define an output value, we can specify where and how each value is stored during the run session. We can output a value to:
1) A test or action parameter
2) The run-time Data Table
3) An environment variable
Output values are stored only for the duration of the test, and are not saved with the test.
<<<<<< =================== >>>>>>
Q. 156: How do we store output values in Test and Action Parameters?
We can output a value to an action parameter, so that values from one part of a run session can be used later in the run session, or be passed back to the application that ran the test.
For example, suppose we are testing a shopping application that calculates our purchases and automatically debits our account with the amount that we purchased. We want to test that the application correctly debits the purchase amount from the account each time that the action is run with a different list of items to purchase. We could output the total amount spent to an action parameter value, and then use that value later in our run session in the action that debits the account.
<<<<<< =================== >>>>>>
Q. 157: How do we store output values in Run-time Data Table?
The option to output a value to the run-time Data Table is especially useful with a data-driven test that runs several times. In each repetition, or iteration, QTP retrieves the current value and stores it in the appropriate row in the run-time Data Table.
<<<<<< =================== >>>>>>
Q. 158: How do we store output values in Environment Variable?
When we output a value to an internal user-defined environment variable, we can use the environment variable input parameter at a later stage in the run session.
We can output values only to internal user-defined environment variables and not to external or built-in environment variables, which are read-only.
For example, suppose we are testing an application that prompts the user to input an account number on a Welcome page and then displays the user’s name. We can use a text output value to capture the value of the displayed name and store it in an environment variable.
<<<<<< =================== >>>>>>
Q. 159: In what situations we output a value for a step in a test action?
1) If at least one output parameter is defined in the action, the default output type is Test/action parameter and the default output name is the first output parameter displayed in the Action Properties dialog box.
2) If no output parameters are defined in the action, the default output type is Data Table and QTP creates a new Data Table output name based on the selected value.
<<<<<< =================== >>>>>>
Q. 160: What are the options available when outputting a value to the Data Table?
1) Name: Specifies the name of the column in the Data Table in which to store the value. QTP suggests a default name for the output. We can select an existing output name from the list, or create a new output name by using the default output name or entering a valid descriptive name.
We can define a new name containing letters, numbers, periods, and underscores. The first character of the output name must be a letter or an underscore. The output name must be unique in the Data Table sheet.
2) Location in Data Table: When outputting values for a test, specifies whether to add the Data Table column name in the global or current action sheet in the Data Table.
Q. 161: What is a Regular Expression?
A regular expression is a string that specifies a complex search phrase. By using special characters, such as a period (.), asterisk (*), caret (^), and brackets ([ ]), we can define the conditions of a search.
<<<<<< =================== >>>>>>
Q. 162: What is the use of Regular expressions in QTP?
Regular expressions enable QTP to identify objects and text strings with varying values. We can use regular expressions in situations like:
1) Defining the property values of an object in dialog boxes or in programmatic descriptions
2) Parameterizing a step
3) Creating checkpoints with varying values
For example, we can use a regular expression if we want to create a text checkpoint on a date text string, but the displayed date changes according to the current date. If we define the date as a regular expression, the checkpoint checks that the captured text string matches the expected date format, rather than checking the exact date value.
<<<<<< =================== >>>>>>
Q. 163: How do we use Regular Expressions in Checkpoints?
When creating a standard checkpoint to verify the property values of an object, we can set the expected value of an object’s property as a regular expression so that an object with a varying value can be verified.
For example, suppose we want to check that every window and dialog box in our application contains the name of our application followed by a hyphen (-) and a descriptive title. We can add a checkpoint to each dialog box object in our test to check that the first part of the title contains the name of our application followed by a hyphen.
<<<<<< =================== >>>>>>
Q. 164: What are the values for which we can define the regular expression?
We can define a regular expression for a constant value, a Data Table parameter value, an Environment parameter value, or a property value in a programmatic description.
<<<<<< =================== >>>>>>
Q. 165: What is the purpose of including Programming Statements in Tests?
We add steps which contain programming logic to the recorded framework just to increase the power and flexibility of the testing process.
<<<<<< =================== >>>>>>
Q. 166: What are the contents of the Programming Statements used in tests?
Programming statements usually contain:
1) Recordable test object methods: These are operations that a user can perform on an application.
2) Non-recordable test object methods: These are operations that users cannot perform on an application. We use these methods to retrieve or set information, or to perform operations triggered by an event.
3) Run-time methods of the object being tested.
4) Various VBScript programming commands that affect the way the test runs, such as conditions and loops. These are often used to control the logical flow of a test.
5) Supplemental statements, such as comments, to make our test easier to read, and messages that appear in the test results, to alert us to a specified condition.
<<<<<< =================== >>>>>>
Q. 167: How can we increase the Readibility of our Tests?
We can improve the readability of our test using With statements. We can instruct QTP to automatically generate With statements as we record. But even after our basic test is recorded, we can convert its statements, in the Expert View, to With statements—by selecting a menu command.
<<<<<< =================== >>>>>>
Q. 168: What is the use of Transaction Statement?
With the help of transaction statements we can measure the time i.e how long it takes certain parts of our test to run.
<<<<<< =================== >>>>>>
Q. 169: What steps can be defined in Step Generator?
1) Test object methods and properties
2) Utility object methods and properties
3) Calls to library functions, VBScript functions, and internal script functions
<<<<<< =================== >>>>>>
Q. 170: How can we incorporate decision-making into the tests?
We can control the flow of our test with conditional statements. Using conditional If...Then...Else statements, we can incorporate decision-making into our tests.
The If...Then...Else statement is used to evaluate whether a condition is true or false and, depending on the result, to specify one or more statements to run. Usually the condition is an expression that uses a comparison operator to compare one value or variable with another.
Q. 171: How can we do the nesting of If...Then...Else statement?
The If...Then...Else statement can be nested to as many levels as you need. It has the following syntax:
If condition Then statements [Else elsestatements] End If
Or, we can use the block form syntax:
If condition Then
[statements]
[ElseIf condition-n Then
[elseifstatements] . . .
[Else
[elsestatements]
End If
<<<<<< =================== >>>>>>
Q. 172: What is the use of Looping Statements?
We can control the flow of our test with loop statements. Using loop statements, we can run a group of steps repeatedly, either while or until a condition is True. We can also use loop statements to repeat a group of steps a specific number of times.
<<<<<< =================== >>>>>>
Q. 173: What type of Loop Statements are available in Keyword View?
1) While...Wend. Performs a series of statements as long as a specified condition is True.
2) For...Next. Uses a counter to perform a group of statements a specified number of times.
3) Do...While. Performs a series of statements indefinitely, as long as a specified condition is True.
4) Do...Until. Performs a series of statements indefinitely, until a specified condition becomes True.
<<<<<< =================== >>>>>>
Q. 174: What is the purpose of having comments in the tests?
A comment is an explanatory remark in a program. When we run a test, QTP does not process comments. We can use comments to explain sections of our tests to improve readability and to make them easier to update.
While editing our test, we can directly add comments in the Keyword View or in the Expert View. We can also add comments to function libraries. We can modify comments at any time directly in the Keyword View or the Expert View, or using the Comment Properties dialog box.
<<<<<< =================== >>>>>>
Q. 175: How can we add the same comment to every action that we create?
We can add the same comment to every action that we create, by adding the comment to an action template.
<<<<<< =================== >>>>>>
Q. 176: What is Synchronization of Tests in QTP?
Synchronization activity in the test ensures that QTP waits until our application is ready before performing a certain step. This is helpful in handling anticipated timing problems like:
When we run a test, our application may not always respond with the same speed. For example, it might take a few seconds:
1) For a progress bar to reach 100%
2) For a status message to appear
3) For a button to become enabled
4) For a window or pop-up message to open
<<<<<< =================== >>>>>>
Q. 177: What is a Synchronization Point in QTP?
A synchronization point, instructs QTP to pause the test until an object property achieves the value we specify. When we insert a synchronization point into our test, QTP generates a WaitProperty statement in the Expert View.
<<<<<< =================== >>>>>>
Q. 178: What are the ways by which we can make QTP to wait?
1) By inserting a synchronization point.
2) By inserting Exist or Wait statements that instruct QTP to wait until an object exists or to wait a specified amount of time before continuing the test.
3) By modifying the default amount of time that QTP waits for a Web page to load.
4) By increasing the default timeout settings for a test to instruct QTP to allow more time for objects to appear.
<<<<<< =================== >>>>>>
Q. 179: What is the purpose of creating Synchronization Points in QTP?
If we do not want QTP to perform a step or checkpoint until an object in our application achieves a certain status, we should insert a synchronization point to instruct QTP to pause the test until the object property achieves the value we specify or until a specified timeout is exceeded.
For example, suppose we record a test on a flight reservation application. We insert an order, and then we want to modify the order. When we click the Insert Order button, a progress bar is displayed and all other buttons are disabled until the progress bar reaches 100%. Once the progress bar reaches 100%, we record a click on the Update Order button.
<<<<<< =================== >>>>>>
Q. 180: What happens if we don't use Synchronization Point in QTP?
Without a synchronization point, QTP may try to click the Update Order button too soon during a test run - if the progress bar takes longer than the test’s object synchronization timeout, and the test will fail.
Q. 181: What is the purpose of Expert View in QTP?
In QTP, tests are composed of statements coded in the Microsoft VBScript programming language. The Expert View provides an alternative to the Keyword View for testers who are familiar with VBScript.
In the Expert View, we can view an action in VBScript. If we are familiar with VBScript, we can add and update statements and enhance our tests and function libraries with programming. This enables us to increase a test’s power and flexibility.
<<<<<< =================== >>>>>>
Q. 182: What is the main difference between Keyword View & The Expert View in QTP?
1) In the Keyword View, QTP displays information about each step and shows the object hierarchy in an icon-based table.
2) In the Expert View, QTP displays each step as a VBScript line or statement. In object-based steps, the VBScript statement defines the object hierarchy. In the Expert View, an object’s description is displayed in parentheses following the object type.
<<<<<< =================== >>>>>>
Q. 183: How can we insert a checkpoint or output value statement in Expert View Manually?
Because the statement displayed in the Expert View is a reference to the stored information, hence we cannot insert a checkpoint or output value statement in the Expert View manually and we cannot copy a Checkpoint or Output statement from the Expert View to another test.
<<<<<< =================== >>>>>>
Q. 184: What are the various ways of generating Statements in Expert View?
We can generate statements in the following ways:
1) We can use the Step Generator to add steps that use methods and functions.
2) We can manually insert VBScript statements that use methods to perform operations.
3) When we start to type a VBScript keyword in the Expert View or a function library, QTP automatically adds the relevant syntax or blocks to our script, if the Auto-expand VBScript syntax option is enabled.
<<<<<< =================== >>>>>>
Q. 185: What is IntelliSense in QTP?
IntelliSense is a statement completion feature of QTP which helps us in selecting the test object, method, property, or collection for our statement and to view the relevant syntax as we type in the Expert View or a function library.
<<<<<< =================== >>>>>>
Q. 186: What is the purpose of Auto-expand VBScript syntax option in QTP?
Auto-expand VBScript syntax is an option avaailable in QTP. When this option is enabled and we start to type a VBScript keyword in the Expert View or a function library, QTP automatically recognizes the first two characters of the keyword and adds the relevant VBScript syntax or blocks to the script. For example, if we enter the letters if and then enter a space at the beginning of a line, QTP automatically enters:
If Then
End If
The Auto-expand VBScript syntax option is enabled by default.
<<<<<< =================== >>>>>>
Q. 187: What is the purpose of bookmarks in our Test Actions?
We can use bookmarks to mark important sections in our action or function library so that we can navigate between the various parts more easily. In tests, bookmarks apply only within a specific action; they are not preserved when we navigate between actions and they are not saved with the test or function library.
<<<<<< =================== >>>>>>
Q. 188: What is the meaning of error message "Expected end of statement" while running a test?
When we receive an "Expected end of statement" error message while running a step in our test or function library, it may indicate that we need to add parentheses around the arguments of the step's method.
<<<<<< =================== >>>>>>
Q. 189: What are the types of Programmatic Descriptions?
1) Static Programmatic Description: Here we list the set of properties and values that describe the object directly in a VBScript statement. Using the Static type to enter programmatic descriptions directly into our statements may be easier for basic object description needs.
2) Dynamic Programmatic Description: Here we add a collection of properties and values to a Description object, and then enter the Description object name in the statement. In most cases, using the Dynamic type provides more power, efficiency, and flexibility.
<<<<<< =================== >>>>>>
Q. 190: How can we retrieve all objects located inside a Parent Object?
We use the ChildObjects method to retrieve all objects located inside a specified parent object, or only those child objects that fit a certain programmatic description.
To retrieve this subset of child objects, we first create a description object and add the set of properties and values that we want our child object collection to match using the Description object.
Q. 191: What is the advantage of using Index Property in Programmatic Descriptions?
The index property is quite useful test object property for uniquely identifying an object. The index test object property identifies an object based on the order in which it appears within the source code, where the first occurrence is 0.
Index property values are object-specific.
<<<<<< =================== >>>>>>
Q. 192: How can we run standard DOS commands in QTP tests?
We can run standard DOS commands in our QTP test or function using the VBScript Windows Scripting Host Shell object (WSCript.shell). For example, we can open a DOS command window, change the path to C:\, and run the DIR command using the following statements:
Dim oShell
Set oShell = CreateObject ("WSCript.shell")
oShell.run "cmd /K CD C:\ & Dir"
Set oShell = Nothing
<<<<<< =================== >>>>>>
Q. 193: What is the advantage of having User-Defined Functions?
If we have segments of code that we need to use several times in our tests, we create a user-defined function.
A user-defined function encapsulates an activity (or a group of steps that require programming) into a keyword. By using user-defined functions, our tests become shorter, and easier to design, read, and maintain. We can then call user-defined functions from an action by inserting the relevant keywords into that action.
<<<<<< =================== >>>>>>
Q. 194: What is a Function Library?
A function library is a Visual Basic script containing VBscript functions, subroutines, modules, and so forth.
We can use QTP to modify and debug any existing function libraries (such as .vbs or .txt files).
Using QTP, we can define and store our user-defined functions in a function library (saved as a .qfl file, by default)
<<<<<< =================== >>>>>>
Q. 195: What are the modes available to open a function library?
We can open a function library, only if you have read or read-write permissions for the file. We can open a function library in following two modes:
1) Edit Mode: Enables us to view and modify the function library. While the function library is open on our computer, other users can view the file in read-only mode, but they cannot modify it.
2) Read-only mode: Enables us to view the function library but not modify it. By default, when we open a function library that is currently open on another computer, it opens in read-only mode.
We can also open a function library in read-only mode if we want to review it, but we do not want to prevent another user from modifying it.
<<<<<< =================== >>>>>>
Q. 196: How can we debug a Function Library?
Before we can debug a function library, we must first associate it with a test and then insert a call to at least one of its functions. For example, we can use the Debug Viewer to view, set, or modify the current value of objects or variables in our function library.
We can step into all the functions, set breakpoints, stop at breakpoints, view expressions, and so forth.
We can begin debugging from a specific step, or we can instruct QTP to pause at a specific step.
<<<<<< =================== >>>>>>
Q. 197: What is Function Definition Generator?
Function Definition Generator is a feature of QTP, which enables us to generate definitions for new user-defined functions and add header information to them.
We can then register these functions to a test object, if needed. We fill in the required information and the Function Definition Generator creates the basic function definition for us. After we define the function definition, we can insert the definition in our function library and associate it with our test, or we can insert the definition directly in a test script in the Expert View. Finally, we complete the function by adding its content i.e. code.
<<<<<< =================== >>>>>>
Q. 198: What methodology QTP follows while running the tests?
If our test contains a global Data Table parameter, QTP runs the test once for each row in the Data Table.
If our test contains a Data Table parameter for the current action data sheet, QTP runs the action once for each row of data in that action data sheet.
We can also specify whether to run the first iteration or all iterations, for the entire test or for a specific action in the test; or to run the iterations for a specified range of data sets.
We can run the entire test from the beginning, or we can run part of it. We can designate certain steps as optional, to enable QTP to bypass them instead of aborting the run if these steps do not succeed.
<<<<<< =================== >>>>>>
Q. 199: How can we do part running of the test?
We can use the Run from Step option to run a selected part of our test.
This enables us to check a specific section of our application or to confirm that a certain part of our test runs smoothly.
With this option the test is run from the Expert View & test is made to run from the selected step until the end of the action. Using Run from Step in this mode ignores any iterations.
<<<<<< =================== >>>>>>
Q. 200: What are Optional Steps in testing?
An optional step is a step which is not required to successfully complete a run session.
For example, suppose that when recording a test, the application we are testing prompts us to enter a user name and password in a login window. When we run the test, however, the application does not prompt us to enter our user name and password because it retained the information that was previously entered. In this case, the steps that were recorded for entering the login information are not required and should, therefore, be marked optional.
Q. 201: Which QTP feature allows you select the appropriate add-ins to load with your test.
Add-in Manager
<<<<<< =================== >>>>>>
Q. 202: Name the six columns of the Keyword view.
Item, Operation, Value, Documentation, Assignment, Comment
<<<<<< =================== >>>>>>
Q. 203: List the steps to change the logical name of an object named "ThreedPanel" into "StatusBar" in the Object Repository.
Select Tools > Object Repository. In the Action1 object repository list of objects, select an object, right click and select Rename from the pop-up menu.
<<<<<< =================== >>>>>>
Q. 204: Name the two run modes available in QTP Professional.
Normal and Fast
<<<<<< =================== >>>>>>
Q. 205: When QTP Professional is connected to Quality Center, all automated assets (e.g. tests, values) are stored in Quality Center. (True or False)
True
<<<<<< =================== >>>>>>
Q. 206: What information do you need when you select the Record and Run Setting - Record and run on these applications (opened when a session begins)?
Application details (name, location, any program arguments)
<<<<<< =================== >>>>>>
Q. 207: Name and discuss the three elements that make up a recorded step.
1) Item - the object recorded,
2) Operation - the action performed on the object,
3) Value - the value selected, typed or set for the recorded object
<<<<<< =================== >>>>>>
Q. 208: There are two locations to store run results. What are these two locations and discuss each.
New run results folder - permanently stores a copy of the run results in a separate location under the automated test folder
Temporary run results folder - Run results can be overwritten every time the test is played back
<<<<<< =================== >>>>>>
Q. 209: The object class QTP uses to identify an object is a property of the object. (True or False)
False
<<<<<< =================== >>>>>>
Q. 210: You can modify the list of pre-selected properties that QTP uses to identify an object. (True or False)
True
Q. 211: A synchronization step instructs QTP to wait for a state of a property of an object before proceeding to the next recorded step. Synchronization steps are activated only during recording. (True or False)
True
<<<<<< =================== >>>>>>
Q. 212: Manually verifying that an order number was generated by an application and displayed on the GUI is automated in QTP using what feature?
A Checkpoint
<<<<<< =================== >>>>>>
Q. 213: QTP can automate verification which are not visible on the application under test interface. (True or False)
True
<<<<<< =================== >>>>>>
Q. 214: What is the Checkpoint Timeout Value?
A checkpoint timeout value specifies the time interval (in seconds) during which QTP attempts to perform the checkpoint successfully. 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.
<<<<<< =================== >>>>>>
Q. 215: You can modify the name of a checkpoint for better readability. (True or False)
False
<<<<<< =================== >>>>>>
Q. 216: Define a regular expression for the following range of values:
a. Verify that the values begin with Afx3 followed by 3 random digits Afx3459, Afx3712, Afx3165
b. Verify that a five-digit value is included in the string Status code 78923 approved
a. Afx3\d{3}
b. Status code \d{5} approved
<<<<<< =================== >>>>>>
Q. 217: Write the letter of the type of parameter that best corresponds to the requirement:
a. An order number has to be retrieved from the window and saved into a file for each test run.
b. A value between 12 to 22 is entered in no particular order for every test run.
c. Every iteration of the test should select a new city from a list item
A. Environment parameter
B. Input parameter
C. Component parameter
D. Output parameter
E. Random parameter
D, E, B
<<<<<< =================== >>>>>>
Q. 218: This is the Data Table that contains values retrieved from the application under test. You can view the captured values after the test run, from the Test Results. What do you call this data table?
Run-Time Data table
<<<<<< =================== >>>>>>
Q. 219: Name and describe each of the four types of trigger events
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.
<<<<<< =================== >>>>>>
Q. 220: Explain initial and end conditions.
Initial and end conditions refer to starting and end points of a test that allows the test to iterate from the same location, and with the same set up every time (e.g. all fields are blank, the test starts at the main menu page).
No comments:
Post a Comment