You are on page 1of 45

I n s t a l l t h e M o n k e yT a l k I D E

1. 2. 3. 4. Download the zip file here. This download contains the IDE, the Agents (which you will need for the next step), and sample applications. Unzip it wherever you want, but remember where you put it because you'll need it later. On OS X, move the entire MonkeyTalkIDE folder into your applications folder and double click on to run. On Windows, move the entire MonkeyTalkIDE folder into your Program Files folder and double click on MonkeyTalk.exe to run. (Note: If you choose to put MonkeyTalkIDE in your Program Files folder, you will have to choose a different location for your workspace.)

How to Install the MonkeyTalk Agent
If you want to jump right in to MonkeyTalk, you can try out our sample apps. You can find the apps in the samples directory of the MonkeyTalk installation zip file. These applications already have the MonkeyTalk agent installed in them, so you can just start them up and skip right to Connecting Your Device. Otherwise, if you want to set up MonkeyTalk with your own application, please continue with this step.


You can find the Agents in the agents folder in the MonkeyTalk installation zip file, each in their individual folders labeled. The iOS agent in agents/ios, the Android agent in agents/android, and the Flex agent in agents/flex. Installing the MonkeyTalk Agent is unique for each platform.

The following pages are the platform-specific agent installation instructions. iOS Android

Installing the MonkeyTalk iOS Agent
1. Download and unzip the MonkeyTalk zip file for your OS. 2. Open your application's project in Xcode. 3. Duplicate your application's build target by right-clicking on it and selecting Duplicate from the menu. A new target will be created called YourApp copy.


Rename YourApp copy to something like YourAppMonkey.


so it looks like this:


You may also want to rename the Scheme from the Manage Schemes window: 5 .

6 .

7 .

navigate to the directory where you unzipped the MonkeyTalk zip file.. When the dialog box appears. Note: It is up to you whether or not you want to Copy items into destination group's folder. and select the MonkeyTalk iOS lib from pathToMonkeyTalkFolder/agents/iOS.4. from the menu. 6.. 5. Recursively create groups for any added folders option. 8 . Add the downloaded MonkeyTalk lib to your project File > Add to “YourApp”.

9 . In the Add to Targets box. deselect YourApp and select YourAppMonkey.7.

10 .

you will need to add libsqlite3.dylib CFNetwork. Configuring Libraries and Build Settings 1. 9. The MonkeyTalk lib should now be visible in your project. 2.framework and QuartzCore.framework if your application is not already using them. (These frameworks are required by the MonkeyTalk). 11 . and select the Build Phases tab. Click Add.8. Right-click on the YourAppMonkey build target. On the Link Binaries With Libraries tab.

12 .

make sure you change UIKit. scroll down to the Linking section and add to your Other Linker Flags: -all_load -lstdc++ 13 .3. (Note: if you want to build iOS 4.x.a library. On the Build Settings tab. XCode will have added references to the libMonkeyTalk.framework from "Required" to "Optional") 4.

14 .

5. Log output will show that MonkeyTalk has successfully loaded in your app (as seen below) 15 . Choose your duplicated test target from the Scheme menu in Xcode and Run on the Simulator or Device.

Installing the MonkeyTalk Web Agent 16 .

Actually. you first need to download and install Mozilla Firefox web browser. but Firefox is the only browser supported for both test playback and recording. Create your first blank MonkeyTalk project outlined here 3. there is nothing to install in your app to test desktop web applications. In the future. MonkeyTalk will support other browsers for test playback. before you can start testing. Once you have Firefox installed: 1. Open up the MonkeyTalk IDE that you installed earlier in this tutorial 2. But. Choose FireFox from the Connections dropdown menu 17 .

18 .

Be Patient. because it can sometimes take 10-20 seconds for Firefox to launch for the first time. You can now use this browser to record and playback MonkeyTalk comments. 19 .In the console you will see the message "Connection set to Web Application" and a clean FireFox browser will automatically launched with the MonkeyTalk Agent for Web pre-installed as a Firefox extension.

20 .

The Firefox browser that is launched by MonkeyTalk already has the web agent pre-installed as a Firefox extension. 21 .NOTE: unlike the other agents. MonkeyTalk IDE consists of the main parts highlighted below. there is nothing you need to add or install into your web app.

Console .Contains controls for connecting. 22 . Create a Testing Project A MonkeyTalk Project is a folder that contains all your test scripts. A project contains the test suites for an application. suites.Shows scripts. The first time you start MonkeyTalk. suites.Toolbar .Displays and edits recorded scripts. and data files that can be run or edited. Editor . and reports. Files .Reports status and test results from running scripts. the Welcome Page will be displayed. recording and playing. You should create separate projects for each application to be tested.

23 .

The New Project wizard will be displayed.Tip: You can return to the Welcome Screen by selecting Help > Welcome from the main menu. 24 . Click on the Create Your First Project.

Enter a name for your project and click Finish. The workbench window will open. 25 .

26 .

27 . right-click on the project folder and select New > Test. Pick a name for your new test.To create a test script. The MonkeyTalk test editor will open with a new empty test.

28 .

The script editor will open and the MonkeyTalk toolbar will be displayed. 29 .

30 .

Assuming you've already linked the MonkeyTalk Agent into the app you want to test. You can create new projects any time by selcting the File > New MonkeyTalk Project menu option. you are now ready to connect and begin recording a test script. Connecting to Emulator. or Hardware 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. Simulator. 31 . or remotely over the internet.

