测试sql语句执行速度

时间:2014-01-23 01:29:51   收藏:0   阅读:559

基于4.2的SDK导出来的MonkeyRunner的最新帮助,这个版本对MonkeyView和MonkeyRect有了很大的加强,在MonkeyRunner的易用性上有了很大的提高。

对于导出MonkeyRunner帮助文件的方法也顺便说一下

from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice 

content = MonkeyRunner.help("html"); 

f = open(‘help.html‘‘w‘); 

f.write(content); 

f.close(); 

文件会生成在SDK的tools 目录下

MonkeyRunner Help

Table of Contents

com.android.monkeyrunner.MonkeyRunner.alert

Display an alert dialog to the process running the current script. The dialog is modal, so the script stops until the user dismisses the dialog.

Args

Returns

returns nothing.

com.android.monkeyrunner.MonkeyDevice.broadcastIntent

Sends a broadcast intent to the device.

Args

Returns

returns nothing.

com.android.monkeyrunner.MonkeyRunner.choice

Display a choice dialog that allows the user to select a single item from a list of items.

Args

Returns

The 0-based numeric offset of the selected item in the iterable.

com.android.monkeyrunner.MonkeyImage.convertToBytes

Converts the MonkeyImage into a particular format and returns the result as a String. Use this to get access to the rawpixels in a particular format. String output is for better performance.

Args

Returns

The resulting image as a String.

com.android.monkeyrunner.MonkeyDevice.drag

Simulates dragging (touch, hold, and move) on the device screen.

Args

Returns

returns nothing.

com.android.monkeyrunner.MonkeyView.getAccessibilityIds

Returns the accessibility ids of the current view

com.android.monkeyrunner.MonkeyRect.getCenter

Returns a two item list that contains the x and y value of the center of the rectangle

com.android.monkeyrunner.MonkeyView.getChecked

Get the checked status of the view

com.android.monkeyrunner.MonkeyView.getChildren

Returns the children of the current view

com.android.monkeyrunner.MonkeyView.getEnabled

Returns the enabled status of the view

com.android.monkeyrunner.MonkeyView.getFocused

Returns the focused status of the view

com.android.monkeyrunner.MonkeyRect.getHeight

Returns the height of the rectangle

com.android.monkeyrunner.MonkeyDevice.getHierarchyViewer

Get the HierarchyViewer object for the device.

com.android.monkeyrunner.MonkeyView.getLocation

Returns the location of the view in the form of a MonkeyRect

com.android.monkeyrunner.MonkeyView.getParent

Returns the parent of the current view

com.android.monkeyrunner.MonkeyDevice.getProperty

Given the name of a variable on the device, returns the variable‘s value

Args

Returns

The variable‘s value

com.android.monkeyrunner.MonkeyDevice.getPropertyList

Retrieve the properties that can be queried

com.android.monkeyrunner.MonkeyImage.getRawPixel

Get a single ARGB (alpha, red, green, blue) pixel at location x,y. The arguments x and y are 0-based, expressed in pixel dimensions. X increases to the right, and Y increases towards the bottom. This method returns a tuple.

Args

Returns

A tuple of (A, R, G, B) for the pixel. Each item in the tuple has the range 0-255.

com.android.monkeyrunner.MonkeyImage.getRawPixelInt

Get a single ARGB (alpha, red, green, blue) pixel at location x,y. The arguments x and y are 0-based, expressed in pixel dimensions. X increases to the right, and Y increases towards the bottom. This method returns an Integer.

Args

Returns

An unsigned integer pixel for x,y. The 8 high-order bits are A, followedby 8 bits for R, 8 for G, and 8 for B.

com.android.monkeyrunner.MonkeyDevice.getRootView

Obtains current root view

com.android.monkeyrunner.MonkeyView.getSelected

Returns the selected status of the view

com.android.monkeyrunner.MonkeyImage.getSubImage

Copy a rectangular region of the image.

Args

Returns

a MonkeyImage object representing the copied region.

com.android.monkeyrunner.MonkeyDevice.getSystemProperty

Synonym for getProperty()

Args

Returns

The variable‘s value.

com.android.monkeyrunner.MonkeyView.getText

Returns the text contained by the view

com.android.monkeyrunner.MonkeyDevice.getViewByAccessibilityIds

Obtains the view with the specified accessibility ids.

Args

Returns

