0

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?

go_easy
  • 3
  • 2

1 Answers1

0

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

Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134
  • Hey Diego I do have androidviewclient, I followed your wiki for installing it and as you see above set the environment variable for ANDROID_VIEW_CLIENT_HOME. I don't understand what I'm missing, why can't I compile the python script CulebraTester generated? What will fix the error: "ImportError: No module named com.dtmilano.android.viewclient"? Thanks. – go_easy Dec 04 '17 at 23:46
  • Did you install with `easy_install`? – Diego Torres Milano Dec 05 '17 at 03:38
  • Are you using Linux? – Diego Torres Milano Dec 05 '17 at 03:38
  • I'm on a Mac. I used easy_install and to check I ran "sudo easy_install --upgrade androidviewclient," and it said, "androidviewclient 13.5.2 is already the active version in easy-install.pth." I ran the check-import.py in your examples and received an "OK" and that's weird because line 35-39 are importing the things that are giving me an error in my generated python file. I'm sorry if I'm missing something obvious. – go_easy Dec 05 '17 at 16:19
  • I found the issue; I was running the python script through Sublime Text. If I run the command "python2 /path/to/file.py" the script works as expected, sorry for wasting time on this silly mistake. I assume Sublime Text was defaulting to python3. – go_easy Dec 05 '17 at 20:22