We have TestComplete Enterprise edition and I'm starting to look into load testing a web-based app. I've been able to get it to record the HTTP traffic as Tasks. On the HTTP Load Testing window it shows the Connections and list of Requests.
What I want to do is loop through those actions, using different data. However, in the User Request Header and Server Response Header data, I don't see the data that was entered on the web pages.
I've read the Help Topics, including "Working with Request Properties From Scripts" and I'm not finding the part that lets me identify which requests I need to modify, and see the data that's in them.
It sounds like you want the RequestBody. So try this (vbscript):
set myTest = LoadTesting.HTTPTask("taskName")
set myTestData = myTest.Connection(0).Request(0)
set variableList = myTestData.Contents
Log.Message "Variables submitted",variableList
If you run the above lines, it should log all the parameters that got passed when the page was submitted. Once you know the parameters, you can replace them like this:
myTestData.Variables.Item(parameter) = newValue
where parameter is a string.
You might need to change the numbers in the set myTestData = myTest.Connection(0).Request(0) line. Look in your HTTP Load Testing Log window and find which connection has the actual POST -- that's the one you want to use.