MonkeyTalk all Actions/methods with their Description and Examples

上一篇 / 下一篇  2013-08-29 13:54:13 / 个人分类:MonkeyTalk

MonkeyTalk all Actions/methods with their Description and Examples

Posted: October 18, 2012 in AndroidAutomationMonkeytalk
Tags: IOS,

MonkeyTalk all Actions/methods  with their Description and Examples:

MonkeyTalkActionDescriptionExample for android
DeviceRotateThis method is used for Change the device orientation.
Android:Landscape,Portrait
Ios:Left,Right
Device *  Rotate Landscape
BackiOS: Pops the current UINavigationItem (if there is one)
Android: Presses the hardware device key
Device *  back
forwardiOS: Pushes the next UINavigationItem, if there is one
Android: ignored.
N/A on Android.
searchiOS: ignored.
Android: Presses the device search key.
Device *  Search
ScreenshotThis method is used to create screenshot folder in running project and we can capture screenshot at any pointDevice *  Screenshot
MenuAndroid: Presses the device menu key.
iOS: ignored
Device * Menu
ShakeThis method is used for specific apps. Device * Shake
GetThis method returns “iOS” or “Android”.Device * Get a
TableSelectThis method is used to select an element from the table.Table * Select Boron
SelectRowSelect a row.
row – the row to select
section – the section containing the row. (Ignored on Android).
Where row and section are arguments.
ScrollToRow(by row)Scroll to a row by row number.
Row – the row to select
section – the section containing the row. (Ignored on Android).
Where row and section are arguments and both args should be integer.
ScrollToRow(by Value)Scroll to a row by value.
value (int)- the value of the row to scroll to.
SetEditingEnable/disable table editing. iOS: Enabled editing mode for table. Android: ignored.N/A on Android.
InsertInsert a row into the table. iOS: Inserts a row. Android: Ignored.N/A on Android.
RemoveRemove a row from the table.  iOS: Deletes the row. Android: Ignored.N/A on Android.
MoveMove a row. iOS: Moves a row. Android: IgnoredN/A on Android.
SelectIndexSelects an item by index.Table * SelectIndex 3
Where 3 is item no i.e index and index should be integer.
LongSelectIndexLong press an item by index.Table * LongSelectIndex 4
Where 4 is item no i.e index and index should be integer.
ViewverifyVerifies that a property of the component has some expected value.If  Expected value is null then it  verifies the existence of the component.Syntax: ComponentType MonkeyId  Verify arg
where for argument pass expected value for verification and componenttype can be any component of monkeytalk like label,button,tabbar etc.
Example: Label #1 Verify “Welcome, test!” %thinktime=8000
Label LOGOUT Verify LOGOUT %thinktime=3000
or
View  LOGOUT Verify LOGOUT %thinktime=3000
verifyNotVerifies that a property of the component does not have some value.If  Expected value is null then it  verifies the non-existence of the component.ComponentType MonkeyId  VerifyNot arg
Label LOGOUT VerifyNot Login %thinktime=3000
or
View LOGOUT VerifyNot Login %thinktime=3000
verifyRegexVerifies that a property of the component matches some regular expression.
verifyNotRegexVerifies that a property of the component does not have a value matching a regular expression
verifyWildcard Verifies that a property of the component does have a value matching some wildcard expression
verifyNotWildcard Verifies that a property of the component does not have a value matching some wildcard expression
GetRetrieves a property value from the componentSyntax: ComponentType MonkeyId Get Variable PropPath
Example: Button LOGIN Get b :text
Label #1 Get a
TapTaps on the component. On Android, plays a “click”. On iOS, plays a TouchDown/TouchMove/TouchUp sequence.Button LOGOUT Tap
SwipeSwipe(scroll)  the component in direction Left, Right, Up, or Down (case insensitive)WebView webview swipe Down
Table * Swipe Up
Slider * Swipe Right
DragTouch down, drag across the component, then upInput username Drag 43 154 181 162
where 43 and 154 are x1,y1 i.e starting cordinates and 181 & 162 are x2,y2  i.e ending cordinates.
TouchDownStart touching the component.Input username TouchDown 43 154
where 43 and 154 are x and y cordinates of touch and x,y should be integer.
TouchMoveDrag across the component.
one or more (x,y) coordinate pairs specifying the path of the drag gesture
Input username TouchMove 146 170
TouchUpStop touching the componentInput username TouchUp 43 154
where 43 and 154 are x and y cordinates of touch where touch is released and x,y should be integer.
PinchPinch the component.
scale – The scale factor relative to the points of the two touches in screen coordinates
velocity – The velocity of the pinch in scale factor per second (read-only)
ExecCall a method on a component. The method must take zero or more String arguments and return a String result.Not implemented yet by gorilla logics.
LongPressPerforms a long press on the component. On Android, plays a “longClick”. On iOS, plays a longPush gestureView LOGOUT  LongPress
Button LOGIN  LongPress
ButtonSelectorSelectSelect an item by value.ButtonSelector forms_radios select A
SelectIndexSelects an item by index.
LongSelectIndexLong press an item by index.
InputEnterTextEnter text into the input field.
text – the text to enter
hitDone – iOS: if true, hit Done key after entering text. Android: ignored.
Where text and hitdone are arguments of entertext action.
Input username EnterText test
ClearClear text from the input fieldInput username Clear
ScriptRunRun the script. with the given args.Script. test1.mt Run john “my password” %thinktime=3000
RunWithRun the script. with the given CSV file.Script. datdriven.mt RunWith credentials.csv
SliderSelectSelect a numeric component valueSlider forms_slider_bar Select 52 %thinktime=3000
TabBarSelectSelect an item by value.TabBar * Select hierarchy %thinktime=1000
SelectIndexSelects an item by index.TabBar * SelectIndex 2 %thinktime=5000
LongSelectIndexLong press an item by index.
VarsDefineDefine the named variables used in the script.Vars * Define user pass
CheckBoxOnThis action sets or returns the checked state of a checkbox.CheckBox forms_checkbox on
OffThis action sets or returns the Unchecked state of a checkbox.CheckBox forms_checkbox off
ItemSelectorSelectSelect an item by value.ItemSelector * Select Carbon
SelectIndexSelects an item by index.ItemSelector * SelectIndex 8
LongSelectIndexLong press an item by index.ItemSelector * LongSelectIndex 8
ButtonTapTaps(click) on the Button. On Android, plays a “click”. On iOS, plays a TouchDown/TouchMove/TouchUp sequence.Button LOGOUT Tap
DatePickerEnteDateChange the current date value.
A date with the format YYYY-MM-DD where YYYY is the year, MM is the month (01-12), and DD is the day (01-31).
NumericSelectorselectSelect a numeric component value
RatingBarselectSelect a numeric component value
ScrollerscrollScroll to the specified coordinates.
x – the x-coordinate (horizontal)
y – the y-coordinate (vertical)
TextAreaEnterTextEnter text into the input field.
text – the text to enter
hitDone – iOS: if true, hit Done key after entering text. Android: ignored.
Where text and hitdone are arguments of entertext action.
TextArea * enterText “This is a textarea”
ClearClear text from the input fieldTextArea * Clear
ToolBarSelectIndexSelects an item by index.
LongSelectIndexLong press an item by index.
VideoPlayerPlayPlay the video from the current playback point.
PauseStop the video at the current playback point
StopStop the video and set playback to the starting point.

TAG: Android ios Monkeytalk

 

评分:0

我来说两句

Open Toolbar