One of the superiority of nGrinder is extensibility with java library in python. Because agent will execute the python script in jython, we can directly import java library in our test script. And here is the example to use jdbc library to perfoem DB load test.

Create jdbc test script:

Open the script list page and click “Create a script”:

Enter a name and select the checkbox to create lib directory. If you didn’t select it, you can also create the lib directory yourself.

After that, you can get a script based on a simple http test template. Then you can modify the script as below:

Then you can click “Validate script” button to validate the syntex of the script. Be careful that the python needs some format requirement for indentation.

NOTICE:

Don’t forget to save the script, because it will not be saved during validating.

If there is no syntex error, then you will have an error about the driver can not be found. Then we need to upload the jdbc library into the “lib” directory. Open the script list page, and go into the lib directory. Click “Upload script or resources”:

Select the jdbc driver of the DB you want to test and upload.

Then go back to your script and validate again. If you get the message as below, it means the script and library has no problem.