Thursday, April 22

VBScript - 5 Assign Test Parameters to QTP script

This blog is in sequence with my previous blogs and they are shown below.

VBScript - 1 . Launching QTP
VBScript - 2 . Connecting to QC/Open QC test
VBScript - 3. Add Resources of the Script

Here we shall look how to intialize the test parameters.


Dim ParamName,i 
Create parameter definition object
    Set rtParams = appQTP.Test.ParameterDefinitions.GetParameters()
   
   wscript.echo "Assigning Parameter Started "
   ParamName = "Test1"
   wscript.echo "Parameter " & ParamName
   rtParams.Item(ParamName).Value = "ABCD"
   wscript.echo "Parameter " & ParamName &  " = "  & rtParams.Item(ParamName).Value
   ParamName = "Test2"
   wscript.echo "Parameter " & ParamName
   rtParams.Item(ParamName).Value = "DEFG" 
   wscript.echo "Parameter " & ParamName &  " = "  & rtParams.Item(ParamName).Value
   wscript.echo "Assigning Parameter Ended "   


1 comment:

  1. When i try to use the parameters in the script, the value of the parameters became ""

    ReplyDelete

---------------------------------------------

Related Posts Plugin for WordPress, Blogger...