AndroidViewClient | Android ViewServer and ADB client | Automation library

 by   dtmilano Python Version: 23.4.0 License: Apache-2.0

kandi X-RAY | AndroidViewClient Summary

kandi X-RAY | AndroidViewClient Summary

AndroidViewClient is a Python library typically used in Automation, Selenium applications. AndroidViewClient has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can install using 'pip install AndroidViewClient' or download it from GitHub, PyPI.

as a pure python tool that automates or simplifies test script creation. It is a test framework for Android applications that: Automates driving Android applications Generates re-usable scripts Provides view-based device independent UI interaction Uses logical screen comparison (UI Automator Hierarchy based) over image comparison (Avoiding extraneous detail issues, such as time or data changes) Supports running on multiple devices Provides simple control for high level operations like language change and activity start Supports all Android APIs Is written in python (python 3.6+ support in 20.x.y+) . |A new Kotlin backend is under development to provide more functionality and improve performance.Take a look at [CulebraTester2] and 20.x.y-series prerelease. | ---|----------------------------------------------------------------------------------------------|.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              AndroidViewClient has a medium active ecosystem.
              It has 1422 star(s) with 331 fork(s). There are 77 watchers for this library.
              There were 5 major release(s) in the last 12 months.
              There are 50 open issues and 165 have been closed. On average issues are closed in 815 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of AndroidViewClient is 23.4.0

            kandi-Quality Quality

              AndroidViewClient has 0 bugs and 0 code smells.

            kandi-Security Security

              AndroidViewClient has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              AndroidViewClient code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              AndroidViewClient is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              AndroidViewClient releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              AndroidViewClient saves you 49500 person hours of effort in developing the same functionality from scratch.
              It has 57833 lines of code, 793 functions and 196 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed AndroidViewClient and discovered the below as its top functions. This is intended to give you an instant insight into AndroidViewClient implemented functionality, and help decide if they suit your requirements.
            • Change language
            • Finds the view with the given content description
            • Open quick settings
            • Finds and raises ViewNotFoundException
            • Finds view with the given text property
            • Opens the Quick Settings bar
            • Dump window hierarchy
            • List windows
            • Traverses the root node
            • Connect to adb
            • Get the SDK version
            • Close the socket
            • Mouse button event handler
            • Writes the image to a file
            • Creates the keycode tab
            • Populates the tree tree
            • List all windows
            • Finds a view by ID or raises ViewNotFoundException
            • Performs a drag operation
            • Finds view with the specified text property
            • Creates the keyboard tab
            • Parse command line
            • Start the test
            • Initializes an element
            • Traverses the root of the view
            • Initialize the devices
            • Event handler
            • Plot the histogram
            • Save image to file
            • Take a snapshot
            Get all kandi verified functions for this library.

            AndroidViewClient Key Features

            No Key Features are available at this moment for AndroidViewClient.

            AndroidViewClient Examples and Code Snippets

            No Code Snippets are available at this moment for AndroidViewClient.

            Community Discussions

            QUESTION

            Why is Android View Client returning the view above the view I'm trying to select?
            Asked 2019-Aug-20 at 06:15

            (Edit: the following problem only seems to occur on my Samsung S10e. I just got home and tried Android View Client on a Pixel phone and I'm not having any problem.)

            I'm automating the input process for a jetlag calculator android app Entrain. Using the culebra tool, I can find each of the views on the screen. But when I use the ViewClient.touch() method on a view, the program touches the view immediately above it on the screen.

            For example, culebra lists these 2 views as the last views on the main menu of the app:

            ...

            ANSWER

            Answered 2019-Aug-20 at 06:15

            Unfortunately, I don't have a Samsung S10e to test.

            Nonetheless, you may find these tricks useful (I used a Pixel).

            The bounds of the views can be obtained running

            Source https://stackoverflow.com/questions/57540837

            QUESTION

            How can I get text if I have x,y coordinates using Androidviewclient
            Asked 2018-Sep-28 at 05:19

            I have x = 402 and y=201 I need to get text available at that specified coordinates using Androidviewclient can anyone help in solving this issue

            ...

            ANSWER

            Answered 2018-Sep-28 at 05:19

            ViewClient.findViewsContainingPoint() method does exactly that, given a Point returns the list of Views containing such Point, which could be more than one.

            Then, you can get the text or any other View attribute.

            culebra can create a template script for you and then you can edit it and add what you need.

            For your case something like this

            Source https://stackoverflow.com/questions/52494401

            QUESTION

            AndroidViewClient - How to get notified when the Android Virtual Device start process is completed?
            Asked 2018-Sep-13 at 05:55

            I use AndroidViewClient in order to use MonkeyRunner through Python. I need to start the AVD programmatically and get notified when the AVD start process is completed. How can I catch that event? The execution just does not reach the line after the subprocess.run() function.

            Here is how I start my AVD:

            ...

            ANSWER

            Answered 2018-Sep-13 at 05:55

            You can detect that the AVD is ready using

            Source https://stackoverflow.com/questions/52286619

            QUESTION

            How to make multi-devices dump with AndroidViewClient/dump command?
            Asked 2018-Jun-28 at 06:04

            I'd like to compare the screen of my devices (many) so I'm using AndroidViewClient tool to get the hierarchy of my screens with the dump command in a terminal.

            However, my devices are all linked with my computer at the same time, and the dump command seem to work on only one device. So when I use the command, I get the dump of the first device in the device list when I use adb devices.

            My goal is to compare screens. So what I want is to specify which device I want to use for my dump in the terminal (and then doing it for all my devices to compare).

            Is there a solution of this ? because the only solution I found yet is to make an adb -s [device serial_number] shell uiautomator dump, which offer the possibility to chose which device we want to use among those who are attached, but it produce an xml file (and this is why I need AndroidViewClient's dump, because I don't want the xml file).

            In other words, is there a way to specify a device with the dump command in a terminal without disconnecting my USBs successively (keep only one device connected at the same time) ?

            Thank you very much in advance !

            ...

            ANSWER

            Answered 2018-Jun-28 at 06:04

            If I understand correctly, you want to dump different devices that are already available through adb.

            Getting help you can see that dump accepts an optional command line parameter which is the serialno

            Source https://stackoverflow.com/questions/51043571

            QUESTION

            AndroidViewClient get id's from WebView
            Asked 2018-Jun-12 at 03:50

            I have Samsung Android 4.3 API 18 and using AndroidViewClient, the dump produces only android.webkit.WebView therefore it's not possible to get all the id's within this page. How Can I use Culebra to record the actions in the web page ?

            ...

            ANSWER

            Answered 2018-Jun-12 at 03:50

            This page shows how the elements inside the WebView are listed.

            To do it you have to use AndroidViewClient with culebra backend, as the dump produced by uiautomator does not include them.

            Source https://stackoverflow.com/questions/50771882

            QUESTION

            How to Run Code on Android Generated by AndoirdViewClient?
            Asked 2017-Dec-05 at 20:23

            Through the CulebraTester application on my device, I generated some python to simply open the settings application. When I went to run the script, I was greeted with

            pkg_resources.DistributionNotFound: The 'androidviewclient<12.4.0' distribution was not found and is required by the application

            So then I realized that I didn't have the environment variable set, so I downloaded the project from Github and ran the command

            export ANDROID_VIEW_CLIENT_HOME=/path/to/androidviewclient/

            I'm confident I did this correctly because I can cd to $ANDROID_VIEW_CLIENT_HOME and view the contents. Now when I go back to run the script this same error appears, so I commented out pkg_resources.require('androidviewclient>=12.4.0') and was then presented with this error

            ImportError: No module named com.dtmilano.android.viewclient

            Right now I'm clueless about what to do, I tried googling, but I've found nothing to fix the problem. Some-what related I saw a video on youtube where curl was used to run javascript generated by CulebraTester so maybe the same can be done with Python?

            ...

            ANSWER

            Answered 2017-Dec-04 at 21:04

            CulebraTester can generate tests in a variety of languages:

            • Python
            • Java
            • Kotlin
            • Javascript
            • etc.

            see Code-Generation-language for details.

            Each language has its own dependencies in order to run, for example, if you generate UiAutomator tests in Java you will need the corresponding dependencies in your build.gradle.

            In your specific case, as you have generated Python tests you need androidviewclient. To install it, follow the instructions on AndroidViewClient: Installation

            Source https://stackoverflow.com/questions/47640787

            QUESTION

            Culebra in AndroidViewClient returns "RuntimeError: ERROR: Connecting to
            Asked 2017-Nov-16 at 07:55

            Trying to use any culebra (AndroidViewClient) command returns following error:

            $culebra -G

            Traceback (most recent call last): File "/usr/local/bin/culebra", line 4, in import('pkg_resources').run_script('androidviewclient==13.5.0', 'culebra') File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 739, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1494, in run_script exec(code, namespace, namespace) File "/usr/local/lib/python2.7/dist-packages/androidviewclient-13.5.0-py2.7.egg/EGG-INFO/scripts/culebra", line 1168, in device, serialno = ViewClient.connectToDeviceOrExit(serialno=serialno, **kwargs1) File "/usr/local/lib/python2.7/dist-packages/androidviewclient-13.5.0-py2.7.egg/com/dtmilano/android/viewclient.py", line 2697, in connectToDeviceOrExit device = adbclient.AdbClient(serialno, ignoreversioncheck=ignoreversioncheck, timeout=timeout) File "/usr/local/lib/python2.7/dist-packages/androidviewclient-13.5.0-py2.7.egg/com/dtmilano/android/adb/adbclient.py", line 179, in init self.socket = AdbClient.connect(self.hostname, self.port, self.timeout) File "/usr/local/lib/python2.7/dist-packages/androidviewclient-13.5.0-py2.7.egg/com/dtmilano/android/adb/adbclient.py", line 252, in connect raise RuntimeError("ERROR: Connecting to %s:%d: %s.\nIs adb running on your computer?" % (s, port, ex)) RuntimeError: ERROR: Connecting to :5037: [Errno 111] Connection refused. Is adb running on your computer?

            Adb is debinitely running; "adb devices" lists connected device; "adb push", "adb pull","adb shell", all work fine.

            Opening firewall, setting path, reinstalling AndroidViewClient, updating software make no difference.

            A previous post "[androidviewclient - Can't connect to the device on vm with port forwarding][1]" concerns very similar error.

            His solution (below) does not work for me:

            Blockquote

            Solved - I changed localhost back to 127.0.0.1 in hosts file and it solves an issue...

            Blockquote

            Any ideas?

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

            ...

            ANSWER

            Answered 2017-Nov-16 at 07:55

            Setting default from JDK 1.7 to JDK 1.8 solved this problem. Still getting an error message ("...there are no connected devices"), however since adb devices lists the phone, shouldn't be hard to figure out.

            Marking this question solved

            Source https://stackoverflow.com/questions/47303622

            QUESTION

            Is ViewClient invalid if new Activity is started?
            Asked 2017-Jul-28 at 17:19

            I have an AndroidViewClient script that is testing an activity. Clicking a button in my android app creates a new Activity instance. It seems like the ViewClient instance in my python script needs to be recreated after the new activity is launched - is that right? Something like this:

            ...

            ANSWER

            Answered 2017-Jul-28 at 17:19

            No, there's no need to create a new instance, all you have to do every time the screen changes (whether it's a new Activity or the same one) is to call

            Source https://stackoverflow.com/questions/45364127

            QUESTION

            Get current activity name and package?
            Asked 2017-Jul-18 at 18:15

            I have a button which launches a new Activity. Is there an API in AndroidViewClient to get the package and name of the current activity? Something like:

            ...

            ANSWER

            Answered 2017-Jul-18 at 18:15

            This prints the top Activity and package

            Source https://stackoverflow.com/questions/45155603

            QUESTION

            Where can I find AndroidViewClient documentation?
            Asked 2017-Jun-13 at 21:27

            Is there any documentation on AndroidViewClient covering public classes, methods, and syntax?

            ...

            ANSWER

            Answered 2017-Jun-13 at 21:27

            It is in the doc directory of the project.

            You have to clone or download the project to view it properly in your browser as github's web interface will show the source code instead.

            UPDATE

            jthurner found a way, I didn't know existed, of showing the docs over github pages. You can now view the documentation online at API Documentation.

            Source https://stackoverflow.com/questions/44072353

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install AndroidViewClient

            You can install using 'pip install AndroidViewClient' or download it from GitHub, PyPI.
            You can use AndroidViewClient like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install androidviewclient

          • CLONE
          • HTTPS

            https://github.com/dtmilano/AndroidViewClient.git

          • CLI

            gh repo clone dtmilano/AndroidViewClient

          • sshUrl

            git@github.com:dtmilano/AndroidViewClient.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link