如何使用uiautomator识别android虚拟玻璃的元素?

时间:2018-10-29 07:43:22

标签: automation adb android-uiautomator

我试图从3D VR玻璃中获取元素。识别了对象,但未执行所需的操作

Android详细信息: Android SDK级别: 7.1.2 API级别: 25

def bluetooth(d):
os.system("adb shell am start -a android.bluetooth.adapter.action.REQUEST_ENABLE")
sleep(1)
print ("Inside bluetooth function...")
bluetooth = d(className='android.widget.Button', packageName='com.android.settings',
              resourceId='android:id/button1').click()

我收到此错误:

开始:意图{act = android.bluetooth.adapter.action.REQUEST_ENABLE} 警告:活动尚未开始,其当前任务已置于最前面 内置蓝牙功能...

Traceback (most recent call last):
  File "C:/Roshni/VR Glass Automation/VR_Automation_version1.py", line 56, in <module>
    bluetooth(d)
  File "C:/Roshni/VR Glass Automation/VR_Automation_version1.py", line 53, in bluetooth
    resourceId='android:id/button1').click()
  File "C:\Python27\lib\site-packages\uiautomator\__init__.py", line 74, in __call__
    return self.func(*args, **kwargs)
  File "C:\Python27\lib\site-packages\uiautomator\__init__.py", line 924, in _click
    return self.jsonrpc.click(self.selector)
  File "C:\Python27\lib\site-packages\uiautomator\__init__.py", line 425, in wrapper
    server.start(timeout=30)
  File "C:\Python27\lib\site-packages\uiautomator\__init__.py", line 481, in start
    raise IOError("RPC server not started!")
IOError: RPC server not started!

0 个答案:

没有答案