Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.
Parameterize URL Args For Fixed Paths Load Testing
LegacyForum
Posts: 1,664 ✭✭
Using the following script example, you can parameterize URL arguments during load testing on fixed paths:
1) In the ?Paths? view, add the following Python script as a Pre-Traversal method tool to the top most node in your path (which could also be one of the nodes that your are parameterizing):
1) In the ?Paths? view, add the following Python script as a Pre-Traversal method tool to the top most node in your path (which could also be one of the nodes that your are parameterizing):
CODE
def addDataSources(context):
? return "dataSourceName"
where dataSourceName is the name of the data source you are going to be using for parameterization
2) Identify the nodes in the path tree that need to be parameterized. For those nodes, add the following Python script as a Pre-traversal method tool:
CODEfrom webtool.site import *
def addParameterizedArgs(x, context):
? x.putData("_wk_urlParam_ds", AuxString("dataSourceName"))
? x.putData("_wk_urlParam_args", AuxString("arg1:column1,arg2:column2....."))
where dataSourceName is the name of the data source to be used, arg1, arg2, ... are the names of the arguments that need to be parameterized, and column1, column2, ... are the names of the data source columns that is to be used for the parameterization of its corresponding argument.
Note: If you are parameterizing the top most node in your path, then the script from Step 1 should be placed before the script in this step.
3) Test the path at least once, before conducting any load tests
4) In the ?Load Tests? view, select ?Fixed Paths? as the Type of each ?turn on the ?Do not parse HTML? option in the ?Misc? tab of each Virtual User Profile that is to utilize this parameterization.
5) Conduct load testing as you normally would.
0