GUI for UIautomator - android

I set up the automator and implemented some test cases.
I can run it via adb comandline instruction. But is there a way to run it directly in the Eclipse environment?
Like JUnit test cases?

As standard, UI Automator tests are compiled and built into a jar file, on a desktop computer, they are then deployed to the device by pushing the jar file to the device using adb. They are then run on the device, in the Android runtime by using adb shell uiautomator
I have not seen anyone else trying to run the test cases directly on the device rather than building them following the approach Google (Android) document. It might be possible, however you may have to work hard to discover whether your approach is possible or viable. UIAutomator is distinct and separate from the Android InstrumentationTestCase framework. Instead it interacts with the GUI and has the advantage of being able to interact with a wide range of apps, including things like the inbuilt Settings UI on Android devices.

Related

Run a test with real BLE device

I have Android application which communicates with device using BLE. I want to cover BLE logic with tests.
Is it possible to run unit tests (or maybe instrumentation tests) with real BLE device on real Android device?
Using only Android instrumented tests? I don't see a way of doing that.
Using external elements?
Yes, it is possible, but you need to implement your own 'framework'. I mean you need a way to control the BLE device, a library on CLI for example, this would be done outside the Android instrumentation test so you would integrate the framework to instrumented tests.

Recording on the Mac machine Android scripts for appium and run them on the Windows machine using Appium

Since Appium's inspector is not conducive recording scripts on Windows, I am using AppiumForWindows coupled with uiautomatorviewer from SDK time to identify app objects and actions to send. I know that we can easily use recording option on Mac in order to record the flow and run it on Mac using appium.
However, I wanted to know if i can switch to Mac just for recording my android app script on the Mac machine and go then to my favourite windows machine for running them using appium? I cannot test now because I have not Mac yet. I told myself that it is possible because of the use of java language (multi-platform) and the fact that Appium provides a standard API both Android and iOS for automation but at the same time, I have doubts because of that answer, I have found on line at https://discuss.appium.io/t/can-we-record-the-script-on-mac-machine-using-appium-tool-and-re-run-the-recorded-script-on-android-or-window-phone-using-appium/5938
I want to decide myself finally. Please i want to know what you think about.
Yes and No, Appium api's are cross platform compatible, however the id's and paths which you use to locate the object under test in both platforms are different, which could cause the script to not work.
I have not used the recorder as such, however if both apps are exactly similar, one could create same test case, with maximum reusable in locating an object by accesibility tag (provided both are kept the same).

How to record touches and emulate them later on real devices (with ROOT if needed)?

Background
the monkeyRunner (and monkey) is a nice tool to test out apps.
I have an idea of using it (or something similar) to record & emulate touches (and keys).
The problem
The tool itself has some disadvantages:
needs to be run on an emulator or on a device that is connected to a PC.
needs adb.
it needs that you type it exactly what to do , which requires a lot of patience and trial&error in order to find out what to write.
has limitations on how many devices to run (since it needs to be connected to a PC).
needs customization of each device (where to put the touches, for example).
not intuitive, especially for QA teams.
The question
Is it possible to use this tool in order to record touches (and keys) and later emulate them, even without using a computer? Maybe using a rooted device?
There are some advantages to having this ability:
It can help running tests on the go, and help QA teams to do tests in an easier way. You could have a tool that help you record macros for tests that will run on each new version, and some tests that are a bit random, ...
It can help making cool apps for power users, for example in order to help other people, remote control, macros,...
since you don't have to connect the device to the computer, you can run the macros on your app on multiple devices simultaneously .

Python and Android

This link says that it is indeed possible to write code in Python and use it for app development in android platform. I would like to know what the catch is when using Python and not Java. Is there any compromise being made in speed of execution or size?
From the link you posted:
Scripts can be run interactively in a terminal, in the background, or via Locale.
This already is a disadvantage, as you can't release your Apps to Android Market easily. This can however ostensibly be avoided by the build script of Pygame Subset for Android, but I am not sure about this. The Python interpreter will however need to be installed on the device, which will bloat the App's size by quite a bit.
The speed of execution of Python on an Android device of course is slower than Java, as Python doesn't magically accelerate just because it runs on a phone. The difference isn't that great in most situations, though.

What exactly is a monkey doing messing with my Android phone?

Looking through the Android apis I found a method call isUserAMonkey(),
says it returns true if the phone is being messed with by a monkey.
Is this a joke, or what is it used for?
Look at monkeyrunner, it will give you the answer.
Quote from the document:
The monkeyrunner tool provides an API for writing programs that
control an Android device or emulator from outside of Android code.
With monkeyrunner, you can write a Python program that installs an
Android application or test package, runs it, sends keystrokes to it,
takes screenshots of its user interface, and stores screenshots on the
workstation. The monkeyrunner tool is primarily designed to test
applications and devices at the functional/framework level and for
running unit test suites, but you are free to use it for other
purposes.
So if you are running a package using Monkeyrunner, then this function will return true.

Categories

Resources