天道酬勤,学无止境

androidviewclient

AndroidViewClient:结尾部分不允许有内容(AndroidViewClient: content is not allowed in trailing section)

问题 我在家里的 Windows Vista 机器上通过 Git 安装了 AndroidViewClient,并设置了路径变量并运行了 check-imports.py 脚本以确保一切正常。 接下来,我尝试从 /examples 文件夹运行 settings.py 脚本并收到以下错误: C:\Users\Allen>monkeyrunner C:\Users\Allen\AndroidViewClient\AndroidViewClient\e xamples\settings.py 130615 22:24:56.666:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] Script terminated due to an exception 130615 22:24:56.666:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ]Traceback (most recent call last): File "C:\Users\Allen\AndroidViewClient\AndroidViewClient\examples\settings.py" , line 49, in <module> vc = ViewClient

2021-11-19 01:13:58    分类:技术分享    android   testing   automation   monkeyrunner   androidviewclient

AndroidViewClient: content is not allowed in trailing section

I installed AndroidViewClient via Git on my Windows Vista machine at home and I setup the path variables and ran the check-imports.py script to make sure everything was ok. Next, I tried to run the settings.py script from the /examples folder and got the following error: C:\Users\Allen>monkeyrunner C:\Users\Allen\AndroidViewClient\AndroidViewClient\e xamples\settings.py 130615 22:24:56.666:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] Script terminated due to an exception 130615 22:24:56.666:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ]Traceback (most recent

2021-11-12 05:44:16    分类:问答    android   testing   automation   monkeyrunner   androidviewclient

androidviewclient 是否可以获取和打印按钮状态?(Is it possible with androidviewclient to obtain and print button status?)

问题 我正在使用 androidviewclient 11.5.6 并尝试自动化具有 powerSwitch 按钮的 BLE 应用程序。 我想获取按钮的状态并打印状态。 是否可以使用 androidviewclient 或者我应该尝试使用其他工具? 请帮忙!! 这是我的代码 #! /usr/bin/env python # -*- coding: utf-8 -*- import re import sys import os import time import unittest from com.dtmilano.android.viewclient import ViewClient, CulebraTestCase TAG = 'CULEBRA' class CulebraTests(CulebraTestCase): @classmethod def setUpClass(cls): cls.kwargs1 = {'ignoreversioncheck': False, 'verbose': False, 'ignoresecuredevice': False} cls.kwargs2 = {'forceviewserveruse': False, 'useuiautomatorhelper': False, 'ignoreuiautomatorkilled': True

2021-11-10 08:12:48    分类:技术分享    android   python-2.7   androidviewclient

AndroidViewClient 转储动画视图(AndroidViewClient dump animated view)

问题 其中一个视图不断刷新(用于音乐进度的SeekBar) 当我尝试进行转储时,出现以下错误: RuntimeError:视图刷新太频繁而无法转储。 是否可以在转储未完成或类似的情况下冻结应用程序? 回答1 这是uiautomator 的限制。 您可以尝试使用ViewServer作为后端,因为它在大多数情况下都可以工作,但是您需要有根设备或访问应用程序源代码,如 https://github.com/dtmilano/AndroidViewClient/wiki#select-the- 中所述正确实施。

2021-11-09 00:58:03    分类:技术分享    android   automated-tests   androidviewclient

AndroidViewClient dump animated view

One of the view is constantly refreshing (a SeekBar for music progress) When I try to make a dump, I got this error: RuntimeError: The views are being refreshed too frequently to dump. Is it possible to freeze the app while the dump is not finished, or something similar?

2021-11-07 07:56:59    分类:问答    android   automated-tests   androidviewclient

Is it possible with androidviewclient to obtain and print button status?

I am using androidviewclient 11.5.6 and trying to automate BLE application having powerSwitch button. I want to obtain the status of button and print the status. Is it possible with androidviewclient or I should try with some other tool?? Please help!! Here Is my code #! /usr/bin/env python # -*- coding: utf-8 -*- import re import sys import os import time import unittest from com.dtmilano.android.viewclient import ViewClient, CulebraTestCase TAG = 'CULEBRA' class CulebraTests(CulebraTestCase): @classmethod def setUpClass(cls): cls.kwargs1 = {'ignoreversioncheck': False, 'verbose': False,

2021-11-05 07:30:30    分类:问答    android   python-2.7   androidviewclient

使用 AndroidViewClient 长按视图(Long press on a view using AndroidViewClient)

问题 如何使用 AndroidViewClient 模拟长按视图(例如按钮)? ViewClient的 touch 方法总是对其输入执行简单的按下(即使我将type参数设置为adbClient.DOWN ) 编辑: adbclient.py的 touch 方法有一个类型参数,但它没有在方法体中使用。 在MonkeyRunner ,当类型为DOWN 时,它执行长按。 def touch(self, x, y, eventType=DOWN_AND_UP): self.shell('input tap %d %d' % (x, y)) 回答1 我现在找到了我的问题的答案。 我们可以使用拖动方法来模拟长按视图。 示例代码如下: buttonText = 'ClMe' button = vc.findViewWithText(buttonText ) (x,y) = button.getXY() button.device.drag((x,y), (x,y), 2000, 1) 回答2 从adbclient.py : version = self.getSdkVersion() if version >= 19: cmd = 'input keyevent --longpress %s' % name if DEBUG: print >> sys.stderr, "longPress(%s

2021-10-29 12:15:49    分类:技术分享    android   testing   long-press   androidviewclient

Long press on a view using AndroidViewClient

How can I simulate long press on a view (for example a button) using AndroidViewClient? The touch method of ViewClient always performs a simple press on its input (even if I set type argument to adbClient.DOWN) Edit: The touch method in adbclient.py has a type argument, but it is not used in method body. In MonkeyRunner, when the type is DOWN, it performs longpress. def touch(self, x, y, eventType=DOWN_AND_UP): self.shell('input tap %d %d' % (x, y))

2021-10-29 09:07:45    分类:问答    android   testing   long-press   androidviewclient

androidviewclient - 无法通过端口转发连接到 vm 上的设备(androidviewclient - Can't connect to the device on vm with port forwarding)

问题 我将 vm 上的 localhost 转发到具有 80 端口(8080 ip:80)的主机,在此之前 avc 工作正常,现在连接到设备时出错: import sys import os try: sys.path.append(os.path.join(os.environ['ANDROID_VIEW_CLIENT_HOME'], 'src')) except: pass from com.dtmilano.android.viewclient import ViewClient device, serialno = ViewClient.connectToDeviceOrExit(verbose=False) def init(): global device return device 一个错误: Traceback (most recent call last): File "launcher.py", line 5, in <module> import device File "/home/test/www/ANDROID/device.py", line 11, in <module> device, serialno = ViewClient.connectToDeviceOrExit(verbose=False) File "/usr/local/lib

2021-10-25 20:40:07    分类:技术分享    android   testing   proxy   androidviewclient

androidviewclient - Can't connect to the device on vm with port forwarding

I forwarded localhost on vm to host machine with 80 port (8080 ip:80), avc works fine before that and now I have an error with connecting to the device: import sys import os try: sys.path.append(os.path.join(os.environ['ANDROID_VIEW_CLIENT_HOME'], 'src')) except: pass from com.dtmilano.android.viewclient import ViewClient device, serialno = ViewClient.connectToDeviceOrExit(verbose=False) def init(): global device return device an error: Traceback (most recent call last): File "launcher.py", line 5, in <module> import device File "/home/test/www/ANDROID/device.py", line 11, in <module> device

2021-10-25 10:07:03    分类:问答    android   testing   proxy   androidviewclient