Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is it possible to get in VB script values from an executed QTP test?
#1
Not Solved
The name of the Output parameter is correctly defined “log_run”. It's defined in QTP "Test Settings" and in "Action Properties". From VBS script side I wrote the following lines (the complete code is in attach):
qtApp.Open path_test & tc, True, False ' Open a test in a read-only mode
Set qtTest = qtApp.Test
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Set coll = qtTest.ParameterDefinitions ' Retrieve the parameters collection defined for the test.
Set params = coll.GetParameters() ' Retrieve the Parameters collection defined for the test.
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Set p1 = params.Item("path_test") ' Retrieve a specific parameter.
Set p2 = params.Item("log_run") ' Retrieve a specific parameter.
p1.Value = Left(path_test, 1) & ":\IT_Automation"
qtApp.Test.Run qtResultsOpt, True, params ' Run the test
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
out1 = p2.Value
MsgBox out1
Set params2 = coll.GetParameters()
out1 = params2.Item("log_run").Value
MsgBox out1
out1 = params2.Item(1).Value
MsgBox out1

From QTP test (Expert View) side, I used the following statements:
path1 = Parameter("path_test") ' To get the value of the input parameter loaded in VBS script.
Parameter("log_run") = log1 ' To transfer to the VBS script, via QTP Output parameter "log_run", one test value already occourred.

But, in QTP test (Action1) the value of path1 is an empty string and in VBS script all the values of the string "out1" are also empty strings.
Is it possible to exchange data values between VBS script and QTP?


.zip   qtp_run2.zip (Size: 1,022 bytes / Downloads: 63)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to catch the script execution when QTP scripts are executed from command line Sreeni.lutukurthy 0 2,943 03-19-2015, 05:55 PM
Last Post: Sreeni.lutukurthy
Sad Batch Test Script Help nidhitaneja 0 2,590 02-09-2014, 10:34 PM
Last Post: nidhitaneja
  Function written in Func library is not returning values but works in same script Shwethareddy 5 4,677 02-25-2013, 10:55 AM
Last Post: vinod123
  Script running more times than the values in global data table TPavani 5 4,380 10-04-2012, 11:18 PM
Last Post: krr
  how to add test to test set using vb script ? dasappa 4 17,189 08-15-2012, 09:59 PM
Last Post: sunnystrikes

Forum Jump:


Users browsing this thread: 1 Guest(s)