(Appium 3-Beta) Breaking Changes -2: Session Discovery Requires Feature Flag

Get a step-by-step walkthrough in the video below!
Inthis article, we will discuss the breaking changes introduced in the ‘Appium 3 Beta’ version. Specifically, we will focus on Breaking Change #2
Introduction:
While Appium 2 was a major overhaul of the entire Appium architecture, Appium 3 is a smaller upgrade with fewer breaking changes, which should result in a much simpler migration process.
## Breaking Changes -2:
Change-2: Session Discovery Requires Feature Flag:
In Appium 2, it was possible to retrieve all active server sessions via the GET /sessions endpoint.
This information could then be used, for example, in Appium Inspector, in order to attach to an existing session, instead of creating a new one.
Appium 3 makes two changes to the session discovery process:
The GET /sessions endpoint is replaced with GET /appium/sessions (see the Removed Endpoints section)
The use of the new endpoint requires the ‘session_discovery’ feature flag
Note:
To reduce migration efforts, the GET /appium/sessions endpoint (locked behind the aforementioned feature flag) is also available in Appium 2.19, allowing you to adjust your code before upgrading to Appium 3. As for Appium Inspector, support for this new endpoint is available starting from version 2025.3.1.
Example -1: Step-By-Step Details: Without Using ‘session_discovery’ feature flag
Step1: Start Appium Server from command line without ‘session_discovery’ feature flag

Step2: Running the script (me running script from eclipse IDE)

Step3: Try fetch ‘SessionId’ from the Appium Inspector →Builder Session →’Attach to Session’ Tab →DropDown

Observe the dropdown will not display the SessionID details, as in Appium3 Using ‘session_discovery’ feature flag is mandatory.
Example -2: Step-By-Step Details: Using ‘session_discovery’ feature flag
Step1: Start Appium Server from command line explicitly with ‘session_discovery’ feature flag

Step2: Running the script (me running script from eclipse IDE)

Step3: Try fetch SessionId from the Appium Inspector →Builder Session →Attach to Session →DropDown

Observe the dropdown will display the SessionID details,
Note that, we started Appium Server with ‘session_discovery’ feature flag
GitHub Link:
🎬 Explore More! Watch My Latest Videos on YouTube!
Visit My Official Blog:
No comments:
Post a Comment