First we need to understand the syntax of MonkeyTalk’s
scripting language.
Syntax will be:
MonkeyTalk commands will be newline terminated and should have the
following syntax:
ComponentType MonkeyId
Action Args… Modifiers…
ComponentType (A required Component) – The component
type main base where we need to perform the action. For Examples include TextArea
and Button. Type of Component will not case sensitive. One ComponentTypes can
extend other one ComponentTypes, as described further, and also can inherit any
explained actions as well as Parameters. ComponentType is the typically the
logical name of that User Interface component (i.e. Button instead of UIButton),
but can also have the platform specific alias. All UI components will be come
into from the View section type, and so need to specifying the View on a control
is like specifying a wildcard that will match any section type
Example as below:
# Tap on any component labeled "OK"
Now View OK Tap
Mandatory MonkeyId (required term) - An identifier is
there which is used to differentiate the same type components which displayed
simultaneously. MonkeyId will be specified with (*) asterisk, which can find
the first matching component.
MonkeyId’s will be specified with a 1-based (not on
zero-based) indexed of the #N form. In such case, the MonkeyId recognize the
Nth component of the declared type which is currently displayed. Components are
indexed as per upper left most position, i.e., according to sorting components via
(x,y) coordinate.
MandatoryAction (required) – The action which is
going to be performed. For Examples include Select, Tap and EnterText. These Actions
are also not case sensitive.
Arguments/Args (requirement according to Action and
ComponentType) – one space separated list of one or multiple arguments.
Arguments are supposed to begin at the 4th token. Although it always specified
as args, strings are interpreted as essential by the command. If an Argument is
essential but not declared, it need to take on a by default value. An Arg can
be declared as an (*) asterisk to force it to take on it’s by default value,
Optional component Modifiers… (Optional) - A space separated
list of named parameters of the form % name = value, where the % will be prefix
and treat it as a Modifier. Main three system defined modifiers are:
%timeout - Total ms which need to continue retrying a
command before getting timeout
%thinktime – Total ms to wait before running the
command in first time
%retrydelay - Total in ms to make delay between retry
the next attempts
AS you configure the MonkeyTalk IDE and the do the required
changes in the source code of the application provided by the Software engineer,
you will be able to connect the MonkeyTalk to the device /emulator that application
is installed on and Now you can start writing the scripts.
Keep in Mind that before you start writing scripts you
should record several actions on the application and let monkey record(write)
the script for you. This thing very helpful for fresher because by this way one
can study which activity is related to which command.
A MonkeyTalk script can be record or write in
following three forms:-
1. Table View
2. MonkeyTalk script
3. Javascript
These are just three different-2 representations of similar
scripts. From the background all will execute in exact similar manner.
Writing script for Automation Software Testing Tool in MonkeyTalk, real world scenarios for Automation Software Testing Tool in Monkey Talk, monkeytalk vs ui automation testing tool
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
No comments:
Post a Comment