This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Testing with JMeter scripts
Apache Jmeter scripts are used for performance testing. In WSO2 Open Banking solution, JMeter scripts are used to test API flows. After following the steps for the pre conditions, we can test with JMeter scripts. Currently, WSO2 Open Banking solution supports JMeter script testing for the following.
Before you begin
Follow the preconditions that are required to test Accounts flow and Payments flow using the available JMeter scripts. The steps are mentioned below.
Download following dependency jar files and put them intoÂ
[JMETER_HOME]/lib/ext
directory.This step is mandatory for the JMeter scripts to load.
Generate public and private keys using the following commands.
keytool -genkey -alias <myalias> -keyalg RSA -keystore <keystore-name>.jks keytool -export -alias <myalias> -file <filename> -keystore <keystore-name>.jks keytool -importkeystore -srckeystore <keystore-name>.jks -destkeystore myapp.p12 -deststoretype PKCS12 openssl pkcs12 -in myapp.p12 -nokeys -out myalias.pem openssl pkcs12 -in myapp.p12 -nodes -nocerts -out <private-key-name>.pem
If you have obtained the OBIE certificate when configuring DCR, use the certificate and keys to generate the keystore with the following commands.
Find the below descriptions for the parameters. Change them accordingly;
tpp.com.crt :
Private certificate obtained from OBIEtpp.com.key :
Private keysopenssl pkcs12 -export -name tim -in tpp.com.crt -inkey tpp.com.key -out tim.p12 keytool -importkeystore -destkeystore keystore.jks -srckeystore tim.p12 -srcstoretype pkcs12 -alias tim
Create a sample application, subscribe to an API and generate production/sandbox keys. Open and provide the content between BEGIN CERTIFICATE and END CERTIFICATE of the
myalias.pem
 file as the application certificate.Create a directory namedÂ
jwtExtResources
 in a preferred location and place the jks keystore
file created in the above steps.Create a
setup.properties
file inÂ[JMETER_HOME]/bin
 path and add the required properties. Example properties are as follows.ip_address=<Enter your ip address here. Ex: 127.0.0.1> port=<Enter the specific http port here. Ex: 8280> https_port=<Enter the specific https port here.Ex: 8243> client_id=<Enter your client_id here. Ex: C5jcraWOnrqzBdvm2x0g6h8hcJAa> domain=<Enter your domain address here. Ex: openbanking.staging.wso2.com> result=<Enter the path to save the results here. Ex: /home/user/jmeter/apache-jmeter-3.2/bin/writedisabled/results> jwtExtResources=<Enter the path to jwtExtResources directory here. Ex: /home/user/jmeter/apache-jmeter-3.2/bin/jwtExtResources> redirecturl=<where the authorization flow is redirected to when creating the application> algorithm=<Enter the algorith as a new property> PS256
Update the global variable to read theÂ
setup.properties
 file by calling the variable in the format. e.g.,Â${__P(ip_address)}.
Within the global variable, set the values for the below properties based on published API's. This will ensure that each API call reads the API context, version and resource, path based on the configurations.
api_context
version
api_resource
Create a file namedÂ
jwtbuilder.properties
 in[JMETER_HOME]/bin/jwtExtResources
 directory with below details. ÂÂ
keyStorePassword=<Enter your key store password here. Ex.wso2carbon> keyStoreDomainName=<Enter alias name of the keystore here. Ex.myalias> clientID=<Enter application client ID here. Ex. nwU59qy9AsDqftmwLcfmkvOhvuYa> keyStoreName=<Enter KeyStore file name here. Ex.TodayApp.jks> tokenAPIURL=<Enter token endpoint URL which you have to use as aud value Ex. http://localhost:8280/token> Algorithm=<Enter algorithm details which JWT token need to be generated Ex. PS256>