I am using culebra concertina mode inside AndroidViewClient to run automatic GUI tests with app. But what I am seeing is this tool sometimes presses home button and my app exits and thus no longer tests my app. Is there anything in this tool to restrict GUI execution to the currently shown app only ?
1 Answers
If you only want to remove HOME from the randomly pressed buttons you can change this line (you have to use the source code instead of the package) in culebron.py
if rand > 0.85:
# Send key events
k = random.choice(['ENTER', 'BACK', 'HOME', 'MENU'])
and remove the keys you don't want.
I will try to find a better way (perhaps providing a configuration file of the events and frequencies) that could be included in culebra
command line.
EDIT
Latest AndroidViewClient/culebra version 14.0.0 introduces concertina configuration via a JSON file, so now you can define the events together with their probabilities. Still not covering all the events and cases but the one you mentioned is supported.
Upgrade to the latest version and create a configuration file like this
{
"probabilities": {
"systemKeys": 0.5,
"other": 0.5
},
"systemKeys": {
"keys": [
"ENTER",
"BACK",
"HOME",
"MENU"
],
"probabilities": [
0.33,
0.33,
0,
0.34
]
}
}
which will block the HOME key event completely and also will use half (0.5) of the generated events as system keys.
Then, invoke culebra
using this file
$ culebra --gui --concertina --concertina-config=/path/to/myconf.json --scale=0.2

- 65,697
- 9
- 111
- 134
-
How to run from sourcecode ? When I run `~/AndroidViewClient-13.6.3/src/com/dtmilano/android$ python culebron.py --gui --concertina --scale=0.2 ` it runs nothing and the command terminates without doing anything. – rainyday Mar 21 '18 at 09:18