androidviewclient

AndroidViewClient: content is not allowed in trailing section

南笙酒味 提交于 2019-12-12 04:57:14
问题 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

Pressing buttons by 'text' on Android app using Culebra

…衆ロ難τιáo~ 提交于 2019-12-12 02:14:37
问题 I have a Android App that I am trying to test using culebra . The code is shown below. '''reated on 2017-02-08 by Culebra v12.5.3 __ __ __ __ / \ / \ / \ / \ ____________________/ __\/ __\/ __\/ __\_____________________________ ___________________/ /__/ /__/ /__/ /________________________________ | / \ / \ / \ / \ \___ |/ \_/ \_/ \_/ \ o \ \_____/--< @author: Diego Torres Milano @author: Jennifer E. Swofford (ascii art snake) ''' import re import sys import os from com.dtmilano.android

AndroidViewClient dump animated view

大憨熊 提交于 2019-12-12 01:53:23
问题 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? 回答1: This is a uiautomator limitation. You may try using ViewServer as the backend as it works in most cases, however you would need a rooted device or access to the application source code as described in https://github.com

Long press on a view using AndroidViewClient

和自甴很熟 提交于 2019-12-12 01:38:36
问题 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)) 回答1: I find the answer for my question

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

戏子无情 提交于 2019-12-11 18:38:08
问题 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",

How to determine whether softkeyboard is shown on the screen - while using monkeyrunner

折月煮酒 提交于 2019-12-05 03:00:14
问题 I am trying to automate few screen clicks and entries using monkeyrunner(using AndroidViewClient ) Whenever there is a edittext in the screen, the soft keyboard is popping up, and if I want to press a button though findViewById, (assuming that this particular button is behind the soft keyboard) fails. Instead of clicking this button, it clicks on some button in the soft keyboard. So as a work around I need to press back key through monkey runner, to hide the soft keyboard. My question is how

AndroidViewClient's device.touch() is much slower than MonkeyRunner's. Can it be fixed?

老子叫甜甜 提交于 2019-12-04 12:47:43
I've ditched MonkeyRunner for AndroidViewClient to benefit from its added reliability and simplicity of implementation (thank God for pure Python). I need to perform several device.touch() events as fast as possible, however AndroidViewClient seems to achieve those significantly slower than MonkeyRunner. Here's the code I used to time them both: for iteration in range(1,6): ts_start = datetime.datetime.now() device.touch(1,1,'DOWN_AND_UP') chrono = datetime.datetime.now() - ts_start print str(iteration)+': '+str(chrono) Here's MonkeyRunner's output: 1: 0:00:00.003000 2: 0:00:00.002001 3: 0:00

How to determine whether softkeyboard is shown on the screen - while using monkeyrunner

二次信任 提交于 2019-12-03 17:29:23
I am trying to automate few screen clicks and entries using monkeyrunner(using AndroidViewClient ) Whenever there is a edittext in the screen, the soft keyboard is popping up, and if I want to press a button though findViewById, (assuming that this particular button is behind the soft keyboard) fails. Instead of clicking this button, it clicks on some button in the soft keyboard. So as a work around I need to press back key through monkey runner, to hide the soft keyboard. My question is how to determine whether soft keyboard is shown in the screen or not while running from monkeyrunner. When

AndroidViewClient restarts device with every command after using “touch(x,y)” command once

放肆的年华 提交于 2019-12-02 15:03:30
问题 Using AndroidViewClient, just recently every action I try to make using Culebra or any of the associated scripts just restarts the virtual device. Has anyone ever run into this before? **edit 1: ** More specifically, I get into this endless restart loop only after trying a command where I touch the device in a specific area. i.e. If I place the following into my script, it will just restart the device and then all further Culebra generated commands will just cause the device to restart self

how to connect multiple devices using AndroidViewClient

拜拜、爱过 提交于 2019-12-01 10:55:17
i want to connect to two multiple devices (device1,device2) using AndroidViewclient for automating a test case , where i have to make a call from device1 and receive the call on device2 . Please help how to connect to two devices simultaneously . Update culebra now supports multi-device mode so the steps described in this answer are no longer necessary. Description, example and video showing the same test running concurrently on 3 different devices can be found at android: culebra multi-device capabilities . Answer As always. my recommendation is to let culebra create your script and then you