Bulk user creation in WSO2 carbon based products

Users can be created in WSO2 servers from the admin console as in the document [1]. However, When it comes load testing scenarios where you need to create users in bulk, this UI user creation option is not the optimal way.

Lets say we need to create 10000 users in the WSO2 server. Here i am providing you a JMETER script which i used to do the same.

Step 1:

We need to prepare the request which we are going to use for user creation. Here i am using RemoteUserStoreManagerService admin service. In order to view the WSDL file of the AdminServices, We need to make them visible by making following property false in carbon.xml

<! — If this parameter is set, the ?wsdl on an admin service will not give the admin service wsdl. →<HideAdminServiceWSDLs>false</HideAdminServiceWSDLs>

Step 2:

Prepare the request from soap UI by creating a new soap project by providing the above wsdl. In my case it was, https://localhost:9443/services/RemoteUserStoreManagerService?wsdl

Step 3:

Configure the JMETER script.

2. For the above created thread group, Add a HTTP request

3. For the above created http request, give inputs as follows. As i have highlighted, I have parameterized the username field here by giving it with $ sign and curly brackets as ${username}

4. As now we have the request, We need to do basic authorization as we call the admin service. For that it is needed to add HTTP Authorization Manager from the path Add →Config Element → HTTP Authorization Manager. Once we added that we have to add an entry to that as follows.

5. Then for the above created SOAP request we need to pass in following headers. In order to do that we have to add a HTTP Header Manager as in following path. Add →Config Element → HTTP Header Manager

6. Then we have to provide the input to the above parameter from a CSV file. For that we need to add a CSV Data Set Config from the following path Add →Config Element → CSV Data Set Config

Once added we have to provide following parameters.

7. Finally, We can have a way to see the requests and the results. For that you can add a View Results Tree element.

Step 4

Now we are all done. You can run the script and create any number of users by changing the number of loop count in the thread group. In my case i wanted to create 12000 users. So i had 12000 users names ( comma separated) in my input.csv file and thread group as follows.

You can find this script in [2] and input file in [3]

[1] https://docs.wso2.com/display/AM210/Adding+Users

[2] https://github.com/shammijayasinghe/Medium/blob/master/UserCreation.jmx

[3] https://github.com/shammijayasinghe/Medium/blob/master/input.csv



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Shammi Jayasinghe

Shammi Jayasinghe


Architect and Associate Director of WSO2 Inc, Leading the Customer Success team in USA region