Forum Discussion

tsteinke's avatar
14 years ago

Load testing a SQL database server

I have a web-based application that interacts with a SQL database. Just as an example, a user will go into the application and pay a bill. This will create a record in the database showing that the bill has been paid. When I record a test to perform this action and then play the test back, there is no record of a bill being paid. During a dry run of the load test, we had 5 users performing this task. We did see a small spike in activity on our webserver's memory and CPU as well as in network traffic. However, our database monitor did not register any activity whatsoever and no paid records were created.



Can you tell me, if it's possible, how I can set up my load tests so that I am also load testing my database server? We have to make sure it can handle several users' activities at once, but the HTTP Load Testing feature of TestComplete doesn't appear to have a way to do that. Help please, we need help urgently!!!



Tim

9 Replies

  • Hi Tim,


    As far as I understand, you need to check how a web application works, and the web application, in its turn, uses SQL Server back-end. In this case, you need to record the HTTP traffic sent from a web browser to your application, and your application will interact with SQL Server. There is no need to interact with the SQL Server instance directly until you need to emulate your entire web application, not a virtual user, from TestComplete.


    Please describe the problem you are facing in detail and check whether your test logs contain warning messages - such messages may indicate that something has gone wrong. If there are some errors or warnings in the test log, I recommend that you see the Load Testing Troubleshooter help topic. Also, please note that TestComplete actually sends the same traffic which was recorded during the test by default. So, this might be the expected behavior, because the recorded task can, for example, try to create a record which was created during the recording.

  • Hi,


    I have the same problem. In log I have information that I can't create this record, because it was already created (during the recording). So I have question: how can I change my task - because I should have unique data.


    I will be waiting for your help - Kasia

  • Thank you - it was very helpful, but unfortunately I have another problem, when I want to save my bill and go to my application I have unique response:


    <input type="hidden" name="ObjectAreaControl$ProductBillGUIDHiddenField" id="ObjectAreaControl_ProductBillGUIDHiddenField" value="448fb1a8-8631-40c0-aa57-cb6adc73ff31" />


    (value is always different), but in my test I always have the same value which was recorded. How can I take current value and change this data in my further request?


    I'm looking forward for your help - Kasia

  • Hi Katarzyna,


    You need to use auto-updated parameters for that (see the Auto-Updating Page Parameters help topic for more information).


    For example, here are the auto-updated parameters for common ASP.NET variables:


    Name: __VIEWSTATE

    Regular Expression: \sname\s*?\=\s*?"__VIEWSTATE"[^^]*?\svalue\s*?\=\s*?"(.*?)"[^^]*?>

    Replacing Mask: $1


    Name: __EVENTVALIDATION

    Regular Expression: \sname\s*?\=\s*?"__EVENTVALIDATION"[^^]*?\svalue\s*?\=\s*?"(.*?)"[^^]*?>

    Replacing Mask: $1


    Here, the Name field refers to an URL or body variable name (that is, a parameter of a GET or a POST request). The regular expression is applied to the body of responses sent by your web server (that is, to the HTML markup returned by the server in general case). Since __VIEWSTATE value is written in a hidden input tag, the particular regular expression retrieves a tag which has "name" attribute equal to "__VIEWSTATE" and gets the value of the "value" attribute from the same tag - that is, retrieves the viewstate value. The Replacing Mask field specifies the new value of the __VIEWSTATE URL or Body parameter which should be inserted instead of the recorded value. The value can be either a hard-coded string or (which is more common case) a string retrieved from an actual server response via a regular expression (as in the sample above). The "$1" string means that the recorded value should be replaced with the value retrieved from a first regular expression match group (note the parentheses in the regular expression above - the value in parentheses is the value which will be retrieved from the actual HTML and inserted in HTTP requests).

  • Ok - I use auto-updated parameters:


    Name: ProductBillGUIDHiddenField

    Regular Expression: \sid\s*?\=\s*?"ProductBillGUIDHiddenField"[^^]*?\svalue\s*?\=\s*?"(.*?)"[^^]*?>

    Replacing Mask: $1


    but nothing change. Can you tell me what is wrong with this?


  • Hello,


    Can you analyze my project suite and tell me if it is possible to auto updating ObjectAreaControl$ProductFinderGUIDHiddenField in all further request. (The first time I gets it in Request0179).


    Thanks a lot - Katarzyna


  • Hi Katarzyna,





    It looks like you just specified the hidden field's ID value incorrectly. The following regular expression should work:

    \sid\s*?\=\s*?"ObjectAreaControl_ProductFinderGUIDHiddenField"[^^]*?\svalue\s*?\=\s*?"(.*?)"[^^]*?>