Skip to main content

Manage Storage States

DevAssure efficiently handles storage state through cookies and local storage, to maintain user preferences, session data, and website configuration. In automated testing, managing states can be crucial for simulating realistic user behavior and ensuring tests function correctly across different login states or website configurations and eliminatinating the need to manually enter OTPs during test execution.

This documentation details DevAssure's functionalities for managing storage states.

Saving and Loading Storage States

DevAssure empowers you to

  • Save Storage State During Recording:

    • While recording a test case, navigate through the login process or steps that establish the desired storage state.
    • Click on the cookie icon within the recorder interface.
    • Select the option to "Save Storage State to File". This triggers DevAssure to capture the current storage state, including cookies and other relevant data, and save it to a designated file.
  • Load Storage State for Reuse:

    • The storage states saved while recording can be loaded in subsequent tests using the "Load Storage State from File" test action, eliminating the need to repeat login steps or manually set cookie values.
Icon

Example

Below is an example of a function which loads a storage state and then opens the respective url (localhost) to check for the presence of an element in login page.

If the element is not present ( login is successful ), if not, the test proceeds to input the credentials and then save it to a state file for subsequent test runs.

Icon