How to create test data on the fly?

Hi ,

I am testing an online e-commerce site, where articles stay up for sale max 10 days. I would like to create a test which opens a live article and buys it. Because articles expire after 10 days I cannot “hardcode” a url to any article in my test.

Is it possible to run an API test which will create a new article on the fly, then pass the ID of my article to the UI test, which will then open the article and buy it?

Most of my tests would need to rely on data generated on the fly specifically for my test.

Thanks in advance!

you can use the global variables. a possible workflow:

  • make the api call, grab the product from response
  • export the productidentifier to a global var
  • call the ui test. the ui test should be paramettized to use the global var
1 Like