![]() ![]() Each JMeter virtual user will receive credentials from the following csv file line.Īnother way to parametrize your performance scripts is to use database data through JDBC. If we run our test script now, JMeter will substitute these variables with values from the "TestUsers.csv" file. This can be done by substituting the initial values with appropriate variables from the “Variable Names” configuration field of the CSV Data Set Config, like this: The last step we have to take is to parametrize the login request with CSV variables. In our case, it’s enough to add the “Filename” and “Variables Names” config values: We can now use this file with the CSV Data Set config. Let’s create a csv file containing different users with names and passwords: Identifier - all threads sharing the same identifier also share the same file.Current thread - each file will be opened separately for each of threads.Current thread group - the file will be opened once for each thread group.All threads - the file is shared between all virtual users (the default).Stop thread on EOF? - "False," in case of loop iteration over the CDC file and true if you want to stop the thread after reading the whole file.It will instruct JMeter to move the cursor at the beginning of the file Recycle on EOF? - "True," in case the file test plan should iterate over the file more than once.Allow quoted data? - "True," in case you want to ignore double quotes and allow such elements to contain a delimiter.Delimiter - delimiter that will be used to split the parsed values from the input file.If empty, the first line of the file will be interpreted as the list of variable names Variable Names - list of separated variable names that will be used as a container for parsed values.File Encoding - encoding of input file, if it’s not the platform default.Relative file names are resolved based on the path of the active test plan. Name - element name as it will be used in the JMeter tree.Right click on login request -> Add -> Config Element -> CSV Data Set ConfigĪ short explanation of "CSV Data Set Config" parameters: We can easily parametrize that request by using an external CSV file and running the script across different users. ![]() Let’s assume that we have a login request that works for one specific user: If you want to test your application across different users, you need to provide a list of user credentials. The best example of CSV input files usage is a login process. In Apache JMeter, one of the common ways to parametrize your performance scripts is to use a CSV file. This makes it one of the main aspects in performance tests creation. For example, running multiple users with different credentials in the same script. Parameterization is the act of creating different data sets for different users in the same test script. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |