SlideShare a Scribd company logo
I
MonkeyTalk Documentation
II
Table of Contents
List of Figures .................................................................................................................................IV
List of Tables ...................................................................................................................................V
1. Required softwares and Libraries:........................................................................................... 1
2. MonkeyTalk Tool support checklist......................................................................................... 2
3. Setup & Configuration of MonkeyTalk.................................................................................... 5
3.1 Install the MonkeyTalk IDE............................................................................................... 5
3.2 Installing the MonkeyTalk Android Agent........................................................................ 5
3.3 Create a Testing Project ................................................................................................... 7
3.4 Install the Android App .................................................................................................... 8
3.5 Connect to Your App ........................................................................................................ 9
3.5.1 Connecting to Emulator, Simulator, or Hardware.......................................................... 9
3.5.2 Android Emulator ........................................................................................................... 9
3.5.3 Android devices over WiFi............................................................................................ 10
4. How MonkeyTalk works: ....................................................................................................... 12
5. Supported Platforms: ............................................................................................................ 15
6. Application type:.................................................................................................................... 16
6.1 Native App:.......................................................................................................................... 16
6.2 Web App:............................................................................................................................. 16
6.3 Hybrid Apps:........................................................................................................................ 16
7. Language syntax & example.................................................................................................. 18
7.1 Commands: .................................................................................................................... 18
7.2 Modifiers ........................................................................................................................ 25
8. Advance feature add using JavaScript................................................................................... 26
III
8.1 Scripting in JavaScript.......................................................................................................... 26
8.1.1 If Control Statement..................................................................................................... 26
8.1.2 While Control statement.............................................................................................. 27
8.2 JavaScript Wrapper Library ................................................................................................. 27
8.3 Using JavaScript API ............................................................................................................ 28
8.3.1 Timeout and Thinktime ................................................................................................ 30
8.3.2 Verify Commands ......................................................................................................... 30
8.3.3 Calling MonkeyTalk from JavaScript............................................................................. 30
8.3.4 Calling Custom Commands........................................................................................... 30
9. Error Handling and Debugging Strategy................................................................................ 31
9.1 Using try-catch .................................................................................................................... 31
9.2 Using Modifiers ................................................................................................................... 32
9.3 Debugging............................................................................................................................ 32
10. Reporting............................................................................................................................ 33
IV
List of Figures
3.1 Converting into AspectJ Project………………………………………………………………………………………….11
3.2 Configurations of Libraries…………………………………………………………………………………………………12
3.3 MonkeyTalk Script Editor……………………………………………………………………………………………………13
3.4 MonkeyTalk IDE and Android Emulator………………………………………………………………………………14
3.5 Status of Connection in Console…………………………………………………………………………………………15
4.1 Recording of Commands…………………………………………………………………………………………………….17
4.2 Stop Recording of Commands and Recorded Commands…………………………………………………..18
4.3 Play Recorded Commands………………………………………………………………………………………………….19
4.4 Failure of Command…………………………………………………………..………………………………………………19
10.1 Report in XML format………………………………………………………………………………………………………38
10.2 Report in HTML Format………………………………………………………………………………………………..….39
V
List of Tables
2.1 Table of supported features………………………………………………………………..……………………………..7
7.2 List of MonkeyTalk commands……………………………………………………………………………………….....23
1
1. Required softwares and Libraries:
 MonkeyTalk v2.0.1
(https://www.cloudmonkeymobile.com/developer-
resources/downloads (Login is needed))
 Android Development Tools v21.1.0
