Agent use different test user infos with each test run

Hi,

I would like to know if it is possible to iterate over the data the agents use with each test run. To be more specific:

I have two agents, a set of test data containing 10 users (username and password combo) and I want to run the testrun 100 times. Both agents are performing the same log in, read page, log out testrun. Agent 1 would use the first user on the first run, agent two would use the second user and so on. Once the end of the user list is reached the agents start from the first user again. The agents never use the same user at the same time. Is this possible to do with XLT?

Thank you!

Kind regards,
Ivan

Welcome to the forum and thanks for using XLT. You have at least two options.

ExclusiveDataProvider
ExclusiveDataProvider has been designed to permit exclusive handling of data across a test. If you use it to access a data file, this file will be divided into chunks and each agent (aka JVM that runs the test) sees only its chunk. When a user on that agents asks for data, this data set is blocked/checked out and nobody else will use it. At the end of the test, you have to return that to the pool otherwise it will be lost (recommended is a finally approach or via @After.

https://lab.xceptance.de/releases/xlt/latest/apidoc/com/xceptance/xlt/api/data/ExclusiveDataProvider.html

You can find a very complex use case in our advanced test suite: https://github.com/Xceptance/posters-advanced-loadtest-suite/blob/master/src/main/java/com/xceptance/loadtest/api/data/DataSupplier.java

Feel free to check the code in XLT that does that: https://github.com/Xceptance/XLT/blob/9fcf04d0ccce817d5b375fbe0116925eda18789d/src/main/java/com/xceptance/xlt/util/ExclusiveUtils.java#L25

Manual
You can also do that all manually and basically do what the ExclusiveDataProvider does on your own. It will basically check the user number the test uses as well as the total user number and use that to calculate the chunks.

https://lab.xceptance.de/releases/xlt/latest/apidoc/com/xceptance/xlt/api/engine/Session.html gives you the ability to get to that data with Session.getCurrent().getTotalUserCount() for instance. There are many more data points available. Based on that data, you can calculate the validate positions in a data file yourself and make sure each user only uses these.

Hi,
thank you, I will look into it.
LG,
Ivan