Can a runner monkey team be used in robotics?

I wrote a script in robotium, which works fine, but our application is designed in such a way that it should interact with a Native-android application that cannot be written off. I have to press a button on my native application, which cannot be done through robotics. So I wanted to know if I could add the monkey runner command to my script to click the application.

+4
source share
1 answer
solo.sendKey(20); // used for move to next object on screen // 

Follow the line above and stop when you focus on the desired button

Then do the following line, click

 solo.sendKey(66); // Click On Focused Button // 

For example, you have 3 objects on the screen:

[1] username [text box]

[2] password [text box]

[3] Submit [Button]

If you want to click the submit button using robotium then

 solo.sendKey(20);// focus on username textbox solo.sendKey(20);// focus on password textbox solo.sendKey(20);// focus on Submit button solo.sendKey(66);// Click On Submit Button 

we usually send keyevents from munkey code, so I offer you the code above.

Note:

KEYCODE_DPAD_DOWN [Constant value: 20 (0x00000014)]

KEYCODE_ENTER [Constant value: 66 (0x00000042)]

Insert from http://developer.android.com/reference/android/view/KeyEvent.html

I tested this in my automation application.

Hope this helps you, thanks.

0
source

Source: https://habr.com/ru/post/1437606/


All Articles