if you are using QTP AOM then you can easily do this
see if the code below gives you an idea
missed to assign ouput parameter to the input parameter for second run in the code
try this -
see if the code below gives you an idea
Code:
Set qtApp = CreateObject("QuickTest.Application")
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions")
qtApp.Launch
qtApp.Visible = True
qtResultsOpt.ResultsLocation = "D:\results"
qtApp.Open "C:\QTP\Script\Script1"
' parameters collection defined
Set pDefColl = qtApp.Test.ParameterDefinitions
Set oParams = pDefColl.GetParameters()
'added parameters Run the script
qtApp.Test.Run qtResultsOpt, True, oParams
'Extract the output Parameter
Set oParam = oParams.Item("OutputVal")
qtApp.Test.Close
qtApp.Open "C:\QTP\Script\Script2"
Set pDefColl = qtApp.Test.ParameterDefinitions
Set iParams = pDefColl.GetParameters()
Set iParam = iParams.Item("InputVal")
'add input parameter taken from earlier test
qtApp.Test.Run qtResultsOpt, True, iParam
missed to assign ouput parameter to the input parameter for second run in the code
try this -
Code:
Set qtApp = CreateObject("QuickTest.Application")
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions")
qtApp.Launch
qtApp.Visible = True
qtResultsOpt.ResultsLocation = "D:\results"
qtApp.Open "C:\QTP\Script\Script1"
' parameters collection defined
Set pDefColl = qtApp.Test.ParameterDefinitions
Set oParams = pDefColl.GetParameters()
'added parameters Run the script
qtApp.Test.Run qtResultsOpt, True, oParams
'Extract the output Parameter
Set oParam = oParams.Item("OutputVal")
qtApp.Test.Close
qtApp.Open "C:\QTP\Script\Script2"
Set pDefColl = qtApp.Test.ParameterDefinitions
Set iParams = pDefColl.GetParameters()
Set iParam = iParams.Item("InputVal")
iParam.Value = oParam.Value
'add input parameter taken from earlier test
qtApp.Test.Run qtResultsOpt, True, iParam