I have many tests that I need to update the URL parameter in. I figured I can write a script to do a mass update instead of doing each individually.

When I run my script I can get the parameter properly but I cannot SET the default value of the parameter. What am I doing wrong?

I am using VB.NET and the following function is the one that isn't working. Isn't the ParameterDefinition object the object I need to set? I have a TestClass that I use to store the Name and path of the QTP test stored in QC.

<font class="small">Code:</font><hr /><pre>
Private Sub UpdateParameter(ByVal arrObjQTPTests() As TestClass, ByVal strParamName As String, ByVal strParamValue As String)
Dim qtApp As QuickTest.Application ' Declare the application object
Dim pDefColl As ParameterDefinitions ' Declare a ParameterDefinitions collection
Dim pDef As ParameterDefinition ' Declare a ParameterDefinition object

qtApp = New QuickTest.Application ' Create the application object

qtApp.Launch() ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible

'If connection not already established then establish connection(QTP already running)
If Not qtApp.TDConnection.IsConnected Then
Debug.WriteLine("QC is not connected; Connecting to QC.")
qtApp.TDConnection.Connect(txtQCURL.Text, txtDomain.Text, txtProject.Text, txtUserName.Text, txtPassword.Text, False)
End If

Dim objQTPTest As TestClass
For Each objQTPTest In arrObjQTPTests
If qtApp.TDConnection.IsConnected Then ' If connection is successful

Dim strQCTestPath As String
strQCTestPath = "[QualityCenter] " &amp; objQTPTest.Path &amp; "\" &amp; objQTPTest.Name

Debug.WriteLine("Open test from QC: " &amp; strQCTestPath)
qtApp.Open(strQCTestPath, False) ' Open test in read write mode

' Retrieve the parameters collection defined for the test.
pDefColl = qtApp.Test.ParameterDefinitions

If ckOutputParam.Checked Then
Dim pCount, Index As Integer
pCount = pDefColl.Count
Index = 1

' Display the names and values of each of the parameters in the collection.
While Index &lt;= pCount
pDef = pDefColl.Item(Index)
Dim strParamInfo As String
strParamInfo = "Param name: " &amp; pDef.Name &amp; vbCrLf &amp; "Type: " &amp; pDef.Type &amp; vbCrLf &amp; "InOut: " &amp; pDef.InOut &amp; vbCrLf &amp; _
"Description: " &amp; pDef.Description &amp; vbCrLf &amp; "Default value: " &amp; pDef.DefaultValue &amp; vbCrLf
Index = Index + 1
End While
End If

Debug.WriteLine("Updated Parameter """ &amp; strParamName &amp; """ from """ &amp; pDefColl.Item(strParamName).DefaultValue &amp; """ to """ &amp; strParamValue &amp; """.")
pDefColl.Item(strParamName).DefaultValue = strParamValue ' Change the parameter default value.
qtApp.Test.Save() ' Save test to server.
Catch ex As Exception
Debug.WriteLine("Parameter is not found; Did not update Parameter """ &amp; strParamName &amp; """ with value """ &amp; strParamValue &amp; """.")
MsgBox("Parameter is not found; Did not update Parameter """ &amp; strParamName &amp; """ with value """ &amp; strParamValue &amp; """.") 'Parameter is not expected; Not updated.
End Try
MsgBox("Cannot connect to Quality Center") ' If connection is not successful, display an error message.
End If

qtApp.TDConnection.Disconnect() ' Disconnect from Quality Center
qtApp.Quit() ' Exit QuickTest

qtApp = Nothing
End Sub
</pre><hr />