androidviewclient

Implement infinite scrolling in Androidviewclient

孤人 提交于 2021-02-07 10:50:20
问题 I am trying to implement Androidviewclient 5.1.1 for app which has implement scrolling of listitems. I want to scroll upto the point all the entries of the list have been finished. That is scrollable becomes FALSE. How should I proceed to do this ? Which property or ANDROIDVIEWCLIENT should I check for? 回答1: I used culebra GUI (from AndroidViewClient 9.2.1) to generate this script scrollable.py while running the Contacts app on the device. culebra -pVCLGo scrollable.py To scroll the list I

Get Current Focused Window Name using AndroidViewClient

妖精的绣舞 提交于 2020-01-21 10:25:22
问题 I am using AndroidViewClient for testing my android application. I need to access name of current focused window. How can I get it? 回答1: It's a bit tricky but can be done. The information about the windows and focus is internally maintained by the Views under some conditions. You may try something like this (choose any view you have): ... vc = ViewClient(device, serialno, **kwargs2) vc.dump(window='-1') no_id1 = vc.findViewByIdOrRaise("id/no_id/1") no_id1.useUiAutomator = False # this forces

How can i get the status of check box

99封情书 提交于 2020-01-16 18:30:41
问题 I am trying to get the status of Checkbox using androidviewclient lock = vc.findViewWithText('Lock SIM card') if (lock.isChecked()): print "Enabled" else: print "Disabled" this always returns False . can anybody tell me how to get the status of checkbox 回答1: That's because lock is not the ckeckbox. Lock is the text view containing "Lock SIM card". You need to use hierarchyviewer or uiautomatorviewer to see the layout of the UI. The UI looks something like: (0) Linear layout (1) Relative

Delay between “type” commands in AdbClient (which doesn't exist in monkeyrunner)

ⅰ亾dé卋堺 提交于 2020-01-06 20:38:13
问题 I am making a switch from monkeyrunner to AndroidViewClient. It is nice because it is all Python. However, when issuing type or press commands, the lag between each command is like one second: import sys import os import time try: sys.path.append(os.path.join(os.environ['ANDROID_VIEW_CLIENT_HOME'], 'src')) except: pass from com.dtmilano.android.adb.adbclient import AdbClient, Device device.type("hello") # type a space device.press('KEYCODE_SPACE', 'DOWN_AND_UP') device.type("world") The above

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

时光怂恿深爱的人放手 提交于 2019-12-25 07:16:07
问题 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

Python - AndroidViewClient take snapshots in high FPS

这一生的挚爱 提交于 2019-12-25 04:11:51
问题 I wanted to take snapshots of my device in 60 FPS using AndroidViewClient on Python, so I used the function device.takeSnapshot(reconnect=True) in a loop to do so. However, it appeared that the time consumption of this function is around 0.5 seconds which gives me 2 FPS. I think the re-connection is what it makes it long. So why the device disconnects automatically after taking one snapshot? Is there a way to keep the connection on? Is there any other way to improve time consumption and get

Waiting for a specific view on androidviewclient

Deadly 提交于 2019-12-24 10:46:33
问题 I am using androidviewclient from dtmilano and it works great. I need to know how do I wait for a specific view to appear on the screen and then take an action ? I am using getandroidview() but not able to understand its correct implementation. Please help me regarding this. 回答1: The simplest way would be: ... while True: vc.dump() if vc.findViewWithText('Hello World!'): # do something pass else: time.sleep(5) 来源: https://stackoverflow.com/questions/25729366/waiting-for-a-specific-view-on

Touch, swipe or drag events emulating on Android not working

笑着哭i 提交于 2019-12-22 09:24:42
问题 After reading posts I figured out how to emulate a touch event : adb shell input tap 100 100 I've installed MagicMarker in order to see if anything is drawn, nothing appears. I've also tried with monkeyrunner/androidViewClient Touch functions : device.touch(100 , 100, 'DOWN_AND_UP'); My whole code for AndroidViewClient : #! /usr/bin/env python # -*- coding: utf-8 -*- import getopt, sys import os # Add android to path becayuse it seems to not appear on windows sys.path.append("D:/Dev/adt

how to connect multiple devices using AndroidViewClient

你离开我真会死。 提交于 2019-12-19 10:26:25
问题 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 . 回答1: 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

Integrating Monkeyrunner with UI Automator

坚强是说给别人听的谎言 提交于 2019-12-13 19:12:57
问题 Is it possible to integrate monkey runner with UI Automator. I have imported the Monkeyrunner jar in UI Automator project.But when I run ant build Build Fails as it does not recognise any of the Classes. Is their any other method to recognise Monkeyrunner classes in UI Automator Java Project Thanks in Advance 回答1: AndroidViewClient supports UiAutomator if present in the device. The details can be seen on this post: http://dtmilano.blogspot.ca/2012/11/androidviewclient-uiautomator-support.html