alibaba82
17 years agoSuper Contributor
groovy scripting question (load testing related)
Hello,
I have a test case which i am using in a load test. In this testcase I call a webservice function for which I need a valid user. To get this valid user I query the database to get some random user. This works fine when I run a simple testcase. However in a 200 thread load test, I guess what is happening is that I open 200 connections to my database to a get a random user. One connection for each thread. This is putting extra load on the DB server which I don't want.
How can I script such that 200 scripts share the database connection. Is this possible.
My current stepstep is something like this
GlobalFunctions gb = new GlobalFunctions();
gb.GetRandomUser(context, "AuthenticateUser - Request 1")
In the constructor, I connect to the database.
Thanks
Ali
I have a test case which i am using in a load test. In this testcase I call a webservice function for which I need a valid user. To get this valid user I query the database to get some random user. This works fine when I run a simple testcase. However in a 200 thread load test, I guess what is happening is that I open 200 connections to my database to a get a random user. One connection for each thread. This is putting extra load on the DB server which I don't want.
How can I script such that 200 scripts share the database connection. Is this possible.
My current stepstep is something like this
GlobalFunctions gb = new GlobalFunctions();
gb.GetRandomUser(context, "AuthenticateUser - Request 1")
In the constructor, I connect to the database.
Thanks
Ali