Let’s say I’m gonna run 20 tests in a row, I’ve got defined 3 env variables:
What I’d like to do with it, is to change which token should be used within test, let’s say all of them will initially use var ‘token’, but depending on this test’s number (even/odd) I’d like to replace it with one of the others.
- So my first question is about determining within test itself, what is it’s number in queue?
- Then, when I know how to check the number of running test, I’ll be able to set token with the code below (according to the research - I didn’t test it yet), so I’d like to know how to combine these together.
Maybe I should do that in 'pre-request Script' instead of 'tests' section?
- Got my anwser for that one already from test docs (pre-request Script);
Also feel free to suggest any other workaround, I need a solution to run every next test with the other token (it’s a bidding endpoint and when you are identified by the same token in short you will get rejected because of trying to overbid youself). But that also brings another subject, can I modify request’s value for every next test in queue? in this case every test should have ‘amount’ higher than the previous one, let’s say by adding +1.
Every help appreciated.