buttons

(Appium 3-Beta) Breaking Changes -1: Feature Flag Prefix Required

 

(Appium 3-Beta) Breaking Changes -1: Feature Flag Prefix Required

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 #1

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 -1:

Change-1: Feature Flag Prefix Required

With Appium 2, it was possible to opt into certain insecure features on server startup, which could be enabled

using the — allow-insecure or — relaxed-security flags. Appium 2.13 added the ability to optionally provide a scope prefix to specific features,

ensuring that they would only be enabled for the specified driver (or all of them).

Appium 3 makes the scope prefix mandatory, and will throw an error if features are specified without a scope.

Note that the behavior of the — relaxed-security flag remains unchanged.

If you use the ` — allow-insecure` server flag, add a scope prefix before each feature name.

For example, if you use the UiAutomator2 `adb_shell` feature, on Appium 2 you would enable it

like this:

appium --allow-insecure=adb_shell

Example:

Press enter or click to view image in full size

On Appium 3, to ensure this feature is only activated for UiAutomator2, you can run it like so:

Syntax:

appium --allow-insecure=<automationName>:<feature_name>

Example: Without adding a scope prefix

appium --allow-insecure=adb_shell

Will display following error message

Example:

Press enter or click to view image in full size

Adding a scope prefix — (auotomationName) i.e. UiAutomator2:

appium - allow-insecure=uiautomator2:adb_shell

Example:

Press enter or click to view image in full size

Alternatively, if you wish to keep the Appium 2 behavior and enable the feature for _all_drivers that support it, you can use the wildcard (`*`) prefix:

appium - allow-insecure=*:adb_shell

Example:

Press enter or click to view image in full size

Server-scope features like `session_discovery` also require the wildcard prefix.

No comments:

Post a Comment