日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

Android自動(dòng)化測(cè)試之MonkeyRunner之MonkeyRunner(九)

 WindySky 2016-03-14

Android自動(dòng)化測(cè)試之MonkeyRunner之MonkeyRunner

A monkeyrunner class that contains static utility methods.

Summary


Methods
void alert(string message,string title,string okTitle)
Displays an alert dialog to the process running the current program.
integer choice(string message,iterable choices,string title)
Displays a dialog with a list of choices to the process running the current program.
void help(string format)
Displays the monkeyrunner API reference in a style similar to that of Python'spydoc tool, using the specified format.
string input(string message,string initialValue,string title,string okTitle,string cancelTitle)
Displays a dialog that accepts input.
void sleep(float seconds)
Pauses the current program for the specified number of seconds.
MonkeyDevice waitForConnection(float timeout,string deviceId)
Tries to make a connection between the monkeyrunner backend and the specified device or emulator.

Public Methods


string alert(string message,string title,string okTitle)

Displays an alert dialog to the process running the current program. The dialog is modal, so the program pauses until the user clicks the dialog's button.

Arguments
message The message to display in the dialog.
title The dialog's title. The default value is "Alert".
okTitle The text displayed in the dialog button. The default value is "OK".

integer choice(string message,iterable choices,string title)

Displays a dialog with a list of choices to the process running the current program. The dialog is modal, so the program pauses until the user clicks one of the dialog's buttons.

Arguments
message The prompt message displayed in the dialog.
choices A Python iterable containing one or more objects that are displayed as strings. The recommended form is an array of strings.
title The dialog's title. The default is "Input".
Returns
  • If the user makes a selection and clicks the "OK" button, the method returns the 0-based index of the selection within the iterable. If the user clicks the "Cancel" button, the method returns -1.

void help(string format)

Displays the monkeyrunner API reference in a style similar to that of Python'spydoc tool, using the specified format.

Arguments
format The markup format to use in the output. The possible values are "text" for plain text or "html" for HTML.

string input(string messagestring initialValue,string title,string okTitle,string cancelTitle)

Displays a dialog that accepts input and returns it to the program. The dialog is modal, so the program pauses until the user clicks one of the dialog's buttons.

The dialog contains two buttons, one of which displays the okTitle value and the other the cancelTitle value. If the user clicks the okTitle button, the current value of the input box is returned. If the user clicks the cancelTitle button, an empty string is returned.

Arguments
message The prompt message displayed in the dialog.
initialValue The initial value to display in the dialog. The default is an empty string.
title The dialog's title. The default is "Input".
okTitle The text displayed in the okTitle button. The default is "OK".
cancelTitle The text displayed in the cancelTitle button. The default is "Cancel".
Returns
  • If the user clicks the okTitle button, then the method returns the current value of the dialog's input box. If the user clicks the cancelTitle button, the method returns an empty string.

void sleep(float seconds )

Pauses the current program for the specified number of seconds.

Arguments
seconds The number of seconds to pause.

MonkeyDevicewaitForConnection(float timeout,string deviceId)

Tries to make a connection between the monkeyrunner backend and the specified device or emulator.

Arguments
timeout The number of seconds to wait for a connection. The default is to wait forever.
deviceId A regular expression that specifies the serial number of the device or emulator. See the topicAndroid Debug Bridge for a description of device and emulator serial numbers.
Returns
  • A MonkeyDevice instance for the device or emulator. Use this object to control and communicate with the device or emulator.

參考:http://developer./tools/help/MonkeyRunner.html

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多