Package src :: Package com :: Package dtmilano :: Package android :: Module viewclient |
[hide private]
[frames] | no frames]

# Module viewclient

source code

    Copyright (C) 2012-2013  Diego Torres Milano
    Created on Feb 2, 2012

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

           http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

    @author: Diego Torres Milano

Version: 3.2.0

Classes | [hide private]
| Window Window class
| ViewNotFoundException ViewNotFoundException is raised when a View is not found.
| View View class
| TextView TextView class.
| EditText EditText class.
| UiAutomator2AndroidViewClient UiAutomator XML to AndroidViewClient
| Excerpt2Code Excerpt XML to code
| ViewClient ViewClient is a ViewServer client.

Functions | [hide private]
__nd(name) Returns: Returns a named decimal regex | source code
__nh(name) Returns: Returns a named hex regex | source code
__ns(name, greedy=False) NOTICE: this is using a non-greedy (or minimal) regex | source code

Variables | [hide private]
| DEBUG = `False`
| DEBUG_DEVICE = `DEBUG and False`
| DEBUG_RECEIVED = `DEBUG and False`
| DEBUG_TREE = `DEBUG and False`
| DEBUG_GETATTR = `DEBUG and False`
| DEBUG_CALL = `DEBUG and False`
| DEBUG_COORDS = `DEBUG and False`
| DEBUG_TOUCH = `DEBUG and False`
| DEBUG_STATUSBAR = `DEBUG and False`
| DEBUG_WINDOWS = `DEBUG and False`
| DEBUG_BOUNDS = `DEBUG and False`
| DEBUG_DISTANCE = `DEBUG and False`
| WARNINGS = `False`
| VIEW_SERVER_HOST = `'localhost'`
| VIEW_SERVER_PORT = `4939`
| ADB_DEFAULT_PORT = `5555`
| OFFSET = `25` This assumes the smallest touchable view on the screen is approximately 50px x 50px and touches it at (x+OFFSET, y+OFFSET)
| USE_MONKEYRUNNER_TO_GET_BUILD_PROPERTIES = `True` Use monkeyrunner (`MonkeyDevice.getProperty()`) to obtain the needed properties.
| SKIP_CERTAIN_CLASSES_IN_GET_XY_ENABLED = `False` Skips some classes related with the Action Bar and the PhoneWindow$DecorView in the coordinates calculation
| VERSION_SDK_PROPERTY = `'version.sdk'`
| ID_PROPERTY = `'mID'`
| ID_PROPERTY_UI_AUTOMATOR = `'uniqueId'`
| TEXT_PROPERTY = `'text:mText'`
| TEXT_PROPERTY_API_10 = `'mText'`
| TEXT_PROPERTY_UI_AUTOMATOR = `'text'`
| WS = `"\xfe"`
| LEFT_PROPERTY = `'layout:mLeft'`
| LEFT_PROPERTY_API_8 = `'mLeft'`
| TOP_PROPERTY = `'layout:mTop'`
| TOP_PROPERTY_API_8 = `'mTop'`
| WIDTH_PROPERTY = `'layout:getWidth()'`
| WIDTH_PROPERTY_API_8 = `'getWidth()'`
| HEIGHT_PROPERTY = `'layout:getHeight()'`
| HEIGHT_PROPERTY_API_8 = `'getHeight()'`
| GET_VISIBILITY_PROPERTY = `'getVisibility()'`
| LAYOUT_TOP_MARGIN_PROPERTY = `'layout:layout_topMargin'`
| VISIBLE = `0x0`
| INVISIBLE = `0x4`
| GONE = `0x8`
| IP_RE = `re.compile('^(\d{1,3}\.){3}\d{1,3}$')`
| ID_RE = `re.compile('id/([^/]*)(/(\d+))?')`

Function Details | [hide private]

### __nd(name) | source code
Returns: Returns a named decimal regex

### __nh(name) | source code
Returns: Returns a named hex regex

### __ns(name, greedy=False) | source code
NOTICE: this is using a non-greedy (or minimal) regex Parameters: `name` (str) - the name used to tag the expression `greedy` (bool) - Whether the regex is greedy or not Returns: Returns a named string regex (only non-whitespace characters allowed)

Variables Details | [hide private]

  ### USE_MONKEYRUNNER_TO_GET_BUILD_PROPERTIES Use monkeyrunner (`MonkeyDevice.getProperty()`) to obtain the needed properties. If this is `False` then `adb shell getprop` is used Value:
      True

  ### SKIP_CERTAIN_CLASSES_IN_GET_XY_ENABLED Skips some classes related with the Action Bar and the PhoneWindow$DecorView in the coordinates calculation See Also: View.getXY() Value:
      False