Skip to main content

Storing information between tests / persistent variables (data storage)

Example:

  • user has a list of company IDs that he wants to use in tests

  • each test execution should take the next ID from the list

BugBug could help here if there is an option to somehow store information about the last used ID. This could also be used in other cases, or for exchanging data between tests in the test suite.

Status: Planned5 comments

Log in to comment and vote

Comments5

  • Marius COJOCARIU

    •

    Mar 12, 2025

    Upvoted, we recently had a scenario where such a feature would have come in handy. ^^

    • Paweł Bylina

      Team•

      Mar 14, 2025

      Thanks for the upvote! Could you elaborate a bit more on your use case?

      • Marius COJOCARIU

        •

        Mar 14, 2025

        Let’s say we have a campaign with a table that keeps track on the total number of customer sales.

        This campaign is unique and reused every time when the test executes (I know you might say why not encapsulate data parameters per test? ;) it’s something we do as much as possible, when possible)

        We have a global variable called “campaign_total_sales”.

        At the end of each execution, a sale is done which increases the total number, and we wished we could save at the end the most recent total number of sales in that global variable. The data would be stored in there, and be used at the beginning of each execution to assert the current data in the campaign equals the one stored in the variable.

        It’s quite an edge case and we worked around it by: at the beginning of the test we go to the campaign and save the total value in a local variable. We make a sale with the test, and at the end we assert the local variable increased by +1 using a custom javascript step.

  • Prolorus

    •

    Dec 12, 2024

    Sounds interesting and would be a very powerful advanced feature.

    • Paweł Bylina

      Team•

      Dec 12, 2024

      We believe that tests should work in isolation, but in some cases this is really necessary.