Pages

Custom Search

HP QTP Question Database: Q. 151 to 160

HP QTP Question Database: Q. 151 to 160

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.

No comments: