How to create bot test in android - android

I want to create an application that open another application and begins to fill fields type text and select like Xmodes in games . This application is for test my application in real mode
I now i need root my divice to do this
Any help please

I don't know if this is exactly what you are looking for, but it could be helpfull.
ADB has got a command called UI/Application Exerciser Monkey.
With this command the ADB will automatically perform random click, slides, input on one of your application activity.
You can set some parameters too if you want to define which kind of input and operation should the monkeys perform.

Related

Flashing/customizing an ELO paypoint Android POS

I realize this is really open ended, but I'd like some pointers on how to get started creating a custom Android installation on this device: https://www.ebay.com/itm/403682194105
I guess I need to replace the current OS/(firmware?) on it with something stock-ish (provided by ELO? Or generically Android? I guess it's got to be from ELO for various device drivers/integration?) to start with - it's currently running something for some POS startup, which I don't have login info for, and wouldn't do what I want anyway
I'd hope to write a custom app that'd run on-boot with some basic touch/animation - maybe eventually reading some serial inputs
I'd appreciate any/all pointers to get started.

Android Espresso Test - Changing System Time Format

In my android App, there is an Activity which shows time string according to the System Time Format (12Hr. / 24Hr.).
I am writing espresso test to test this behavior whether the time displays gets changed as the System time format changes.
In order to achieve this, i want to change my System time format through my Instrumentation test for pure testing purpose. and i've added permission in test project's manifest, like this
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
and wrote the following code to change system time format
Context context = InstrumentationRegistry.getContext();
Settings.System.putString(context.getContentResolver(),Settings.System.TIME_12_24, "12");
and it is throwing Permission Denial error. (you can use below link to see the stack trace)
Error StackTrace Screenshot
i am not able to understand, since the code which is trying to change the system time format in the test project itself and it has permission to change the system time setting,
I verified Using this command
adb shell dumpsys package com.my.app.package | grep permission
Please tell me, what i am missing here ?
I've already found an explanation to your issue. Here is it:
The user application does not have permission to change the device
time. Please read the answer by cashbash in the following post
for the alternate option.
Copying here for quick reference:
According to this thread, user apps cannot set the time,
regardless of the permissions we give it. Instead, the best approach
is to make the user set the time manually. We will use:
startActivity(new Intent(android.provider.Settings.ACTION_DATE_SETTINGS));
Unfortunately, there is no way to link them directly to the time
setting (which would save them one more click). By making use of
ellapsedRealtime, we can ensure that the user sets the time correctly.
From: Set Android's date/time programmatically
Try also instead of using Espresso, use uiatomator as that instrumentation test framework can perform actions with Dialogs, Marshmallow permissions or lockscreen.
It works perfectly with Espresso.
Check this site: http://qathread.blogspot.com/2015/05/espresso-uiautomator-perfect-tandem.html
Hope it help

Using adb to launch apps - using file as input and lacking activity name?

I would like to be able to launch specific apps over adb, reading them from a file.
For example - say I wish to launch 'com.ebay.mobile'. I have a file that has simply 'com.ebay.mobile' as the contents, and I'd then like to use a batch file to launch the contents of that file, for instance filling the rest of the command.
Obviously, this runs into difficulty with the lack of an activity name, so additionally, would it also be possible for the app to launch without specifying this, so the default activity launches?
Thanks for your help!
You can use the following 2 commands (you need to use both) to run an app - if you don't specify an Activity, it will use the Main one defined in the AndroidManifest file.
adb install yourAPKFile.apk
adn run com.your.package

Recording tool for tesing android applications

Is there any application that I can use to record user activity with android applications?
I want to get the user steps when they are testing the application. Is it possible to record their steps (maybe as screenshots)?
You could use the LogCat. At every step you want to record, print something to the LogCat
Log.D("Button Press", "User touched the 'View More' button);
And then using the LogCollectors source code (http://code.google.com/p/android-log-collector/
) you can email it to yourself and conduct your analysis.
Alternatively, you could try to use monkeyrunner (http://developer.android.com/tools/help/monkeyrunner_concepts.html) and create a script that runs and takes screen shots while the user uses the application [not sure if that would work - have never used it].
I would think for the purposes of collecting data, using the logcat would be a smoother and more detailed process.

Getting debug logs - iPhone

On Android I am using the android.util.Log to log within my application and during development I am using the adb logcat or Eclipse to see the logs - I use it even more then debugging...
On device I can save the logfile from my code or use some application form Android Market to save the logs - e.g. aLogCat.
Now can I do the same on the iPhone? I can use the NSLog(#"message");, but can I easily save the log file from my application and access it? Are there any ways for that?
Regards,
STeN
This is from NSFoundation reference
NSLog:
Simply calls NSLogv, passing it a variable number of arguments.
NSLogv:
Logs an error message to the Apple System Log facility (see man 3 asl). If the STDERR_FILENO file descriptor has been redirected away from the default or is going to a tty, it will also be written there. If you want to direct output elsewhere, you need to use a custom logging facility.
Thus, it is only a matter of redirecting the file-descriptor "stderr" (2) to a custom file, and you will get everything that you print using NSLog in that file.
This seems to be exactly what you want.
Note that if you want to get logs on console when you are connected to the debugger, you can wrap your code around this to avoid redirection in this case:
if (!isatty(STDERR_FILENO)) { // Not connected to any terminal
// your redirection code
}
You can access the console log from Organizer->Device->Your device->console.
If that is not powerful enough, consider using utilities like NSLogger.
The previous answers are good; also see this if you're inclined to making system calls.

Categories

Resources