Micro Focus QTP (UFT) Forums

Full Version: input / ouput parameters
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi folks!

A quick question as parameters are confusing me.

I have a test that creates a file that I need to upload into the system I am working on. The file creation works and is no problem.

The basic outline of the test is as follows:
2 actions
Action 1 create file
Action 2 process file


Action 1
1. Create the file
2. set a variable with the name of the file

Action 2
1. get the name of the file (from action 1) and process this


So I need to somehow pass this name from the first action to the second action.

How do I do this? I did try using the following:

Going to the action properties of action 1 and setting an output parameter

name : filename - type string

And then going to the action 2 properties and setting the input parameter

name infile - type string


How do I accomplish this task do I need datatable for this or can it be done with variables?


Hi Jove,

Save the file name in DataTable by using DataTable.GlobalSheet.AddParameter and then fetch it form Action 2.
Hi manish,

Sorry for the slow response I did manage to get the datatable populated with my value like you said.

Thanks!

Hi jove1776,

You can use any one of the following to complete your task Smile
1. Environment Variables
2. Output values
3. Action Parameters
4. Dictionary Objects

Example:
Action1:
Code:
Filename_created="sample file which got created"
Environment("FileName")=Filename_created

Action2:
'Retrieve the name of the file using the above environment variable as shown below.

Code:
FileTobeProcessed=Environment("FileName")
' write the code for processing the file