Inserting Output Values in UFT

0
140
Spread the love
  • 29
  • 34
  • 28
  • 35
  •  
  •  
  •  
  • 12
  •  
  •  
    138
    Shares

Inserting Output values
Inserting Output values

It is a step in which one or more values are captured during test execution and are stored in output values. The values can be retrieved later and can be used as input at a different point in the run session or we can use as input for another test.It is stored in run time data table; it is located in QTP/UFT result window.

The values of properties of any object can be exported via output values.Output values techniques also allow us to fetch data from the below written sources:

  • Text strings
  • XML document
  • Databases
  • Table cells

Note: Output values are valid only during run session. Once the execution is over, the values get resetted.

It is always good to learn Checkpoint in UFT in order to understand the Output values better.

Where the output values get saved?

The output values can be saved the following areas:

  • Action or Component(if BPT is used).
  • The runtime datatable.
  • An environment variable.

We can define the output values and it location while configuring the output values.

How to pass parameter to action or component?

we will be able to pass parameters to an action or component parameter. This is helpful to supply values later during the run session. The values can also be passed to external application during script execution which will call the test or component.

It is mainly dependent on two parameters:

  • Type- Shows the type of parameter like- String
  • Description- Shows the description defined for the parameter.

How to pass output data/ parameters to Data table?

We will be able to pass the data and store the output values in datatable. In the datatable we can store inside the followings:

  • Global sheet
  • Action sheet
  • All different actions in the current test.

The following options are important while we place output values to data table:

  • Name- The column name in which the value will be saved.
  • Location- In which sheet the data will be stored?(like -global or action sheet)

How to pass output values to an environment variable?

We will be able to store the output values to an Environment variable. We can select the Environment as the output type in the output options dialog box(dropdown). The Environment variable will be off user-defined Environment variable. In that Environment variable we can store the output value.

The two important aspect of Environment variables are :

  • Name- Name of the user defined environment variable in which we will store the output value.
  • Type- It is read only and cannot be edited or altered. The value will be User defined-Internal.

The out of the box UFT addins and their support for output values

Output Value Web Windows VB ActiveX
Standard Y Y Y Y
Page(Standard) Y NA NA NA
Table(Standard) Y NA NA Y
Text Y(Page frame and view link) Y Y Y
TextArea NA Y Y Y
Database Y Y Y Y
XML from Application Y NA NA NA
XML from resource Y Y Y Y

Y stands for supported and NA stands for not applicable/not supported

Types of Output Values:

  1. Standard output value
  2. Text output value
  3. Text area output value
  4. Database output value
  5. XML output value (From Application)
  6. XML output value (From Resource)
Standard output value:

We can use standard output values to output the properties values of most objects. Like- number of links present on a web page.We can also create standard output values to output text string by providing the text property of the object as an output value.

Navigation for Creating Standard output values:
  • Open a new test
  • Keep tool under Recording mode
  • Click on Insert menu >output value> standard output value [at this point UFT will be minimized and a hand symbol will come]
  • show the object > click ok [It will open the Object selection-output value properties window]
  • The output values properties window will open.
  • select property in order to read the property
  • Modify the column name (if required) > click ok [This will open Output options window]
  • Select the output type in list box.
  • Enter the column name where you want to store the value.Like Datatable
  • click ok
  • Stop recording.

The code will look like:

Window("WindowName").WinButton("ButtonName").Output CheckPoint("PropertyName")
Text output value

We can use Text output values to output text strings displayed in an application, web page,screen. When creating a text output value we can output a part of the objects text and we can also specify text before and text after options.

Navigation to create Text output value:

  • Start a new test
  • Keep tool under recording mode
  • Insert menu> output value > text output value[UFT will be minimized and a hand symbol will appear on the screen]
  • Select the object. It will open the Object selection-output value properties window.
  • Click  on ok. It will open the Output values properties window.
  • show the text
  • select one of the option(output text/text before/text after)
  • Click modify if you want to change the column name. It will open Output Options window.
  • select one of the option(output text/text before/text after)
  • Select output type in the list box like datatable or environment variable. Incase we select the datatable we need to provide column name to store the value in the runtime.Similarly if we select the environment variable we need to specify the Environment variable name.
  • > click ok > click ok.> check in runtime table after running it.

The code will look like:

Window("WindowName").WinButton("ButtonName").Output CheckPoint("PropertyName")

Text Area output value:

We can use text area output values to output text strings displayed within a defined area of the screen. Apart from these Text Area output value can fetch text present in the bitmap or strings from an object.

Navigation for inserting TextArea Output values:
  • Open a new Test.
  • Keep tool under recording mode
  • Insert menu >output value > text area output value[UFT will be minimized and a hand symbol will appear on the screen]
  • Mark the text area
  • Select the object. It will open the Object selection-output value properties window.
  • Click on OK. It will open Output Values Properties window.
  • Click modify the column name if necessary. Options window opens.
  • Select Datatable if you want to store data in the datatable. In that case specify the column name and sheet name. If you are selecting environment variable provide the environment variable name
  • > click ok > again click ok > check in run time table after running it.

The code will look like:

Window("WindowName").WinButton("ButtonName").Output CheckPoint("PropertyName")
Database output value:

We can use Database output values to output the value of the contents of database cells. The data is dependent on the query(a result set) to the database. The output value can be created from the entire content of the result set or some parts of it.

Navigation to insert Database output value:
  • Open a new Test
  • Insert menu-> output value-> Database output value
  • choose specify SQL statements manually ->click next ->click create
  • Select Machine Data source -> Select Driver (Or DNS)
  • Enter SQL statement or query
  • Click on Finish
  • Select data cells to fetch data
  • Click on Modify if you need to change
  • Specify the parameters name
  • click ok > Run and it will capture and see the results in run time table.
XML output value (from application):

we can use XML output values to output the values of XML elements (attributes, variables, elements) in XML documents.

Navigation XML output value (from application):
  • Open a new Test
  • Keep tool under recording mode with web environment
  • Insert menu > output value > XML output value from application
  • Show the XML document > select elements > click ok >stop recording.
XML output Value (From Resource):

We can use XML output values to output the values of XML elements (attributes, variables, elements) in XML documents.

Navigation XML output Value (From Resource):
  • Start a new Test
  • Insert menu >output value> XML output value from resource
  • Browse path of the XML file
  • Select the variable attributes
  • Click on Modify to change the column name
  • click ok

This article also provides answer for the following questions:

  • What are the output parameter types in output values?
  • What are the difference between Text output values and Text Area Output values?
  • Where do we store output values?
  • Why we will use Output values?
Don't miss out!
Subscribe To Newsletter

Receive top technical news, lesson ideas, travel tips and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

Spread the love
  • 29
  • 34
  • 28
  • 35
  •  
  •  
  •  
  • 12
  •  
  •  
    138
    Shares

LEAVE A REPLY

Please enter your comment!
Please enter your name here