Search code examples
jmeterperformance-testing

Fill form with all unique data by 50 users in jmeter


I want to test one form of Add student which contains lots of fields , I want that 50 users comes to that form , enter unique data and submit it. So when I check in my site , there should be new 50 students added.

I have set all test plan in jmeter but how can I set/get unique field values for all 50 users in Jmeter? I have worked with all type of scenarios in jmeter but this one is new for me so need help.


Solution

  • Take a look at the following JMeter Functions:

    • __threadNum() - returns number of current thread (virtual user). If you use something like User${__threadNum} it will be User1 for first thread, User2 for second thread, etc.
    • __RandomString() - returns random string of specified length from characters provided. For instance ${__RandomString(,abcdefghijklmnopqrstuvwxyz0123456789,10)} will return random alpha-numeric string of 10 characters
    • __UUID() - returns unique GUID structure, something like eed5f026-a4a7-4481-9c3e-ce1a0129c25d
    • __StringFromFile() - returns next string from the specified file each time being called. If file end is reached it starts over from the beginning.

    See How to Use JMeter Functions posts series for more detailed information on above and other functions.