1. 程式人生 > >uiautomator/Android Test Python example

uiautomator/Android Test Python example

>>> 

>>> from uiautomator import device

>>> from uiautomator import device as d

>>> d.info 

{u'displayRotation': 0, u'displaySizeDpY': 811, u'displaySizeDpX': 1442, u'screenOn': True, u'displayWidth': 1920, u'productName': u'rk3399_firefly_box', u'currentPackageName': u'com.android.music', u'sdkInt': 25, u'displayHeight': 1016, u'naturalOrientation': True} >>> d.screen.off() >>> d.screen.on() >>>   

##################  Click any icon on the screen which has the text named "L5"

>>> d(text="L5").click() True >>>