Saving a bookingID from a website so I can reuse it in another section

when my test is finished, it generates a confirmation page, which generates a BookingID and I would like to capture that ID to use in another test. Ive been exploring with excel, but as its going to change everytime, and I only need it for this one test I wondered if there was a better way I could store it and then reuse it.

image this is the booking ID that I need so I can then put it in here.

I think Ive looked at too many different scenarios/help as Ive got myself so confused as to the best way to do it.

Happy to provide any further code you need, but I didnt think it would be helpful putting my test case here as my Test case is fine, I just need to take this number from it at the end.

Any suggestion to help @lisa.s to improve her saving logic and coding …

The issue is @lisa.s is looking for the best, which to me is relative. Anyway, the below is a way that will work but being the best is for you to decide. Are you able to handle the Script tab or are you limited to the Manual tab?

If you are only going to get the bookingID once for all time, maybe just type it into a spreadsheet yourself manually.

Edit: if you are limited to just the Manual tab, then create a new Test Case and copy and paste the code from the link into the Script tab of the new Test Case. After that, look at the Manual tab and duplicate it into your TC.

Do you run your tests from a test suite? One after another?
You can store the bookingid in a globalvariable and it’s value is preserved until the TS runs.
It means you can save the id in the first test case and use it in the second one.
This way the id is not phisically saved in a file

Thanks for your help :slight_smile: . I will only be using the Booking ID once. So putting it into a spreadsheet wont quite work for me, hence wondering how to save it elsewhere.

Thanks, I might give this one a go :slight_smile: