Giter Site home page Giter Site logo

culebratester2-public's Introduction

CulebraTester2-public

CulebraTester: Snaky Android Testing

Welcome to CulebraTester2.

Android testing can be complicated, time-consuming, and tedious. What if it didn’t have to be?

CulebraTester2 provides an API that facilitates the creation of tests and test automation tools and UI's. Not sure what we mean?

Continue reading and see how you can run this early preview.

⚠️ Warning
This is an alpha version of CulebraTester2 expect changes

How to run CulebraTester2 ?

  1. Have your device or emulator connected to adb
  2. Install APKs
    1. Downalod prebuilt app and instrumentation APKs from Github Actions
    2. or build from source and install
      1. Copy local.properties.SAMPLE to local.properties and adapt the values to your environment
      2. ./culebratester2 install (or run ./gradlew installDebug installDebugAndroidTest)
  3. Start server bash <(curl -sL https://git.io/JT5nc) start-server
    1. alternative if you checked out the source you can run ./culebratester2 start-server instead
  4. Open http://localhost:9987/ with a browser or curl
  5. You should see CulebraTester2: Go to http://localhost:<port>/help for usage details.
  6. If the previous request worked, you can try something more ambitious as http://localhost:9987/v2/uiDevice/screenshot
  7. Take a look at CulebraTester2 API or its spec openapi.yaml for more info
  8. When done testing, http://localhost:9987/quit will terminate the server

Want to learn more?

Detailed information can be found in the CulebraTester2 wiki wiki

AndroidViewClient

CulebraTester2 is a new backend for AndroidViewClient/culebra.

It can be used like other backends, in this case you have to specify the command option

-h, --use-uiautomator-helper     use UiAutomatorHelper Android app

for example

$ dump -ah emulator-5554 | jq
⚠️ CulebraTester2 server should have been started and port redirected.
{
  "id": "hierarchy",
  "text": "Window Hierarchy",
  "timestamp": "2020-10-12T02:18:45.639Z",
  "children": [
    {
      "id": 0,
      "parent": -1,
      "text": "",
      "package": "com.android.systemui",
      "checkable": false,
      "clickable": false,
      "index": 0,
      "content_description": "",
      "focusable": false,
    ...

or set useuiautomatorhelper=True when you create a ViewClient object.

culebra

CulebraTester2 is a new implementation in Kotlin of culebra.

A python client implementation can be found at CulebraTester2-client.

This previous version API specification can be found at here.

Example

The script simple-calculator-test shows a rudimentary usage of this API by

  • starting Calculator activity
  • finding one of the digit Buttons, can be specified or a random one is slected
  • clicking on that Button

UI

We mentioned CulebraTester2 provides an API that facilitates the creation of test automation tools and UI's.

Here we are, this is in the making.

CulebraTester2-ui preview

Communication

Found issues? Use https://github.com/dtmilano/CulebraTester2-public/issues

Have questions? Use https://stackoverflow.com/questions/tagged/androidviewclient.

culebratester2-public's People

Contributors

dtmilano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

culebratester2-public's Issues

Does it works on windows os?

When I try to run server, I get this error:

'android-select-device' is missing.

or I'm doing something wrong?

Server-start error

bash <(curl -sL https://git.io/JT5nc) start-server
Security exception: Package com.dtmilano.android.culebratester2 has not requested permission android.permission.CHANGE_CONFIGURATION

java.lang.SecurityException: Package com.dtmilano.android.culebratester2 has not requested permission android.permission.CHANGE_CONFIGURATION
at com.android.server.pm.permission.BasePermission.enforceDeclaredUsedAndRuntimeOrDevelopment(BasePermission.java:379)
at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:1410)
at com.android.server.pm.permission.PermissionManagerService.access$900(PermissionManagerService.java:89)
at com.android.server.pm.permission.PermissionManagerService$PermissionManagerInternalImpl.grantRuntimePermission(PermissionManagerService.java:2099)
at com.android.server.pm.PackageManagerService.grantRuntimePermission(PackageManagerService.java:5421)
at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:1836)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:238)
at android.os.ShellCommand.exec(ShellCommand.java:103)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:21339)
at android.os.Binder.shellCommand(Binder.java:634)
at android.os.Binder.onTransact(Binder.java:532)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2807)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:3866)
at android.os.Binder.execTransact(Binder.java:731)

Dump via adb

Could you add the possibility to dump window via adb shell command like adb shell uiautomator dump?

<node NAF="true" ...

Sometimes culebra can't find the button even though it exists. If I close the apk and open it again culebra finds the button and shows NAF param inside the node like <node NAF="true" index="1" text="" resource-id="... />
Why is this happening?

Wildcards on Text Selector for findObjects

Using the example code

oid=$(do_curl -f -X POST "${base_url}/uiDevice/findObject" \ -d "{'text':'${label}'}" | jq .oid)

is there a way that text: could use wildcard / partial match ?

Thanks

install error

Hi, I met a problem that when the android device connect by wireless network,The screenshot function seems cannot be use.do you have any solution for that?

Stuck the start server

Hi

I am developing a POC with CulberaTester2 for the kotlin apps. When I try to run the server on the emulator it is stuck at

image

Can you please help?

How to perform scroll action

In the provided API document, I can only find ways to perform click and long-click. How can I scroll or swipe on a view?

Question regarding CulebraTester2 UI beta availability

I apologize as this is not an issue so much as a question.

At the bottom of the readme you show a video of what looks like a fantastic viewer too that would work with your software stack.
https://www.youtube.com/watch?v=prE0aKoMLfc

I had been trying to automate an app with Appium but the rapid updates meant that I wasn't able to view the structure using uiautomatorviewer, or click on buttons due to the continuous stream of "Accessibility Events".

https://stackoverflow.com/questions/70670116/android-get-current-ui-layout-without-uiautomator

I have managed to get down your tools and can successfully dump the structure and I am hoping to move over from uiautomatorviewer and Appium to using your tool-sets. I haven't attempted to actually perform any automation tasks with https://github.com/dtmilano/CulebraTester2-client just yet but will do shortly.

I am curious though where the CulebraTester2 UI beta can be downloaded from (if it is available). It's a little difficult for me to find the correspond buttons for the app I'm working on. So having a UI like this is pretty much essential. If you have any details about it's availability I would very much appreciate hearing from you.

Unable to start the server

ERROR: Missing "android-select-device". Install from https://gist.github.com/dtmilano/4537110

Could you kindly tell me what do this mean? I tried to download and run the link's script, but then it required me to type in the adb server ip. I tired serval ip addresses but none of them work.

Is there any step that I am missing? I have followed the steps in wiki/Start-server' one by one already. Thanks a lot for the help!

Below are the steps that I have done:

  1. adb devices
  2. bash ./culebratester2 start-server --local-port 5037

Error msg:
./culebratester2: line 140: tput: command not found
./culebratester2: line 141: tput: command not found
./culebratester2: line 142: tput: command not found
./culebratester2: line 143: tput: command not found
⛔️ ERROR: Missing "android-select-device". Install from https://gist.github.com/dtmilano/4537110

PS. I have already install the app and instrument apks in the phone and opened the app

Big delay

When I try start an activity of some app and immediately curl dumpWindowHierarchy the command is executed for about three seconds (intent started in about one second). All other cases with dump executed very fast. Why?

Unable to download artifact.

Sorry for being dumb, after 20 minutes I still cant figure out why cant I download the pre-built APK.

The builded file is not clickable(it should be, right?)

I also saw an issue about the artifact will expire? it's related?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.