Skip to content

feat: add support for Appium 3 session retrieval #1927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 3, 2025

Conversation

eglitise
Copy link
Collaborator

@eglitise eglitise commented Feb 2, 2025

This PR adds support for retrieving and attaching to existing sessions in Appium 3, which will use the /appium/sessions endpoint (see appium/appium#20880). If such sessions are found, they will also have the session ID (shown in their dropdown entry) replaced with the session creation timestamp.

Compatibility with Appium 1-2 and Selenium Grid sessions remains unchanged, although all 3 endpoints are now queried in parallel for better performance.

@github-actions github-actions bot added the enhancement New feature or request label Feb 2, 2025
@eglitise eglitise merged commit 358ec6f into appium:main Feb 3, 2025
7 checks passed
@eglitise eglitise deleted the support-new-session-retrieval branch February 3, 2025 12:14
let identifier = session.id;
if ('created' in session && !_.isUndefined(session.created)) {
// For Appium 3+ sessions, replace session ID with timestamp
identifier = new Date(session.created).toJSON();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if this would work if multiple sessions were created in parallel at the same time

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timestamp has a milisecond precision, so it's quite unlikely, but even if this does happen, the list would be rendered just fine, as there are no requirements for the identifier to be unique.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it worth to make an explicit comment about the uniqueness of the identifier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants