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/.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 20 Next »

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 the pre conditions, we can test with jmeter scipts. Currently WSO2 Open Banking solution supports jmeter script testing for the following.

Before you begin

Follow the pre conditions that are required to test Accounts flow and Payments flow using the available JMeter scripts. The steps are mentioned below.

  1. Download following dependency jar files and put them into [JMETER_HOME]/lib/ext directory.

    1. tag-jmeter-extn-1.1.jar 
    2. nimbus-jose-jwt-5.4.jar

    3. jwt-builder-jmeter-ext-1.3.0.jar

      Step 1 is mandatory. Otherwise, the JMeter scripts will not load.

  2. Generate public and private keys using the following commands.

    keytool -genkey -alias myalias -keyalg RSA -keystore <keystore-name>.jks
    keytool -export -alias myalias -file myalias -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 OBIE

    tpp.com.key : Private keys

    openssl 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
  3. 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.

  4. 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
  5. Update the global variable to read the setup.properties file by calling the variable in the format. e.g., ${__P(ip_address)}.

  6. Within the global variable, please 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.

    1. api_context
    2. version
    3. api_resource
  7. Create a folder named jwtExtResources in [JMETER_HOME]/bin directory and copy paste the jks keystore file created in the above steps.

  8. 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. RS256>


  • No labels