The view object with the specified id.

com.android.monkeyrunner.MonkeyDevice.getViewById

Obtains the view with the specified id.

Args

Returns

The view object with the specified id.

com.android.monkeyrunner.MonkeyView.getViewClass

Returns the class name of the view

com.android.monkeyrunner.MonkeyDevice.getViewIdList

Retrieve the view ids for the current application

com.android.monkeyrunner.MonkeyDevice.getViewsByText

Obtains a list of views that contain the specified text.

Args

Returns

A list of view objects that contain the specified text.

com.android.monkeyrunner.MonkeyRect.getWidth

Returns the width of the rectangle

com.android.monkeyrunner.MonkeyRunner.help

Format and display the API reference for MonkeyRunner.

Args

Returns

A string containing the help text in the desired format.

com.android.monkeyrunner.MonkeyRunner.input

Display a dialog that accepts input. The dialog is ,modal, so the script stops until the user clicks one of the two dialog buttons. To enter a value, the user enters the value and clicks the ‘OK‘ button. To quit the dialog without entering a value, the user clicks the ‘Cancel‘ button. Use the supplied arguments for this method to customize the text for these buttons.

Args

Returns

The test entered by the user, or None if the user canceled the input;

com.android.monkeyrunner.MonkeyDevice.installPackage

Installs the specified Android package (.apk file) onto the device. If the package already exists on the device, it is replaced.

Args

Returns

True if the install succeeded

com.android.monkeyrunner.MonkeyDevice.instrument

Run the specified package with instrumentation and return the output it generates. Use this to run a test package using InstrumentationTestRunner.

Args

Returns

A map of strings to objects for the output from the package. For a test package, contains a single key-value pair: the key is ‘stream‘ and the value is a string containing the test output.

com.android.monkeyrunner.MonkeyRunner.loadImageFromFile

Loads a MonkeyImage from a file.

Args

Returns

A new MonkeyImage representing the specified file

com.android.monkeyrunner.MonkeyDevice.press

Send a key event to the specified key

Args

Returns

returns nothing.

com.android.monkeyrunner.MonkeyDevice.reboot

Reboots the specified device into a specified bootloader.

Args

Returns

returns nothing.

com.android.monkeyrunner.MonkeyDevice.removePackage

Deletes the specified package from the device, including its associated data and cache.

Args

Returns

True if remove succeeded

com.android.monkeyrunner.MonkeyImage.sameAs

Compare this MonkeyImage object to aother MonkeyImage object.

Args

Returns

boolean ‘true‘ if the two objects contain the same image.

com.android.monkeyrunner.MonkeyView.setFocused

Sets the focused status of the view

Args

Returns

returns nothing.

com.android.monkeyrunner.MonkeyView.setSelected

Sets the selected status of the view

Args

Returns

returns nothing.

com.android.monkeyrunner.MonkeyDevice.shell

Executes an adb shell command and returns the result, if any.

Args

Returns

The output from the command.

com.android.monkeyrunner.MonkeyRunner.sleep

Pause the currently running program for the specified number of seconds.

Args

Returns

returns nothing.

com.android.monkeyrunner.MonkeyDevice.startActivity

Starts an Activity on the device by sending an Intent constructed from the specified parameters.

Args

Returns

returns nothing.

com.android.monkeyrunner.MonkeyDevice.takeSnapshot

Gets the device‘s screen buffer, yielding a screen capture of the entire display.

com.android.monkeyrunner.MonkeyDevice.touch

Sends a touch event at the specified location

Args

Returns

returns nothing.

com.android.monkeyrunner.MonkeyDevice.type

Types the specified string on the keyboard. This is equivalent to calling press(keycode,DOWN_AND_UP) for each character in the string.

Args

Returns

returns nothing.

com.android.monkeyrunner.MonkeyRunner.waitForConnection

Waits for the workstation to connect to the device.

Args

Returns

A ChimpDevice object representing the connected device.

com.android.monkeyrunner.MonkeyDevice.wake

Wake up the screen on the device

com.android.monkeyrunner.MonkeyImage.writeToFile

Write the MonkeyImage to a file. If no format is specified, this method guesses the output format based on the extension of the provided file extension. If it is unable to guess the format, it uses PNG.

Args

Returns

boolean true if writing succeeded.

原文:http://www.cnblogs.com/jcz1206/p/3530063.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!