Clean Up Devices After Web Tests

webmate devices are shared testing resources. After a manual or automated web test, release the device so webmate can reset it, unblock the slot, and make it available for the next test.

This article explains what webmate cleans up automatically, what you should clean up before releasing a device, and when to contact support.

When Cleanup Happens

Cleanup starts when a deployed device is deleted or released. In the webmate device list, released devices disappear from Devices in project and their slot becomes available again under Device slots in project. When no device is deployed, the page shows available slots with actions such as Deploy device and Details.

Automated tests can also release devices through the webmate API. The delete call is asynchronous, so test code should wait until the deployed device count has changed before assuming that the slot is free again. See Interact with Devices for the device API workflow.

What webmate Resets

When a device is released, webmate prepares it for reuse. The exact cleanup depends on the platform and slot type, but the goal is always the same: the next test should start from a clean device state instead of inheriting the previous session.

webmate cleanup can include:

  • closing active workbench sessions,
  • ending the running browser or device session,
  • releasing the slot for the project,
  • resetting browser state for the next web test,
  • returning a mobile device to its managed baseline where supported,
  • and marking a device unavailable if cleanup cannot be completed safely.

For web tests that select a slot through capabilities, remember that wm:slot controls where the device is deployed. If no slot is specified, webmate chooses a compatible slot in the project. See Selenium Capabilities in webmate for details.

What You Must Clean Up Yourself

webmate cannot safely undo every action that a test performs outside the device itself. Clean up anything that belongs to your application, test account, or company before releasing the device.

Before releasing a device, check whether you need to:

  • sign out of the application under test,
  • remove test data created in your server systems,
  • close private browser tabs,
  • remove temporary downloads or uploaded files,
  • disable test-only feature flags,
  • stop recordings or debugging sessions,
  • and remove personal or company accounts that were added during testing.

On iOS devices, remove your Apple ID before manually resetting a device, deleting a device from the public cloud, or submitting the device for an update or upgrade.

Release a Manual Test Device

For manual web tests, release the device when the test is finished:

  1. Open the project.
  2. Go to Devices.
  3. Find the deployed device in Devices in project.
  4. Use the delete or release action for that device.
  5. Wait until the device disappears from the deployed devices list.
  6. Confirm that the corresponding slot is available again.

If a device is not listed under Devices in project, it is not currently deployed in the project. Use the slot list only to deploy a new device or inspect slot details.

Release an Automated Test Device

Automated Selenium tests should release devices at the end of the test run, including failure paths. Use a finally block or the cleanup mechanism of your test framework so the release also happens after assertions, browser errors, or test setup failures.

When you use the webmate device API directly, wait for the asynchronous delete operation to finish before starting another run that depends on the same slot. A common pattern is to list deployed devices before deletion, delete the target device, then wait until the deployed device count has decreased.

For a first Selenium setup, see Getting Started .

Troubleshooting Cleanup Problems

If a device remains deployed after you tried to release it, wait a short time and refresh the device list. If the device still appears, try to release it again.

If the workbench can no longer be opened, the connection between the device and webmate may be broken. The FAQ describes two recovery options: reconnect the device, or delete and redeploy it from the corresponding slot. See Frequently Asked Questions .

Contact support if:

  • the device cannot be released,
  • the slot does not become available again,
  • a mobile device lost its connection after changing operating system settings,
  • an iOS device is blocked by an Apple ID, profile, PIN, or update flow,
  • or cleanup fails repeatedly for the same slot.