How to pass unique data in script

While parameterizing the data, how can I pass the unique data during execution if multiple scripts are there ? Please suggest

Hi @gsharm37
Welcome to the forum. By “multiple scripts”, do you mean that you’re running several k6 instances at once? Perhaps, like this:

k6 run script1.js
k6 run script2.js

If so, then each k6 instance is fully self-contained and is not aware of what is being done by other instances, and if input data must be unique then it’ll have to be divided in some way prior to these test runs. For example, it can be as simple as hardcoding that script1.js takes first 50 items in the list and script2.js takes 51-100 items in the list.

Perhaps it makes sense to switch to one script with multiple scenarios and use setup and teardown functions to prepare data? Depending on exact details of your use case, there is more than one way to set up this kind of workflow with k6, but not if you have totally separate scripts.