Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to call action with few parameters

Status
Not open for further replies.

kocyk

Technical User
Jan 22, 2008
2
BE
i know that i can do this way:
RunAction "STAGE_2", oneIteration,"value_of_param2", "value_of_param2", "value_of_param3"

but what if I want to change only value of param3?
i run it this way
RunAction "STAGE_2", oneIteration,,, "value_of_param3"
-
i just left 2 spaces free, but hope there is some other way like:
RunAction "STAGE_2", oneIteration, param3="value_of_param3"

was searching but couldn't finsd anything, maybe someone can help me...
 
Not sure if it'll work at all - no QTP to test it on here.

But if it works any way, I'd expect it to read as

param3:= "value_of_param3"

Cheers,
Dave

"Yes, I'll stop finding bugs in the software - as soon as you stop writing bugs into the software." <-- Me

For all your testing needs: Forum1393
 
thanks, but it does not work:)
maybe it is just not possible?:)
 
Can you wrap the whole thing into a string and execute the string (can do it in WinRunner - which I do have) can't remember if you can do this in QTP or not, but essentially..
WR Code - syntax probably not the same in QTP...

ExeString = "RunAction \"STAGE_2\", oneIteration,\"param1\", \"param2\", \"" & value_param_3 & \"

then:

eval(ExeString);

causes ExeString to be evaluated as a program command. As we've written the function call, and effectively hard coded Param1 and Param2, only Param3 is picked up and added in separately..

Like I say though, this is a WR solution (that's also why the \ are present, to demonstrate literal chars in the string), but there'll likely be an equivalent in QTP.

Cheers,
Dave

"Yes, I'll stop finding bugs in the software - as soon as you stop writing bugs into the software." <-- Me

For all your testing needs: Forum1393
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top