How to enter values to a text field using monkeyrunner - monkeyrunner

I am trying to enter some text to a text field in my android application using Monkeyrunner.
I wrote the code like this:
device.press('KEYCODE_BUTTON_SELECT',MonkeyDevice.DOWN_AND_UP)
device.press('KEYCODE_U','DOWN_AND_UP')
device.press('KEYCODE_S','DOWN_AND_UP')
device.press('KEYCODE_E','DOWN_AND_UP')
device.press('KEYCODE_R','DOWN_AND_UP')
while running the first line,the text field is getting selected.But The string "user" is not typing there.But the same code i can run out of my application ,In the android native search field i can enter "user" string using this code. I tried the same with device.type('USER') command also.That is also not working
If i am using this code
device.press ('KEYCODE_DPAD_CENTER', MonkeyDevice.DOWN_AND_UP)
It is taping one center button. (In my application page one button is there in the middle of the page.)

Try the following code. It's working in my case:
device.touch(x, y, MonkeyDevice.DOWN_AND_UP)
MonkeyRunner.sleep(1)
device.type('USER')
In the command touch put the coordinates of your edittext instead of x and y

One of the challenges would be to find the coordinates to touch, mainly using different screen sizes and configurations.
AndroidViewClient can help in this respect and you can avoid having to provide the coordinates for the Views and you can simply do:
subject = vc.findViewByIdOrRaise('id/subject')
subject.touch()
subject.type('AVCSample')
this lines were taken from one of the AVC examples: email-send.py

Do you have space character as part of the text you're trying to enter? Try without space and see if that works. Then, you can figure out how to deal with space.

Related

Code Composer Studio MSPFR6989 variables&expressions won’t come up

I am using CCS to program a MSPFR6989 and I’ve debugged and the code is working but I can’t get variables or registers to come up. It remains blank. enter image description here
use double click onto your variables and choose watch expression. You can find your variables under expression from now. If it shows you its name but a red error message try step by step debugging, works for me everytime.

How to clear a text field using Robot Framework?

I'm using the Sikuli Library with Robot Framework to run tests for a local windows application. Most solutions online are selenium based but I believe that only to work for web applications.
Entering text has been fine for the empty fields when there isn't a default value concerned.
Currently, I'm dealing with a field that contains a default value of 5000 but I need to change it to 10.
Text Field:
So far I've tried things such as:
Double-clicking the field first to highlight then type over (Input Text single clicks and removes highlight anyway)
Single-Clicking as Input text single clicks itself (Does not happen fast enough to simulate a double click)
I will answer in Sikuli terms. You just execute Ctrl+a to select content of the cell and then type 10
type('a', KeyModifier.CTRL)
type('10)

How do you flip whole Docs horizontally 180* with the CSS command rotateY(180deg)?

I can get basic html text to flip 180*, but I'd like to know how to get a whole Doc in my Drive file to flip using a standalone script (so I can do it repeatedly). I'm aware I can get a doc, open the scripts editor and then use my flippin' project to flip the doc I called, but I don't know what the syntax looks like. My first flippin' success was pasting text into the .html file as simply as possible and using:
function doGet() {
return HtmlService.createHtmlOutputFromFile('Page');
getContent()
}
I just test ran it from the dialog box as a web app. But I'm interested in building this one command feature out into several different domains to get experience with the variety of possibilities available in GAS. Anyone care to tutor me? Please?!...

Open-Atrium Toolbar

I have two blue prints for the space content type in OA. On the toolbar dropdown i want to show only the spaces created using the default blue print. AO uses the oa_core_get_groups_by_user_access(found in OA core module in the oa_core.util.inc file) to pull all spaces a use subscribed to. I want to alter this function to show only spaces created using the default blue print by altering the query used in this function.
All my attempts to do so have failed probably because i don't understand the drupal database abstraction queries. Can someone help me with the piece of code i can add to this function to achieve this functionality.
Finally got it. To show only the default spaces in the dropdown, you have to make changes to the oa_core_get_titles function in the oa_core_util.inc file of oa_core.
Add the following line below line 641 of that particular file.
$query->leftJoin('field_data_field_oa_space_type','t','n.nid=t.entity_id');
$query->condition('t.field_oa_space_type_tid',1);
This filters out only spaces created using the default space.

Visual FoxPro 9 Grid: how to simulate down arrow with a barcode reader

I have a grid in Visual FoxPro where my customer will use an Motorola CS3000 SERIES
Barcode Reader. The problem is the grid, if you simulate the Enter key (CHR(13)), is going to the next field on the same row and not make a new line.
The only way is to press the down arrow (which it seems impossible), and already tried with Vertical Tab, with Line Feed / carriage return, and with ALT+025 (Down Arrow character) with no luck.
Do you have idea?
Thank you.
I understand than the Barcode reader simulate an Enter but not a keyboard command (DNARROW), isn't it?
So that the solution should be picking the key pressed from the form, I thing there is s "keypress" form event, in that event you can put the code for skipping to the next record.

Resources