Stop Session
Stop a session when its Appium test interaction is complete. Stopping a session ends that interaction period but does not release the allocation.
This distinction matters because the same allocation can be used to start another session afterward.
Before You Begin
Keep the sessionId returned by Start Session. Make sure the test runner has finished sending Appium commands before stopping the session.
SDK Method
Java | Node.js |
|---|---|
client.sessions().stop(sessionId) | await client.sessions().stop(sessionId) |
Parameter
Parameter | Required | Description |
|---|---|---|
sessionId | Yes | Identifier returned by Start Session |
The identifier is sent as the session resource path. There is no request body and no customer-supplied header.
Examples
client.sessions().stop("session-123");Result
The method returns void/Promise<void> when the stop operation succeeds. It does not return an updated Session.
Use List Sessions if the runner needs the finalized session record.
What Happens Next?
- Start another session with the same active allocationId, or
- Collect logs and recordings, then release the allocation if no more sessions are needed.
Do not call allocation deletion as a substitute for stopping the session. Stop the session first.
Stopping a session keeps the allocation active. Release the allocation only after the final session that uses it.