depending on your platform of choice. you will be prompted to point the MonkeyTalk IDE to your local Android SDK. 32 . Check the "Include Android Testing?" checkbox and point it to the SDK. You can also set this in your MonkeyTalk Preferences. If you are connecting to an Android device for the first time. Click on the connection dropdown button on the tool bar (on initial start up it will be the green android icon). Choose "Android Emulator" or "iOS Simulator".Android Emulator / iOS Simulator Open the IDE Start up your Android or iOS emulator/simulator and load it with your MonkeyTalk enabled app.

Click on the connection dropdown button on the tool bar (on initial start up it will be the green android icon). Start up your Android or iOS device. 33 . and load it with your MonkeyTalk enabled app. a message to that effect should appear in the console. 4. a message to that effect should appear in the console. Click “Record” on the MonkeyTalk IDE. Pull up your application on the device. Open the IDE 2. Recording through the MonkeyTalk IDE Connect to your device. connect it to your local wireless network.".If connection was successful. 5. Choose "Networked Android or iOS device.. Enter the IP address of the mobile device.. If connection was successful. Android and iOS Hardware 1. 3.

34 . Click the Connect button to initiate a connection. it is because you are not connected.If the Record button is disabled.

35 .

MonkeyTalk should record each action as a new command in the table.Interact with your application. it may be one of two things: 36 . If the Record button is not lighting up. click the “Stop” button. To stop recording.

Asterisk (*) is a wildcard that matches the first component found of the specified component type.. for example. simple format. You are not properly connected to a device. 37 . for example Button or Input field. For example. MonkeyId identifies which component of the specified ComponentType.. Tap or EnterText.6. the OK Button. About MonkeyTalk Commands MonkeyTalk records each user interface action as a Command. To read more on connecting to a device. To read more on installing the MonkeyTalk agent and setting your app up correctly. go here. go here. or the Cancel Button. Action is the UI interaction. ComponentTypes are platform-independent. Arguments are any additional values needed to describe the action. for example. ComponentType MonkeyId Action Arguments. Every MonkeyTalk Command has the same. the text to enter into an Input field. ComponentType is the kind of UI component. Your application is not properly set up for MonkeyTalk.

and then taps the logout button. Clicking on the MonkeyTalk tab in the editor will let you edit the script as text. You can also edit scripts using any simple text editor. 38 . The MonkeyTalk Script Editor displays and edits scripts in a Table View. taps the login button.The script above is a simple login test the enters a userid and password.

) Click the “Play” button to send the recorded commands to your app. but useful for returning to a consistent initial state. Learn More About MonkeyTalk Commands MonkeyTalk Command Language Reference. use an asterisk (*).A MonkeyTalk command is made up of the values displayed in the columns of the Table View. Playing Back a Recorded MonkeyTalk Script Restart your app. To specify an empty table cell in a text command. 39 . (Not essential.

If MonkeyTalk can't find a component during playback. 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. in a login script. For example.
Failures are logged in red to the console. the application might take a few seconds to process a login request.
 40 . a command will fail.

 41 .

Retrying Failed Commands MonkeyTalk retries every command until it either succeeds or times out. By default. switch to the MonkeyTalk tab and edit the textual commands directly. You can specify a timeout on a command to increase or decrease the maximum time MonkeyTalk should retry the command before failing. 7. 9. You can increase the timeout by entering a value in the Timeout column for any command you want to retry for a longer period of time before failing. and is ideal for new users. 42 . MonkeyTalk retries every command for two seconds before failing. If you wish to know more about MonkeyTalk commands. 8. The Table View provides assistance with creating MonkeyTalk commands." Click in each cell to enter your new command. To edit through the MonkeyTalk view. You can also use the drop down menus to select from a list of options. you can start by reading about the Command Syntax or the User Guide entry for Playback. right click on the table and choose "Append row. The MonkeyTalk view is intended for more-experienced users and provides for editing MonkeyTalk commands directly with a text editor.Editing Scripts You can currently edit MonkeyTalk script in two different ways: through the table view and through the MonkeyTalk view. To edit through the table view.

43 .

Additionally.gorillalogic. If an expected component doesn't exist. The following script moves the slider to the value 8000 and then tests that the label has updated. Suppose we have an application where the user can set a value using a Slider control. #set slider to 8000
 Slider * Select 8000 
#verify that label called "CurrentValue" displays 8000 
 Label CurrentValue Verify 8000 Now run the script as normal by pressing the Play for running the tests with Ant Scripts: http://www. if your script attempts to tap on an OK button.gorillalogic. and there is an associated label that shows the selected value. MonkeyTalk will report a script failure. the script will fail. The script's success or failure is reported in the console. you can use MonkeyTalk's Verify commands to add explicit verification steps to your script to check that expected values match actual ones. Read the Test Specification or the User Guide entry for Tests for more information. For example. For example. and you can do much more with creative verifies. http://www.gorillalogic. and no OK button is currently displayed. You can do more than just Verify for simple values. Perform an action through recording or editing the MonkeyTalk 44 . This is a very simple http://www.Verification in MonkeyTalk During script playback. Check that the action was performed correctly with a verify. MonkeyTalk verifies that each referenced UI component exists and then executes the associated action.

45 .Common Problems: ERROR : Unable to send command to http://localhost:16863/fonemonkey: Connection refused Solution : The connection is gone! try to reconnect with the emulator/device.