Server 'Settings' released in master

We’ve added the concept of ‘Settings’ to the Appium server.

Settings are a new concept introduced by appium. They are currently not a part of the Mobile JSON Wire Protocol, or the Webdriver spec.

Settings are a way to specify the behavior of the appium server.

Settings are:

  • Mutable, they can be changed during a session
  • Only relevant during the session they are applied. They are reset for each new session.
  • Control the way the appium server behaves during test automation. They do not apply to controlling the app or device under test.

An example of a setting would be ignoreUnimportantViews for Android. Android can be set to ignore elements in the View Hierarchy which it deems irrelevant. Setting this can cause tests to run faster. A user who wants to access the ignored elements however, would want to disable ignoreUnimportantViews, and reenable it afterwards.

Another example of a use-case for settings would be telling appium to ignore elements which are not visible.

Settings are implemented via the following API endpoints:

POST /session/:sessionId/appium/settings

Expects a JSON hash of settings, where keys correspond to setting names, and values to the value of the setting.

{
  settings: {
   ignoreUnimportantViews : true  
  }  
}

GET /session/:sessionId/appium/settings

Returns a JSON hash of all the currently specified settings.

{
  settings: {
   ignoreUnimportantViews : true  
  }  
}

The only actual setting we’ve added so far is :

“ignoreUnimportantViews” - Boolean which sets whether Android devices should use setCompressedLayoutHeirarchy() which ignores all views which are marked IMPORTANT_FOR_ACCESSIBILITY_NO or IMPORTANT_FOR_ACCESSIBILITY_AUTO (and have been deemed not important by the system), in an attempt to make things less confusing or faster.

The above is copied from the docs, which live here:

https://github.com/appium/appium/blob/master/docs%2Fen%2Fadvanced-concepts%2Fsettings.md

This has been reverted until some conversations are completed. I expect it to be back soon.

How to use settings in the Script using java bindings

The settings API has to exist before the bindings can support it.

It’ll be added to the java bindings after the feature gets merged into master. Will be pretty simple, plus I’ll create helper-functions for toggling the specific settings.