(http://developer.android.com/sdk/index.html#download)
 Java Development Kit v1.7.0
(http://java.com/en/download/windows_ie.jsp?locale=en)
 AspectJ Development Tool v2.2.0
(http://www.eclipse.org/ajdt/whatsnew220)
 Monkeytalk agent.jar v2.0.1
(https://www.cloudmonkeymobile.com/developer-
resources/downloads (Login is needed))
2
2. MonkeyTalk Tool support checklist
Features and Benefits Community
Edition
Professional
Edition
iOS and Android apps - native,
hybrid, and mobile web
 
Simulators or Real Devices - no Jail
breaking required
 
Robust cross-platform
Recording/Playback that actually
works
 
Full touch and gesture support
 
Integrated Environment to create,
run, and edit your tests
 
Use the keyword-driven MonkeyTalk
language, or powerful JavaScript or
Java APIs
 
Run your tests interactively or from
continuous integration environments
 
Validate controls, images, text, or
any property of any object
 
3
Data-drive your tests from a
spreadsheet
 
HTML, XML, xUnit reporting for tests
and suites
 
Instrument your app at run-time - no
special build

Install, launch, stop, or uninstall your
app anytime

Multiple devices from one script (ex.
a chat conversation)

Advanced command editor

App restart from script command

Extended reporting

Built-in emulator

Supports linked-in libraries and
subprojects

4
Integrated workflow for
CloudMonkey LabManager

Technical support from
CloudMonkey Mobile

Table 2.1 Table of supported features
5
3. Setup & Configuration of MonkeyTalk
 The MonkeyTalk platform consists of two primary components:
MonkeyTalk IDE and MonkeyTalk Agents
 The MonkeyTalk IDE is an Eclipse based tool that records, plays, edits,
and manages functional test suites for iOS and Android applications
running on simulators, emulators, and devices.
 MonkeyTalk Agents are libraries for iOS and Android that must be
linked into applications to be tested. The agents enable applications to
record and play MonkeyTalk Commands. Each command performs a
user interface action or verification step.
3.1 Install the MonkeyTalk IDE
1. Download the zip file. This download contains the IDE, the
Agents, and sample applications.
2. Unzip it wherever you want, but remember where you put it
because you'll need it later.
3. On OS X, move the entire MonkeyTalk folder into your
applications folder and double click on MonkeyTalk.app to run.
4. On Windows, move the entire MonkeyTalk folder into your
Program Files folder and double click on MonkeyTalk.exe to
run.
3.2 Installing the MonkeyTalk Android Agent
 Open your Android project in Eclipse and follow these
instructions.
1. Install the AspectJ Development Tools plugin (AJDT) into
Eclipse.
2. Convert your Android project to AspectJ.
6
Figure 3.1 Converting into AspectJ Project
3. Add the monkeytalk-agent.jar to your Android project.
4. The agent can be found in the agents/android/ folder in the
main MonkeyTalk zip package you downloaded earlier. The
exact name of the android agent jar will include the version
number (for example, monkeytalk-agent-1.0.30.jar).
5. Create a libs/ folder in your Android project (if you don't
already have one), and copy the agent jar into it.
6. Include the monkeytalk-agent.jar in the AspectJ build path
(right-click on monkeyTalk-agent.jar > AspectJ Tools > Add to
Aspectpath).
7. Update your AndroidManifest.xml to include the following two
permissions:
 android.permission.INTERNET
 android.permission.GET_TASKS
8. Update the project properties (right-click on the project >
Properties > Java Build Path), select the Order and Export tab,
and check the checkbox next to the AspectJ Runtime Library to
export it:
7
Figure 3.2 Configurations of Libraries
9. You should also export the monkeytalk-agent.jar file you
added to the project. (Note: in some older versions of the
Android Development Tools, this export may create a
"Dexification Error" - if you get this problem just uncheck this).
10.Deploy your application to an Android device or emulator
3.3 Create a Testing Project
1. Click on the Create Your First Project. The New Project wizard will
be displayed.
2. Enter a name for your project and click Finish. The workbench
window will open.
3. To create a test script, right-click on the project folder and select
New > Script. The MonkeyTalk test editor will open with a new
empty script.
4. Pick a name for your new script. The script editor will open and
the MonkeyTalk toolbar will be displayed.
8
Figure 3.3 MonkeyTalk Script Editor
5. Assuming you've already linked the MonkeyTalk Agent into the
app you want to test, you are now ready to connect and begin
recording a test script.
3.4 Install the Android App
 You will need either
i. an Android device, on the same WiFi network as the computer
running the MonkeyTalk IDE, or
ii. an Android Emulator and the Android SDK installed on your
computer
 You can install it as you would any other .apk file, and then just
launch it.
9
 You can also install .apk file from command line using adb
command:
adb install pathProjectName.apk
Here pathProjectName.apk is the full relative path to the apk.
3.5 Connect to Your App
3.5.1 Connecting to Emulator, Simulator, or Hardware
1. The IDE communicates with the app over HTTP via a USB tether
or Wi-Fi connection. You can record and play back tests against
apps running on your local computer or network, or remotely
over the internet.
Figure 3.4 MonkeyTalk IDE and Android Emulator
3.5.2 Android Emulator
1. Open the IDE
2. Start up your Android emulator and load it with your
MonkeyTalk enabled app.
3. Click on the connection dropdown button on the tool bar (on
initial startup it will be the green android icon).
10
Figure 3.5 Status of Connection in Console
4. Choose “Android Emulator”, depending on your platform of
choice.
5. If you are connecting to an Android device for the first time, you
will be prompted to point the MonkeyTalk IDE to your local
Android SDK. Check the "Include Android Testing?" checkbox
and point it to the SDK. You can also set this in your MonkeyTalk
Preferences.
6. If connection was successful, a message to that effect should
appear in the console.
3.5.3 Android devices over WiFi
1. Open the IDE
2. Start up your Android device, connect it to your local wireless
network, and load it with your MonkeyTalk enabled app.
11
3. Click on the connection dropdown button on the tool bar (on
initial startup it will be the green android icon).
4. Choose “Networked Android”.
5. Enter the IP address of the mobile device.
6. If connection was successful, a message to that effect should
appear in the console.
12
4. How MonkeyTalk works:
 MonkeyTalk uses record and playback rule for testing.
4.1 Recording through the MonkeyTalk IDE
1. Make sure your device is on the same wifi network as your
computer.
2. Connect to your device over the network.
3. Pull up your application on the device.
4. Click “Record” on the MonkeyTalk IDE.
Figure 4.1 Recording of Commands
5. Interact with your application. MonkeyTalk should record each
action as a new command in the table.
6. To stop recording, click the “Stop” button.
13
Figure 4.2 Stop Recording of Commands and Recorded Commands
7. If the "Record" button is not lighting up, it may be one of two
things:
i. You are not properly connected to a device.
ii. Your application is not properly set up for MonkeyTalk.
4.2 Playback
1. Restart your app. (Not essential, but useful for returning to a
consistent initial state.)
2. Click the “Play” button to send the recorded commands to your
app.
14
Figure 4.3 Play Recorded Commands
3. If MonkeyTalk can't find a component during playback, a
command will fail. For example, in a login script, the application
might take a few seconds to process a login request, and a script
may not wait long enough before trying to tap on a button that
won't be displayed until the login action has completed.
4. Failures are logged in red to the console.
Figure 4.4 Failure of Command
15
5. Supported Platforms:
 Mac OS X
 Windows
 Linux
16
6. Application type:
 Native, Web and Hybrid in iOS and Android
6.1 Native App:
Native apps are built for a specific platform with the platform SDK,
tools and languages, typically provided by the platform vendor
 Best Suited to provide best user experience and for targeted
devices
 Dependent on native platform and hence requires separate
code bases for respective device platforms.
6.2 Web App:
Mobile Web apps are server-side apps, built with any server-side
technology (PHP, Node.js, ASP.NET) that render HTML that has been
styled so that it renders well on a device form factor. They are
accessible over device native / third party browsers
 Applicable if existing web page functionality to be accessed
from wide range of devices
 Maximum interoperability as there is little or no dependency
on native device OS
6.3 Hybrid Apps:
Native apps, run on the device, and are written with web
technologies (HTML5, CSS and JavaScript).
 Development methodology where mobile applications are
developed in one common language and which can be
deployed to all the popular platforms at once
17
 Hybrid apps run inside a native container, and leverage the
device’s browser engine (but not the browser) to render the
HTML and process the JavaScript locally
 HTML5 provides mobile device users richer mobile applications
and improved usability
18
7. Language syntax & example
 MonkeyTalk Commands are newline terminated and have following
Syntax:
ComponentType MonkeyId Action Args… Modifiers…
7.1 Commands:
MonkeyTalk Action Description Example
Device
Rotate Change the device
orientation.
i.e. Landscape,Portrait
Device * Rotate
Landscape
Back Presses the hardware device
key
Device * back
search Presses the device search key. Device * Search
Screenshot create screenshot folder in
running project and we can
capture screenshot at any
point
Device * Screenshot
Menu Presses the device menu key. Device * Menu
Get Returns “iOS” or “Android”. Device * Get a
Select select an element from the
table.
Table * Select Boron
SelectRow Select a row.
row – the row to select
ScrollToRow(by
row)
Scroll to a row by row
number.
19
Table
Row – the row to select
ScrollToRow(by
Value)
Scroll to a row by value.
value (int)- the value of the
row to scroll to.
SelectIndex Selects an item by index. Table * SelectIndex 3
Where 3 is item no i.e
index and index
should be integer.
LongSelectIndex Long press an item by index. Table *
LongSelectIndex 4
Where 4 is item no i.e
index and index
should be integer.
View
verify Verifies that a property of the
component has some
expected value. If expected
value is null then it verifies
the existence of the
component.
verifyNot Verifies 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.
verifyRegex Verifies that a property of the
component matches some
regular expression.
verifyNotRegex Verifies that a property of the
component does not have a
value matching a regular
expression
verifyWildcard Verifies that a property of the
20
View
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
Get Retrieves a property value
from the component
Tap Taps on the component i.e.
plays a “click”.
Swipe Swipe(scroll) the component
in direction Left, Right, Up, or
Down (case insensitive)
Drag Touch down, drag across the
component, then up
TouchDown Start touching the
component.
TouchMove Drag across the component.
one or more (x,y) coordinate
pairs specifying the path of
the drag gesture
TouchUp Stop touching the component
Pinch Pinch 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)
21
Exec Call a method on a
component. The method must
take zero or more String
arguments and return a String
result.
LongPress Performs a long press on the
component i.e. it plays a
“longClick”.
ButtonSelector
Select Select an item by value. ButtonSelector
forms_radios select A
SelectIndex Selects an item by index.
LongSelectIndex Long press an item by index.
Input
EnterText Enter text into the input field.
text – the text to enter Where
text is an arguments of
entertext action.
Input username
EnterText test
Clear Clear text from the input field Input username Clear
Script
Run Run the script with the given
args.
Script test1.mt Run
john “my password”
%thinktime=3000
RunWith Run the script with the given
CSV file
Script datdriven.mt
RunWith
credentials.csv
Slider Select Select a numeric component
value
Slider
forms_slider_bar
Select 52
%thinktime=3000
Select Select an item by value. TabBar * Select
hierarchy
%thinktime=1000
22
TabBar SelectIndex Selects an item by index. TabBar * SelectIndex
2 %thinktime=5000
LongSelectIndex Long press an item by index.
Vars Define Define the named variables
used in the script.
Vars * Define user
pass
CheckBox
On This action sets or returns the
checked state of a checkbox.
CheckBox
forms_checkbox on
Off This action sets or returns the
Unchecked state of a
checkbox.
CheckBox
forms_checkbox off
ItemSelector
Select Select an item by value. ItemSelector * Select
Carbon
SelectIndex Selects an item by index. ItemSelector *
SelectIndex 8
LongSelectIndex Long press an item by index. ItemSelector *
LongSelectIndex 8
Button Tap Taps(click) on the Button i.e. it
plays a “click”.
Button LOGOUT Tap
DatePicker
EnteDate Change 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).
NumericSelector select Select a numeric component
value
RatingBar select Select a numeric component
value
23
Scroller
scroll Scroll to the specified
coordinates.
x – the x-coordinate
(horizontal)
y – the y-coordinate (vertical)
TextArea
EnterText Enter text into the input field.
text – the text to enter.
Where text is an arguments of
entertext action.
TextArea * enterText
“This is a textarea”
Clear Clear text from the input field TextArea * Clear
ToolBar SelectIndex Selects an item by index.
LongSelectIndex Long press an item by index.
VideoPlayer
Play Play the video from the
current playback point.
Pause Stop the video at the current
playback point
Stop Stop the video and set
playback to the starting point.
Menu
Select Select an item by value. Menu * select About
Verify Menu * Verify About
SelectIndex Selects an item by index.
LongSelectIndex Long press an item by index.
Doc
vars Document the named
variables used in the script.
script Document the script itself.
All methods of Label #1 Verify
24
Label
view are applicable
on label.
“Welcome, test!”
Label LOGOUT
VerifyNot LOGIN
SetUp
Run Run the setup script with the
given args.
SetUp login.mt run
john “my password”
RunWith Data-drive the setup script
with the given CSV data file.
SetUp login.mt
runwith cre.csv
(where the first arg is
the data file filename
)
TearDown
Run Run the teardown script with
the given args
TearDown logout.mt
run
RunWith Data-drive the teardown
script with the given CSV data
file.
TearDown logout.mt
runwith logout.csv
Test
Run Run the test script with the
given args.
Test testcase1.mt run
RunWith Data-drive the test script with
the given CSV data file.
Test testcase1.mt
runwith login.csv
Toggle On Enabled the switch on. Toggle MonkeyId On
Off Disabled the switch. Toggle MonkeyId Off
Table 7.2 List of MonkeyTalk commands
 RunIf Command:
Run a script that will only execute given a specific command
passes.
Example: Script logout.mt RunIf Label * Verify "Welcome, Fred!"
25
7.2 Modifiers
 %timeout
It is used for how long in mili-seconds to continue retrying a
command before timing out.
USE: Button LOGIN Verify LOGIN %timeout=3000
 %thinktime
It is used for how long in mili-seconds to wait before executing the
command for the first time.
USE: Button LOGOUT Tap %thinktime=3000
 %retrydelay
It is used for how long in mili-seconds to delay between retry
attempts.
USE: Button LOGOUT Tap %retrydelay=3000
 %ignore
It can skip commands. It can also skip tests and setup/teardown on
individual tests within the suite.
USE: Test Script.mt Run %ignore=true
26
8. Advance feature add using JavaScript
 One can program in JavaScript and use additional features like loops,
multiple inputs etc.
8.1 Scripting in JavaScript
8.1.1 If Control Statement
 For example, here is a script that enters a random username and
password if none are provided:
if (typeof Test == "undefined") {
load("libs/Test.js");
};
Test.Login.prototype.run = function(usr, pwd) {
usr = usr || randStr();
pwd = pwd || randStr();
this.app.input("username").enterText(usr);
this.app.input("password").enterText(pwd);
this.app.button("LOGIN").tap();
};
function randStr()
{
var text = "";
var possible ="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
for( var i=0; i < 5; i++ )
27
text += possible.charAt(Math.floor(Math.random() *
possible.length));
return text;
}
8.1.2 While Control statement
 For example, here is a script that selects an item from the item
selector “spinner Time” 10 times:
var counter=0;
while(counter<10)
{
app.itemSelector("spinnerTime").selectIndex(counter,
{thinktime:"1000"});
counter++;
}
 Likewise, switch-case can be implemented.
 Control Statements can’t be written in MonkeyTalk Script, so if
Control statements are needed for automation, then JavaScript
is useful.
NOTE:
After programing of the control statements is done in JavaScript,
these control statements can’t be translated back to
MankeyTalk Script.
8.2 JavaScript Wrapper Library
 Every time you save an .mt script, MonkryTalk IDE generates a
JavaScript wrapper function so that you can call your script cleanly
and directly from JavaScript. The generated library is called
28
YourProjectName.js and is stored in your project's generated libs
directory. This directory also contains the MonkeyTalk JavaScript
API file MonkeyTalkAPI.js.
 For example, consider the following script:
#enterName.mt
Vars name="foo"
Input name EnterText ${name}
Button OK Tap
 When you save enterName.mt, a function is generated so that from
JavaScript you can say:
this.app.enterName().run("bar");
OR
this.app.enterName().runWith("somedata.csv");
 A "call" function is also generated that explicitly defines the
expected arguments (which assists command completion in the
IDE) so this.app.enterName().call("foo"); works too.
 Wrappers are similarly generated for custom commands.
// Call user.login.mt
this.app.user("ethel").login("secret123");
8.3 Using JavaScript API
 You can call JavaScript from MonkeyTalk with any Run or RunWith
action. MonkeyTalk scripts written in JavaScript must begin by
importing the project's generated wrapper library.
load("libs/YourProjectName.js");
29
 Every MonkeyTalk command can then be called with a JavaScript
expression of the following form:
this.app.componentType("monkeyId").action(args...);
 Importing the library creates a property called this.app, which is an
object that references the application being tested. this.app
provides functions to access components by type.
 For each component type (including user-defined ones) a function
is defined whose name is the name of the component in lower-
camel notation (eg, "button", "radioButtons"). Calling one of these
functions with a monkeyId retrieves the corresponding component.
 Examples of finding components:
// The OK Button
this.app.button("OK");
// The first table
this.app.table("#1");
 Once you've retrieved a component, you can perform actions on it.
 Each component object has functions corresponding to each
available action.
// Button OK Tap
this.app.button("OK").tap();
// Table countries Select France
this.app.table("countries").select("France");
 The JavaScript API mirrors MonkeyTalk command syntax.
// Input name EnterText Bob
this.app.input("name").enterText("Bob");
30
8.3.1 Timeout and Thinktime
 Timeout and Thinktime are specified as properties on a
JavaScript object optionally included after actions string-valued
arguments.
this.app.button("ok").tap({timeout:5000});
this.app.input("name").verify("foo", {timeout:5000});
8.3.2 Verify Commands
 Verify commands are handled just like any other action.
this.app.label("message").verify("Hello");
8.3.3 Calling MonkeyTalk from JavaScript
 You can call any script by using its name as a function on
this.app.
this.app.scriptName().run(args...);
RunWith is also supported:
this.app.script("scriptName").runWith("somedata.csv");
8.3.4 Calling Custom Commands
 Custom commands are called the same way as built-in ones.
// Call user.login.mt
// User ethel Login secret123
this.app.user("ethel").login("secret123");
31
9. Error Handling and Debugging Strategy
 Error handling in MonkeyTalk can be done in different ways.
9.1 Using try-catch
 For example, here is a script that selects an item from the item
selector “spinner Time” 10 times:
var counter=0;
while(counter<10)
{
app.itemSelector("spinnerTime").selectIndex(counter,{thinkti
me:"1000"});
}
 Here, if any error occurs during execution of the commands those
are in the while then it won’t execute further and shows the error.
So, if we need to execute the whole program then try-catch is
useful.
var counter=0;
while(counter<10)
{ try
{
app.itemSelector("spinnerTime").selectIndex(counter);
counter++;
}
catch(error)
{
break;
}
}
32
9.2 Using Modifiers
 For example, here is a script that selects an item from the item
selector “spinner Time” 10 times:
var counter=0;
while(counter<10)
{
app.itemSelector("spinnerTime").selectIndex(counter);
}
 Here, if emulator is used, then it may happen that MonkeyTalk runs
commands faster than emulator can execute it. So, it may happen
that the script will be interrupted because it can’t find the
requested component and the emulator is doing the previous
requested action. So, for this kind of error, Modifiers are useful.
var counter=0;
while(counter<10)
{
app.itemSelector("spinnerTime").selectIndex(counter,{thinkti
me:"1000"});
}
 Similarly, other Modifiers like timeout, retrydelay, ignore can be
used.
9.3 Debugging
 It can be done by using following command:
Debug * Print “Message” //For MonkeyTalk Script
app.debug().print(); //For JavaScript
33
10. Reporting
 After executing each script, a report is generated in XML and HTML
format with screenshots of the application.
Figure 10.1 Report in XML format
34
Figure 10.2 Report in HTML Format
 By seeing the report, each steps of the script that is executed can
be seen.
 If command is executed correctly then the report will show the
result as “ok” in XML and in HTML, it will show “ok” in Green Color
in the right side of the screen.
 But, if command is not executed correctly then the report will show
the result as “failure” in XML and in HTML, it will show “failure” in
Red Color in the right side of the screen.
 It will take take a screenshot of the screen of the application while
testing and save that screenshot in the screenshot folder.
Ad

More Related Content

What's hot (20)

CROSS PLATFORM APPLICATIONS DEVELOPMENT
CROSS PLATFORM APPLICATIONS DEVELOPMENT CROSS PLATFORM APPLICATIONS DEVELOPMENT
CROSS PLATFORM APPLICATIONS DEVELOPMENT
Kongu Engineering College, Perundurai, Erode
 
Android Platform Architecture
Android Platform ArchitectureAndroid Platform Architecture
Android Platform Architecture
Naresh Chintalcheru
 
Software design patterns ppt
Software design patterns pptSoftware design patterns ppt
Software design patterns ppt
mkruthika
 
android-tutorial-for-beginner
android-tutorial-for-beginnerandroid-tutorial-for-beginner
android-tutorial-for-beginner
Ajailal Parackal
 
Creating the first app with android studio
Creating the first app with android studioCreating the first app with android studio
Creating the first app with android studio
Parinita03
 
core java
core javacore java
core java
Roushan Sinha
 
Flutter workshop
Flutter workshopFlutter workshop
Flutter workshop
Vishnu Suresh
 
Flutter
FlutterFlutter
Flutter
Himanshu Singh
 
AndroidManifest
AndroidManifestAndroidManifest
AndroidManifest
Ahsanul Karim
 
Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android Studio
Suyash Srijan
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
Aly Abdelkareem
 
Mobile Application Development: Hybrid, Native and Mobile Web Apps
Mobile Application Development: Hybrid, Native and Mobile Web AppsMobile Application Development: Hybrid, Native and Mobile Web Apps
Mobile Application Development: Hybrid, Native and Mobile Web Apps
Paul Sons
 
Mobile application development
Mobile application developmentMobile application development
Mobile application development
Eric Cattoir
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Java
amaankhan
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
Professional Guru
 
STLC
STLCSTLC
STLC
Karuna Thakur
 
Software testing
Software testing Software testing
Software testing
Kunal Prajapati
 
Mobile application development ppt
Mobile application development pptMobile application development ppt
Mobile application development ppt
tirupathinews
 
Introduction to Eclipse IDE
Introduction to Eclipse IDEIntroduction to Eclipse IDE
Introduction to Eclipse IDE
Muhammad Hafiz Hasan
 
Introduction to spring boot
Introduction to spring bootIntroduction to spring boot
Introduction to spring boot
Santosh Kumar Kar
 
Software design patterns ppt
Software design patterns pptSoftware design patterns ppt
Software design patterns ppt
mkruthika
 
android-tutorial-for-beginner
android-tutorial-for-beginnerandroid-tutorial-for-beginner
android-tutorial-for-beginner
Ajailal Parackal
 
Creating the first app with android studio
Creating the first app with android studioCreating the first app with android studio
Creating the first app with android studio
Parinita03
 
Introduction to Android and Android Studio
Introduction to Android and Android StudioIntroduction to Android and Android Studio
Introduction to Android and Android Studio
Suyash Srijan
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
Aly Abdelkareem
 
Mobile Application Development: Hybrid, Native and Mobile Web Apps
Mobile Application Development: Hybrid, Native and Mobile Web AppsMobile Application Development: Hybrid, Native and Mobile Web Apps
Mobile Application Development: Hybrid, Native and Mobile Web Apps
Paul Sons
 
Mobile application development
Mobile application developmentMobile application development
Mobile application development
Eric Cattoir
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Java
amaankhan
 
Mobile application development ppt
Mobile application development pptMobile application development ppt
Mobile application development ppt
tirupathinews
 

Similar to MonkeyTalk Documentation (20)

Developing Android Applications with Adobe AIR 1st Edition Véronique Brossier
Developing Android Applications with Adobe AIR 1st Edition Véronique BrossierDeveloping Android Applications with Adobe AIR 1st Edition Véronique Brossier
Developing Android Applications with Adobe AIR 1st Edition Véronique Brossier
joicyikoi
 
[Ultracode Munich #4] Short introduction to the new Android build system incl...
[Ultracode Munich #4] Short introduction to the new Android build system incl...[Ultracode Munich #4] Short introduction to the new Android build system incl...
[Ultracode Munich #4] Short introduction to the new Android build system incl...
BeMyApp
 
Getting startedtitanium mac (1)
Getting startedtitanium mac (1)Getting startedtitanium mac (1)
Getting startedtitanium mac (1)
Johnny Vietnam
 
Learning Android 1st Edition Marko Gargenta
Learning Android 1st Edition Marko GargentaLearning Android 1st Edition Marko Gargenta
Learning Android 1st Edition Marko Gargenta
desiovissio
 
Adobe Flex 3 - Compiler API
Adobe Flex 3 - Compiler APIAdobe Flex 3 - Compiler API
Adobe Flex 3 - Compiler API
eugeneyh
 
Monkey talk
Monkey talkMonkey talk
Monkey talk
Khizra Sammad
 
Mobile app development with Ionic cross platform apps with Ionic Angular and ...
Mobile app development with Ionic cross platform apps with Ionic Angular and ...Mobile app development with Ionic cross platform apps with Ionic Angular and ...
Mobile app development with Ionic cross platform apps with Ionic Angular and ...
sestayobstk2
 
Laboratorio: Desarrollo para Smart Devices
Laboratorio: Desarrollo para Smart DevicesLaboratorio: Desarrollo para Smart Devices
Laboratorio: Desarrollo para Smart Devices
GeneXus
 
Interfacing android with embedded systems
Interfacing android with embedded systemsInterfacing android with embedded systems
Interfacing android with embedded systems
Raghav Shetty
 
Learning Swift 3 Early release 3rd Edition Jonathan Manning
Learning Swift 3 Early release 3rd Edition Jonathan ManningLearning Swift 3 Early release 3rd Edition Jonathan Manning
Learning Swift 3 Early release 3rd Edition Jonathan Manning
pundaiarleny
 
I os application bundle by flutter
I os application bundle by flutterI os application bundle by flutter
I os application bundle by flutter
Concetto Labs
 
Ios application bundle by flutter
Ios application bundle by flutterIos application bundle by flutter
Ios application bundle by flutter
Concetto Labs
 
InfoPay v5 Developers Manual
InfoPay v5 Developers ManualInfoPay v5 Developers Manual
InfoPay v5 Developers Manual
Brenton Goldthwaite
 
Portal application development using Websphere Portlet Factory
Portal application development using Websphere Portlet FactoryPortal application development using Websphere Portlet Factory
Portal application development using Websphere Portlet Factory
Dacartec Servicios Informáticos
 
full-stack-development-readthedocs-io-en-latest.pdf
full-stack-development-readthedocs-io-en-latest.pdffull-stack-development-readthedocs-io-en-latest.pdf
full-stack-development-readthedocs-io-en-latest.pdf
sharmakhusbu830
 
Petrel Ocean wizards and developers tools 2013
Petrel Ocean wizards and developers tools 2013Petrel Ocean wizards and developers tools 2013
Petrel Ocean wizards and developers tools 2013
SohrabRoshan
 
Windows phone 8 guide for android developers
Windows phone 8  guide for android developersWindows phone 8  guide for android developers
Windows phone 8 guide for android developers
Khai Le
 
S_final thesis
S_final thesisS_final thesis
S_final thesis
Serena Wang
 
S_final thesis
S_final thesisS_final thesis
S_final thesis
Serena Wang
 
Andriod dev toolbox part 2
Andriod dev toolbox  part 2Andriod dev toolbox  part 2
Andriod dev toolbox part 2
Shem Magnezi
 
Developing Android Applications with Adobe AIR 1st Edition Véronique Brossier
Developing Android Applications with Adobe AIR 1st Edition Véronique BrossierDeveloping Android Applications with Adobe AIR 1st Edition Véronique Brossier
Developing Android Applications with Adobe AIR 1st Edition Véronique Brossier
joicyikoi
 
[Ultracode Munich #4] Short introduction to the new Android build system incl...
[Ultracode Munich #4] Short introduction to the new Android build system incl...[Ultracode Munich #4] Short introduction to the new Android build system incl...
[Ultracode Munich #4] Short introduction to the new Android build system incl...
BeMyApp
 
Getting startedtitanium mac (1)
Getting startedtitanium mac (1)Getting startedtitanium mac (1)
Getting startedtitanium mac (1)
Johnny Vietnam
 
Learning Android 1st Edition Marko Gargenta
Learning Android 1st Edition Marko GargentaLearning Android 1st Edition Marko Gargenta
Learning Android 1st Edition Marko Gargenta
desiovissio
 
Adobe Flex 3 - Compiler API
Adobe Flex 3 - Compiler APIAdobe Flex 3 - Compiler API
Adobe Flex 3 - Compiler API
eugeneyh
 
Mobile app development with Ionic cross platform apps with Ionic Angular and ...
Mobile app development with Ionic cross platform apps with Ionic Angular and ...Mobile app development with Ionic cross platform apps with Ionic Angular and ...
Mobile app development with Ionic cross platform apps with Ionic Angular and ...
sestayobstk2
 
Laboratorio: Desarrollo para Smart Devices
Laboratorio: Desarrollo para Smart DevicesLaboratorio: Desarrollo para Smart Devices
Laboratorio: Desarrollo para Smart Devices
GeneXus
 
Interfacing android with embedded systems
Interfacing android with embedded systemsInterfacing android with embedded systems
Interfacing android with embedded systems
Raghav Shetty
 
Learning Swift 3 Early release 3rd Edition Jonathan Manning
Learning Swift 3 Early release 3rd Edition Jonathan ManningLearning Swift 3 Early release 3rd Edition Jonathan Manning
Learning Swift 3 Early release 3rd Edition Jonathan Manning
pundaiarleny
 
I os application bundle by flutter
I os application bundle by flutterI os application bundle by flutter
I os application bundle by flutter
Concetto Labs
 
Ios application bundle by flutter
Ios application bundle by flutterIos application bundle by flutter
Ios application bundle by flutter
Concetto Labs
 
Portal application development using Websphere Portlet Factory
Portal application development using Websphere Portlet FactoryPortal application development using Websphere Portlet Factory
Portal application development using Websphere Portlet Factory
Dacartec Servicios Informáticos
 
full-stack-development-readthedocs-io-en-latest.pdf
full-stack-development-readthedocs-io-en-latest.pdffull-stack-development-readthedocs-io-en-latest.pdf
full-stack-development-readthedocs-io-en-latest.pdf
sharmakhusbu830
 
Petrel Ocean wizards and developers tools 2013
Petrel Ocean wizards and developers tools 2013Petrel Ocean wizards and developers tools 2013
Petrel Ocean wizards and developers tools 2013
SohrabRoshan
 
Windows phone 8 guide for android developers
Windows phone 8  guide for android developersWindows phone 8  guide for android developers
Windows phone 8 guide for android developers
Khai Le
 
Andriod dev toolbox part 2
Andriod dev toolbox  part 2Andriod dev toolbox  part 2
Andriod dev toolbox part 2
Shem Magnezi
 
Ad

Recently uploaded (20)

Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Foundation Models for Time Series : A Survey
Foundation Models for Time Series : A SurveyFoundation Models for Time Series : A Survey
Foundation Models for Time Series : A Survey
jayanthkalyanam1
 
Top 10 Data Cleansing Tools for 2025.pdf
Top 10 Data Cleansing Tools for 2025.pdfTop 10 Data Cleansing Tools for 2025.pdf
Top 10 Data Cleansing Tools for 2025.pdf
AffinityCore
 
Apple Logic Pro X Crack FRESH Version 2025
Apple Logic Pro X Crack FRESH Version 2025Apple Logic Pro X Crack FRESH Version 2025
Apple Logic Pro X Crack FRESH Version 2025
fs4635986
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Full Cracked Resolume Arena Latest Version
Full Cracked Resolume Arena Latest VersionFull Cracked Resolume Arena Latest Version
Full Cracked Resolume Arena Latest Version
jonesmichealj2
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Creating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdfCreating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdf
Applitools
 
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
saimabibi60507
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Tools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google CertificateTools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google Certificate
VICTOR MAESTRE RAMIREZ
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Best Practices for Collaborating with 3D Artists in Mobile Game Development
Best Practices for Collaborating with 3D Artists in Mobile Game DevelopmentBest Practices for Collaborating with 3D Artists in Mobile Game Development
Best Practices for Collaborating with 3D Artists in Mobile Game Development
Juego Studios
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Odoo ERP for Education Management to Streamline Your Education Process
Odoo ERP for Education Management to Streamline Your Education ProcessOdoo ERP for Education Management to Streamline Your Education Process
Odoo ERP for Education Management to Streamline Your Education Process
iVenture Team LLP
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Foundation Models for Time Series : A Survey
Foundation Models for Time Series : A SurveyFoundation Models for Time Series : A Survey
Foundation Models for Time Series : A Survey
jayanthkalyanam1
 
Top 10 Data Cleansing Tools for 2025.pdf
Top 10 Data Cleansing Tools for 2025.pdfTop 10 Data Cleansing Tools for 2025.pdf
Top 10 Data Cleansing Tools for 2025.pdf
AffinityCore
 
Apple Logic Pro X Crack FRESH Version 2025
Apple Logic Pro X Crack FRESH Version 2025Apple Logic Pro X Crack FRESH Version 2025
Apple Logic Pro X Crack FRESH Version 2025
fs4635986
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Full Cracked Resolume Arena Latest Version
Full Cracked Resolume Arena Latest VersionFull Cracked Resolume Arena Latest Version
Full Cracked Resolume Arena Latest Version
jonesmichealj2
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Creating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdfCreating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdf
Applitools
 
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
saimabibi60507
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Tools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google CertificateTools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google Certificate
VICTOR MAESTRE RAMIREZ
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Best Practices for Collaborating with 3D Artists in Mobile Game Development
Best Practices for Collaborating with 3D Artists in Mobile Game DevelopmentBest Practices for Collaborating with 3D Artists in Mobile Game Development
Best Practices for Collaborating with 3D Artists in Mobile Game Development
Juego Studios
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Odoo ERP for Education Management to Streamline Your Education Process
Odoo ERP for Education Management to Streamline Your Education ProcessOdoo ERP for Education Management to Streamline Your Education Process
Odoo ERP for Education Management to Streamline Your Education Process
iVenture Team LLP
 
Ad

MonkeyTalk Documentation

  • 2. II Table of Contents List of Figures .................................................................................................................................IV List of Tables ...................................................................................................................................V 1. Required softwares and Libraries:........................................................................................... 1 2. MonkeyTalk Tool support checklist......................................................................................... 2 3. Setup & Configuration of MonkeyTalk.................................................................................... 5 3.1 Install the MonkeyTalk IDE............................................................................................... 5 3.2 Installing the MonkeyTalk Android Agent........................................................................ 5 3.3 Create a Testing Project ................................................................................................... 7 3.4 Install the Android App .................................................................................................... 8 3.5 Connect to Your App ........................................................................................................ 9 3.5.1 Connecting to Emulator, Simulator, or Hardware.......................................................... 9 3.5.2 Android Emulator ........................................................................................................... 9 3.5.3 Android devices over WiFi............................................................................................ 10 4. How MonkeyTalk works: ....................................................................................................... 12 5. Supported Platforms: ............................................................................................................ 15 6. Application type:.................................................................................................................... 16 6.1 Native App:.......................................................................................................................... 16 6.2 Web App:............................................................................................................................. 16 6.3 Hybrid Apps:........................................................................................................................ 16 7. Language syntax & example.................................................................................................. 18 7.1 Commands: .................................................................................................................... 18 7.2 Modifiers ........................................................................................................................ 25 8. Advance feature add using JavaScript................................................................................... 26
  • 3. III 8.1 Scripting in JavaScript.......................................................................................................... 26 8.1.1 If Control Statement..................................................................................................... 26 8.1.2 While Control statement.............................................................................................. 27 8.2 JavaScript Wrapper Library ................................................................................................. 27 8.3 Using JavaScript API ............................................................................................................ 28 8.3.1 Timeout and Thinktime ................................................................................................ 30 8.3.2 Verify Commands ......................................................................................................... 30 8.3.3 Calling MonkeyTalk from JavaScript............................................................................. 30 8.3.4 Calling Custom Commands........................................................................................... 30 9. Error Handling and Debugging Strategy................................................................................ 31 9.1 Using try-catch .................................................................................................................... 31 9.2 Using Modifiers ................................................................................................................... 32 9.3 Debugging............................................................................................................................ 32 10. Reporting............................................................................................................................ 33
  • 4. IV List of Figures 3.1 Converting into AspectJ Project………………………………………………………………………………………….11 3.2 Configurations of Libraries…………………………………………………………………………………………………12 3.3 MonkeyTalk Script Editor……………………………………………………………………………………………………13 3.4 MonkeyTalk IDE and Android Emulator………………………………………………………………………………14 3.5 Status of Connection in Console…………………………………………………………………………………………15 4.1 Recording of Commands…………………………………………………………………………………………………….17 4.2 Stop Recording of Commands and Recorded Commands…………………………………………………..18 4.3 Play Recorded Commands………………………………………………………………………………………………….19 4.4 Failure of Command…………………………………………………………..………………………………………………19 10.1 Report in XML format………………………………………………………………………………………………………38 10.2 Report in HTML Format………………………………………………………………………………………………..….39
  • 5. V List of Tables 2.1 Table of supported features………………………………………………………………..……………………………..7 7.2 List of MonkeyTalk commands……………………………………………………………………………………….....23
  • 6. 1 1. Required softwares and Libraries:  MonkeyTalk v2.0.1 (https://www.cloudmonkeymobile.com/developer- resources/downloads (Login is needed))  Android Development Tools v21.1.0 (http://developer.android.com/sdk/index.html#download)  Java Development Kit v1.7.0 (http://java.com/en/download/windows_ie.jsp?locale=en)  AspectJ Development Tool v2.2.0 (http://www.eclipse.org/ajdt/whatsnew220)  Monkeytalk agent.jar v2.0.1 (https://www.cloudmonkeymobile.com/developer- resources/downloads (Login is needed))
  • 7. 2 2. MonkeyTalk Tool support checklist Features and Benefits Community Edition Professional Edition iOS and Android apps - native, hybrid, and mobile web   Simulators or Real Devices - no Jail breaking required   Robust cross-platform Recording/Playback that actually works   Full touch and gesture support   Integrated Environment to create, run, and edit your tests   Use the keyword-driven MonkeyTalk language, or powerful JavaScript or Java APIs   Run your tests interactively or from continuous integration environments   Validate controls, images, text, or any property of any object  
  • 8. 3 Data-drive your tests from a spreadsheet   HTML, XML, xUnit reporting for tests and suites   Instrument your app at run-time - no special build  Install, launch, stop, or uninstall your app anytime  Multiple devices from one script (ex. a chat conversation)  Advanced command editor  App restart from script command  Extended reporting  Built-in emulator  Supports linked-in libraries and subprojects 
  • 9. 4 Integrated workflow for CloudMonkey LabManager  Technical support from CloudMonkey Mobile  Table 2.1 Table of supported features
  • 10. 5 3. Setup & Configuration of MonkeyTalk  The MonkeyTalk platform consists of two primary components: MonkeyTalk IDE and MonkeyTalk Agents  The MonkeyTalk IDE is an Eclipse based tool that records, plays, edits, and manages functional test suites for iOS and Android applications running on simulators, emulators, and devices.  MonkeyTalk Agents are libraries for iOS and Android that must be linked into applications to be tested. The agents enable applications to record and play MonkeyTalk Commands. Each command performs a user interface action or verification step. 3.1 Install the MonkeyTalk IDE 1. Download the zip file. This download contains the IDE, the Agents, and sample applications. 2. Unzip it wherever you want, but remember where you put it because you'll need it later. 3. On OS X, move the entire MonkeyTalk folder into your applications folder and double click on MonkeyTalk.app to run. 4. On Windows, move the entire MonkeyTalk folder into your Program Files folder and double click on MonkeyTalk.exe to run. 3.2 Installing the MonkeyTalk Android Agent  Open your Android project in Eclipse and follow these instructions. 1. Install the AspectJ Development Tools plugin (AJDT) into Eclipse. 2. Convert your Android project to AspectJ.
  • 11. 6 Figure 3.1 Converting into AspectJ Project 3. Add the monkeytalk-agent.jar to your Android project. 4. The agent can be found in the agents/android/ folder in the main MonkeyTalk zip package you downloaded earlier. The exact name of the android agent jar will include the version number (for example, monkeytalk-agent-1.0.30.jar). 5. Create a libs/ folder in your Android project (if you don't already have one), and copy the agent jar into it. 6. Include the monkeytalk-agent.jar in the AspectJ build path (right-click on monkeyTalk-agent.jar > AspectJ Tools > Add to Aspectpath). 7. Update your AndroidManifest.xml to include the following two permissions:  android.permission.INTERNET  android.permission.GET_TASKS 8. Update the project properties (right-click on the project > Properties > Java Build Path), select the Order and Export tab, and check the checkbox next to the AspectJ Runtime Library to export it:
  • 12. 7 Figure 3.2 Configurations of Libraries 9. You should also export the monkeytalk-agent.jar file you added to the project. (Note: in some older versions of the Android Development Tools, this export may create a "Dexification Error" - if you get this problem just uncheck this). 10.Deploy your application to an Android device or emulator 3.3 Create a Testing Project 1. Click on the Create Your First Project. The New Project wizard will be displayed. 2. Enter a name for your project and click Finish. The workbench window will open. 3. To create a test script, right-click on the project folder and select New > Script. The MonkeyTalk test editor will open with a new empty script. 4. Pick a name for your new script. The script editor will open and the MonkeyTalk toolbar will be displayed.
  • 13. 8 Figure 3.3 MonkeyTalk Script Editor 5. Assuming you've already linked the MonkeyTalk Agent into the app you want to test, you are now ready to connect and begin recording a test script. 3.4 Install the Android App  You will need either i. an Android device, on the same WiFi network as the computer running the MonkeyTalk IDE, or ii. an Android Emulator and the Android SDK installed on your computer  You can install it as you would any other .apk file, and then just launch it.
  • 14. 9  You can also install .apk file from command line using adb command: adb install pathProjectName.apk Here pathProjectName.apk is the full relative path to the apk. 3.5 Connect to Your App 3.5.1 Connecting to Emulator, Simulator, or Hardware 1. The IDE communicates with the app over HTTP via a USB tether or Wi-Fi connection. You can record and play back tests against apps running on your local computer or network, or remotely over the internet. Figure 3.4 MonkeyTalk IDE and Android Emulator 3.5.2 Android Emulator 1. Open the IDE 2. Start up your Android emulator and load it with your MonkeyTalk enabled app. 3. Click on the connection dropdown button on the tool bar (on initial startup it will be the green android icon).
  • 15. 10 Figure 3.5 Status of Connection in Console 4. Choose “Android Emulator”, depending on your platform of choice. 5. If you are connecting to an Android device for the first time, you will be prompted to point the MonkeyTalk IDE to your local Android SDK. Check the "Include Android Testing?" checkbox and point it to the SDK. You can also set this in your MonkeyTalk Preferences. 6. If connection was successful, a message to that effect should appear in the console. 3.5.3 Android devices over WiFi 1. Open the IDE 2. Start up your Android device, connect it to your local wireless network, and load it with your MonkeyTalk enabled app.
  • 16. 11 3. Click on the connection dropdown button on the tool bar (on initial startup it will be the green android icon). 4. Choose “Networked Android”. 5. Enter the IP address of the mobile device. 6. If connection was successful, a message to that effect should appear in the console.
  • 17. 12 4. How MonkeyTalk works:  MonkeyTalk uses record and playback rule for testing. 4.1 Recording through the MonkeyTalk IDE 1. Make sure your device is on the same wifi network as your computer. 2. Connect to your device over the network. 3. Pull up your application on the device. 4. Click “Record” on the MonkeyTalk IDE. Figure 4.1 Recording of Commands 5. Interact with your application. MonkeyTalk should record each action as a new command in the table. 6. To stop recording, click the “Stop” button.
  • 18. 13 Figure 4.2 Stop Recording of Commands and Recorded Commands 7. If the "Record" button is not lighting up, it may be one of two things: i. You are not properly connected to a device. ii. Your application is not properly set up for MonkeyTalk. 4.2 Playback 1. Restart your app. (Not essential, but useful for returning to a consistent initial state.) 2. Click the “Play” button to send the recorded commands to your app.
  • 19. 14 Figure 4.3 Play Recorded Commands 3. If MonkeyTalk can't find a component during playback, a command will fail. For example, in a login script, the application might take a few seconds to process a login request, and a script may not wait long enough before trying to tap on a button that won't be displayed until the login action has completed. 4. Failures are logged in red to the console. Figure 4.4 Failure of Command
  • 20. 15 5. Supported Platforms:  Mac OS X  Windows  Linux
  • 21. 16 6. Application type:  Native, Web and Hybrid in iOS and Android 6.1 Native App: Native apps are built for a specific platform with the platform SDK, tools and languages, typically provided by the platform vendor  Best Suited to provide best user experience and for targeted devices  Dependent on native platform and hence requires separate code bases for respective device platforms. 6.2 Web App: Mobile Web apps are server-side apps, built with any server-side technology (PHP, Node.js, ASP.NET) that render HTML that has been styled so that it renders well on a device form factor. They are accessible over device native / third party browsers  Applicable if existing web page functionality to be accessed from wide range of devices  Maximum interoperability as there is little or no dependency on native device OS 6.3 Hybrid Apps: Native apps, run on the device, and are written with web technologies (HTML5, CSS and JavaScript).  Development methodology where mobile applications are developed in one common language and which can be deployed to all the popular platforms at once
  • 22. 17  Hybrid apps run inside a native container, and leverage the device’s browser engine (but not the browser) to render the HTML and process the JavaScript locally  HTML5 provides mobile device users richer mobile applications and improved usability
  • 23. 18 7. Language syntax & example  MonkeyTalk Commands are newline terminated and have following Syntax: ComponentType MonkeyId Action Args… Modifiers… 7.1 Commands: MonkeyTalk Action Description Example Device Rotate Change the device orientation. i.e. Landscape,Portrait Device * Rotate Landscape Back Presses the hardware device key Device * back search Presses the device search key. Device * Search Screenshot create screenshot folder in running project and we can capture screenshot at any point Device * Screenshot Menu Presses the device menu key. Device * Menu Get Returns “iOS” or “Android”. Device * Get a Select select an element from the table. Table * Select Boron SelectRow Select a row. row – the row to select ScrollToRow(by row) Scroll to a row by row number.
  • 24. 19 Table Row – the row to select ScrollToRow(by Value) Scroll to a row by value. value (int)- the value of the row to scroll to. SelectIndex Selects an item by index. Table * SelectIndex 3 Where 3 is item no i.e index and index should be integer. LongSelectIndex Long press an item by index. Table * LongSelectIndex 4 Where 4 is item no i.e index and index should be integer. View verify Verifies that a property of the component has some expected value. If expected value is null then it verifies the existence of the component. verifyNot Verifies 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. verifyRegex Verifies that a property of the component matches some regular expression. verifyNotRegex Verifies that a property of the component does not have a value matching a regular expression verifyWildcard Verifies that a property of the
  • 25. 20 View 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 Get Retrieves a property value from the component Tap Taps on the component i.e. plays a “click”. Swipe Swipe(scroll) the component in direction Left, Right, Up, or Down (case insensitive) Drag Touch down, drag across the component, then up TouchDown Start touching the component. TouchMove Drag across the component. one or more (x,y) coordinate pairs specifying the path of the drag gesture TouchUp Stop touching the component Pinch Pinch 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)
  • 26. 21 Exec Call a method on a component. The method must take zero or more String arguments and return a String result. LongPress Performs a long press on the component i.e. it plays a “longClick”. ButtonSelector Select Select an item by value. ButtonSelector forms_radios select A SelectIndex Selects an item by index. LongSelectIndex Long press an item by index. Input EnterText Enter text into the input field. text – the text to enter Where text is an arguments of entertext action. Input username EnterText test Clear Clear text from the input field Input username Clear Script Run Run the script with the given args. Script test1.mt Run john “my password” %thinktime=3000 RunWith Run the script with the given CSV file Script datdriven.mt RunWith credentials.csv Slider Select Select a numeric component value Slider forms_slider_bar Select 52 %thinktime=3000 Select Select an item by value. TabBar * Select hierarchy %thinktime=1000
  • 27. 22 TabBar SelectIndex Selects an item by index. TabBar * SelectIndex 2 %thinktime=5000 LongSelectIndex Long press an item by index. Vars Define Define the named variables used in the script. Vars * Define user pass CheckBox On This action sets or returns the checked state of a checkbox. CheckBox forms_checkbox on Off This action sets or returns the Unchecked state of a checkbox. CheckBox forms_checkbox off ItemSelector Select Select an item by value. ItemSelector * Select Carbon SelectIndex Selects an item by index. ItemSelector * SelectIndex 8 LongSelectIndex Long press an item by index. ItemSelector * LongSelectIndex 8 Button Tap Taps(click) on the Button i.e. it plays a “click”. Button LOGOUT Tap DatePicker EnteDate Change 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). NumericSelector select Select a numeric component value RatingBar select Select a numeric component value
  • 28. 23 Scroller scroll Scroll to the specified coordinates. x – the x-coordinate (horizontal) y – the y-coordinate (vertical) TextArea EnterText Enter text into the input field. text – the text to enter. Where text is an arguments of entertext action. TextArea * enterText “This is a textarea” Clear Clear text from the input field TextArea * Clear ToolBar SelectIndex Selects an item by index. LongSelectIndex Long press an item by index. VideoPlayer Play Play the video from the current playback point. Pause Stop the video at the current playback point Stop Stop the video and set playback to the starting point. Menu Select Select an item by value. Menu * select About Verify Menu * Verify About SelectIndex Selects an item by index. LongSelectIndex Long press an item by index. Doc vars Document the named variables used in the script. script Document the script itself. All methods of Label #1 Verify
  • 29. 24 Label view are applicable on label. “Welcome, test!” Label LOGOUT VerifyNot LOGIN SetUp Run Run the setup script with the given args. SetUp login.mt run john “my password” RunWith Data-drive the setup script with the given CSV data file. SetUp login.mt runwith cre.csv (where the first arg is the data file filename ) TearDown Run Run the teardown script with the given args TearDown logout.mt run RunWith Data-drive the teardown script with the given CSV data file. TearDown logout.mt runwith logout.csv Test Run Run the test script with the given args. Test testcase1.mt run RunWith Data-drive the test script with the given CSV data file. Test testcase1.mt runwith login.csv Toggle On Enabled the switch on. Toggle MonkeyId On Off Disabled the switch. Toggle MonkeyId Off Table 7.2 List of MonkeyTalk commands  RunIf Command: Run a script that will only execute given a specific command passes. Example: Script logout.mt RunIf Label * Verify "Welcome, Fred!"
  • 30. 25 7.2 Modifiers  %timeout It is used for how long in mili-seconds to continue retrying a command before timing out. USE: Button LOGIN Verify LOGIN %timeout=3000  %thinktime It is used for how long in mili-seconds to wait before executing the command for the first time. USE: Button LOGOUT Tap %thinktime=3000  %retrydelay It is used for how long in mili-seconds to delay between retry attempts. USE: Button LOGOUT Tap %retrydelay=3000  %ignore It can skip commands. It can also skip tests and setup/teardown on individual tests within the suite. USE: Test Script.mt Run %ignore=true
  • 31. 26 8. Advance feature add using JavaScript  One can program in JavaScript and use additional features like loops, multiple inputs etc. 8.1 Scripting in JavaScript 8.1.1 If Control Statement  For example, here is a script that enters a random username and password if none are provided: if (typeof Test == "undefined") { load("libs/Test.js"); }; Test.Login.prototype.run = function(usr, pwd) { usr = usr || randStr(); pwd = pwd || randStr(); this.app.input("username").enterText(usr); this.app.input("password").enterText(pwd); this.app.button("LOGIN").tap(); }; function randStr() { var text = ""; var possible ="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; for( var i=0; i < 5; i++ )
  • 32. 27 text += possible.charAt(Math.floor(Math.random() * possible.length)); return text; } 8.1.2 While Control statement  For example, here is a script that selects an item from the item selector “spinner Time” 10 times: var counter=0; while(counter<10) { app.itemSelector("spinnerTime").selectIndex(counter, {thinktime:"1000"}); counter++; }  Likewise, switch-case can be implemented.  Control Statements can’t be written in MonkeyTalk Script, so if Control statements are needed for automation, then JavaScript is useful. NOTE: After programing of the control statements is done in JavaScript, these control statements can’t be translated back to MankeyTalk Script. 8.2 JavaScript Wrapper Library  Every time you save an .mt script, MonkryTalk IDE generates a JavaScript wrapper function so that you can call your script cleanly and directly from JavaScript. The generated library is called
  • 33. 28 YourProjectName.js and is stored in your project's generated libs directory. This directory also contains the MonkeyTalk JavaScript API file MonkeyTalkAPI.js.  For example, consider the following script: #enterName.mt Vars name="foo" Input name EnterText ${name} Button OK Tap  When you save enterName.mt, a function is generated so that from JavaScript you can say: this.app.enterName().run("bar"); OR this.app.enterName().runWith("somedata.csv");  A "call" function is also generated that explicitly defines the expected arguments (which assists command completion in the IDE) so this.app.enterName().call("foo"); works too.  Wrappers are similarly generated for custom commands. // Call user.login.mt this.app.user("ethel").login("secret123"); 8.3 Using JavaScript API  You can call JavaScript from MonkeyTalk with any Run or RunWith action. MonkeyTalk scripts written in JavaScript must begin by importing the project's generated wrapper library. load("libs/YourProjectName.js");
  • 34. 29  Every MonkeyTalk command can then be called with a JavaScript expression of the following form: this.app.componentType("monkeyId").action(args...);  Importing the library creates a property called this.app, which is an object that references the application being tested. this.app provides functions to access components by type.  For each component type (including user-defined ones) a function is defined whose name is the name of the component in lower- camel notation (eg, "button", "radioButtons"). Calling one of these functions with a monkeyId retrieves the corresponding component.  Examples of finding components: // The OK Button this.app.button("OK"); // The first table this.app.table("#1");  Once you've retrieved a component, you can perform actions on it.  Each component object has functions corresponding to each available action. // Button OK Tap this.app.button("OK").tap(); // Table countries Select France this.app.table("countries").select("France");  The JavaScript API mirrors MonkeyTalk command syntax. // Input name EnterText Bob this.app.input("name").enterText("Bob");
  • 35. 30 8.3.1 Timeout and Thinktime  Timeout and Thinktime are specified as properties on a JavaScript object optionally included after actions string-valued arguments. this.app.button("ok").tap({timeout:5000}); this.app.input("name").verify("foo", {timeout:5000}); 8.3.2 Verify Commands  Verify commands are handled just like any other action. this.app.label("message").verify("Hello"); 8.3.3 Calling MonkeyTalk from JavaScript  You can call any script by using its name as a function on this.app. this.app.scriptName().run(args...); RunWith is also supported: this.app.script("scriptName").runWith("somedata.csv"); 8.3.4 Calling Custom Commands  Custom commands are called the same way as built-in ones. // Call user.login.mt // User ethel Login secret123 this.app.user("ethel").login("secret123");
  • 36. 31 9. Error Handling and Debugging Strategy  Error handling in MonkeyTalk can be done in different ways. 9.1 Using try-catch  For example, here is a script that selects an item from the item selector “spinner Time” 10 times: var counter=0; while(counter<10) { app.itemSelector("spinnerTime").selectIndex(counter,{thinkti me:"1000"}); }  Here, if any error occurs during execution of the commands those are in the while then it won’t execute further and shows the error. So, if we need to execute the whole program then try-catch is useful. var counter=0; while(counter<10) { try { app.itemSelector("spinnerTime").selectIndex(counter); counter++; } catch(error) { break; } }
  • 37. 32 9.2 Using Modifiers  For example, here is a script that selects an item from the item selector “spinner Time” 10 times: var counter=0; while(counter<10) { app.itemSelector("spinnerTime").selectIndex(counter); }  Here, if emulator is used, then it may happen that MonkeyTalk runs commands faster than emulator can execute it. So, it may happen that the script will be interrupted because it can’t find the requested component and the emulator is doing the previous requested action. So, for this kind of error, Modifiers are useful. var counter=0; while(counter<10) { app.itemSelector("spinnerTime").selectIndex(counter,{thinkti me:"1000"}); }  Similarly, other Modifiers like timeout, retrydelay, ignore can be used. 9.3 Debugging  It can be done by using following command: Debug * Print “Message” //For MonkeyTalk Script app.debug().print(); //For JavaScript
  • 38. 33 10. Reporting  After executing each script, a report is generated in XML and HTML format with screenshots of the application. Figure 10.1 Report in XML format
  • 39. 34 Figure 10.2 Report in HTML Format  By seeing the report, each steps of the script that is executed can be seen.  If command is executed correctly then the report will show the result as “ok” in XML and in HTML, it will show “ok” in Green Color in the right side of the screen.  But, if command is not executed correctly then the report will show the result as “failure” in XML and in HTML, it will show “failure” in Red Color in the right side of the screen.  It will take take a screenshot of the screen of the application while testing and save that screenshot in the screenshot folder.