Variable or query param? able to set auto incremental at each test run?

http://localhost:8088/api/products/A/A0001

at the web service object, URL (POST/PUT), i only needs URL http://localhost:8088/api/products/A

can it be achived by using variable or query parameter?

another question, can I set auto incremental of last param A0001
e.g. first test it will be A0001
then always + 1 to A0002 at next test?

text at HTTP body as below:
{
“productId”: “A0001”,
“name”: “Test Product A One”,
}

Hello,

you must save your variable into permanent memory (file, DB, …).
At the start of test, read it, use it and replace with incremented value.

could pls elaborate more. save them in object repository web service , variable?

Read about reading and writing into JSON config files.

You cannot persist values in Object repository or Global variables.

Don’t really understand. I thought I can make use of variable to call it.
Anyway thank you.

It’s not so easy. You can use variables within single test suite run, then all variables are erased.

1 Like

You can save it to a Gloval Variable. As above comments Global Variables cannot be shared across Test Suites but I think you won’t need that use case.