0

I want to input values in monkeyrunner,such as input username,password to login my application.but I don't know how to do it,I just only know how to touch and press. thanks for your help.

1
  • nobody answer my question ? nobody use monkeyrunner to test application ?
    – 06peng
    Nov 10, 2011 at 9:14

2 Answers 2

1

Using device.type("Username")

device.type("password")

You can input the values in monkeyrunner. Which letter do u want to type that string u can be give as a argument of type("string").

0

There are two ways to input values using monkeyrunner.

The first is to use the press function of the MonkeyDevice class to send key event specified by type to the key specified by keycode (see http://developer.android.com/tools/help/MonkeyDevice.html#press). By this way, you can send all key events contained in Android.view.KeyEvent. For example, if you want to input the number key 8, you can use device.press('KEYCODE_8', 'DOWN_AND_UP').

However, if you just want to input strings such as a username or a password, it is convenient to use the type function such as device.type("username").

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.