Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help with passing value to second action
#1
Solved: 11 Years, 4 Months ago
Have an issue in passing a value from one action to the next.

I looked at this all morning but couldnt see what I was doing wrong especially since it working yesterday.

OK a summary of the 2 actions

Action 1 Properties
------------------
output parameters = pOrderNr

Action 1 Call Properties
----------------------
output parameters = pOrderNr


Action2 Properties
-----------------
input parameters = pOrderNr

Action2 Call Properties
---------------------
Input parameters = pOrderNr
value = parameter - test / action parameter, output from previous action: action 1 , parameter = pOrderNr

Action 1 code:
Code:
Parameter("pOrderNr") = edbOrderNr

Action2 code:
Code:
Dim order
order = parameter("pOrderNr")
msgbox (order)


Anyone see my mistake?

As when the script runs i do not get the parameter passed to action 2 and displayed in message box. It worked yesterday ! Maybe i changed something by accident.
Reply
#2
Solved: 11 Years, 4 Months ago
You can create a Function Library from File menu and declear your variable there as:
Public varname

save the library and rerun the test....

Hope it will be useful..

Regards
Shrikant
Reply
#3
Solved: 11 Years, 4 Months ago
Sorry Shrikantsr but I dont think that would solve my issue here as it should work with out that.

Is a very strange thing, i think qtp has some issues bugs?

I set up a new test with the following:

action1 code:
Code:
Dim outmessage

outmessage = "this is out message"

Parameter("pOutMessage") = outmessage

Action2 code"
Code:
Dim inmessage

inmessage = parameter("pInMessage")
msgbox(inmessage)

action1 out param = pOutMessage
action 2 in param = pInMessage

action 2 call properties in param = pInMessage and points to the out param of action 1

the message is passed fine!!!!

I did the same with my main test the action 1 variable gets the message but somehow the parameter is just not being passed, is driving me crazy...

does qtp have some sort of cache that can be cleared?

ONE LAST THING.

I have divided my tests the following way. I have one test called Scripts and another test called RegressionTests which call that scripts. In the Scripts test everything in the Action Call Properties seems to be correct, but in the RegressionTest script when i look at the Action Call properties I see there is no option to use parameter from a previous test.
Reply
#4
Solved: 11 Years, 4 Months ago
I think i found the issue, I was trying to pass the parameter to an action that is on a different testcase hierarchy within the same test. i.e TC0001, contains a number of calls to actions, TC0002 contains a few call to existing actions. Seems that I cannot pass the out parameter from an action in the TC1 set of actions to an action in the TC2 set of actions.

Is working now - but i had add duplicate some actions from TC1 in TC2 which is not very good in my opinion.
Reply
#5
Solved: 11 Years, 4 Months ago
Hi,
Please follow the steps then you can success.

1. Action1 parameters = select Output paramater as 'opvariable' and the type should select as 'Any'.
2. Action2 parameters = select Input parameter as 'opvariable' and the type as 'Any'.
3. parameterise the statement in Action2 as 'order = parameter("opvariable")'.
msgbox order
4. Pass the 'opvariable' in the RunAction statement which we specified at end of Action1 and run the test.

Now you can see the order number which you captured in 'Action1' and passing it to 'Action2'.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Part of parameters missing when passing between actions skumar007 1 3,006 10-10-2014, 02:00 AM
Last Post: skumar007
  Action Parameter passing problem Qtpuser1 1 2,843 04-18-2014, 06:23 AM
Last Post: kgovadav
  Getting run error passing a Frame into a user defined function!!! sepgs2004 1 2,834 10-14-2013, 06:37 PM
Last Post: anil2u
  how to call reusable actions by passing parameters.? Arun091 0 3,881 08-16-2012, 07:28 PM
Last Post: Arun091
  Passing array of classes to parameter of action nvKy 1 3,998 06-20-2012, 10:38 AM
Last Post: sshukla12

Forum Jump:


Users browsing this thread: 2 Guest(s)