Today’s tech post is in response to a surprising amount of queries asking how to concatenate strings in QuickTest Pro.
First, it is important to remember that QuickTest Pro scripts are written using VBScript. With that in mind, you can investigate many corners of the internet for sample code and examples of VBScript code. Using the simple Google query returns a host of good resources: VBScript Google Search.
Second, let’s tackle to concatenation issue. In order to concatenate, or add, strings together, you must use the + operator.
‘ Example
Dim strTemp
strTemp = “I am a ” + “little teapot.”
MsgBox(strTemp)
‘ Results: “I am a little teapot.”
This next example takes two variables and concatenates them.
‘ Example
Dim strResults
Dim strTemp1
Dim strTemp2
strTemp1 = “Who let the ”
strTemp2 = “dogs out?”
strResults = strTemp1 + strTemp2
MsgBox(strTemp)
‘ Results: “Who let the dogs out?”
Hopes this tidbit of information helps you out.

