Professional Documents
Culture Documents
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 MonkeyTalk.app 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.)
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
You may also want to rename the Scheme from the Manage Schemes window:
4. Add the downloaded MonkeyTalk lib to your project File > Add to YourApp... from the menu.
5. When the dialog box appears, navigate to the directory where you unzipped the MonkeyTalk zip file, and select the MonkeyTalk iOS lib from pathToMonkeyTalkFolder/agents/iOS. 6. Recursively create groups for any added folders option. Note: It is up to you whether or not you want to Copy items into destination group's folder.
10
8. Click Add. 9. The MonkeyTalk lib should now be visible in your project.
11
12
3. XCode will have added references to the libMonkeyTalk.a library. (Note: if you want to build iOS 4.x, make sure you change UIKit.framework from "Required" to "Optional") 4. On the Build Settings tab, scroll down to the Linking section and add to your Other Linker Flags: -all_load -lstdc++
13
14
5. Choose your duplicated test target from the Scheme menu in Xcode and Run on the Simulator or Device.
Log output will show that MonkeyTalk has successfully loaded in your app (as seen below)
15
16
Actually, there is nothing to install in your app to test desktop web applications. But, before you can start testing, you first need to download and install Mozilla Firefox web browser. In the future, MonkeyTalk will support other browsers for test playback, but Firefox is the only browser supported for both test playback and recording. Once you have Firefox installed: 1. Open up the MonkeyTalk IDE that you installed earlier in this tutorial 2. Create your first blank MonkeyTalk project outlined here 3. Choose FireFox from the Connections dropdown menu
17
18
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. You can now use this browser to record and playback MonkeyTalk comments. Be Patient, because it can sometimes take 10-20 seconds for Firefox to launch for the first time.
19
20
NOTE: unlike the other agents, there is nothing you need to add or install into your web app. The Firefox browser that is launched by MonkeyTalk already has the web agent pre-installed as a Firefox extension. MonkeyTalk IDE consists of the main parts highlighted below.
21
Toolbar - Contains controls for connecting, recording and playing. Editor - Displays and edits recorded scripts. Files - Shows scripts, suites, and data files that can be run or edited. Console - Reports status and test results from running scripts.
22
23
Tip: You can return to the Welcome Screen by selecting Help > Welcome from the main menu. Click on the Create Your First Project. The New Project wizard will be displayed.
24
Enter a name for your project and click Finish. The workbench window will open.
25
26
To create a test script, right-click on the project folder and select New > Test. The MonkeyTalk test editor will open with a new empty test.
27
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 are now ready to connect and begin recording a test script. You can create new projects any time by selcting the File > New MonkeyTalk Project menu option.
31
Choose "Android Emulator" or "iOS Simulator", depending on your platform of choice. 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.
32
If connection was successful, a message to that effect should appear in the console.
33
If the Record button is disabled, it is because you are not connected. Click the Connect button to initiate a connection.
34
35
Interact with your application. MonkeyTalk should record each action as a new command in the table. To stop recording, click the Stop button.
If the Record button is not lighting up, it may be one of two things:
36
6. You are not properly connected to a device. To read more on connecting to a device, go here. Your application is not properly set up for MonkeyTalk. To read more on installing the MonkeyTalk agent and setting your app up correctly, go here.
37
The script above is a simple login test the enters a userid and password, taps the login button, and then taps the logout button. The MonkeyTalk Script Editor displays and edits scripts in a Table View. You can also edit scripts using any simple text editor. Clicking on the MonkeyTalk tab in the editor will let you edit the script as text.
38
A MonkeyTalk command is made up of the values displayed in the columns of the Table View. To specify an empty table cell in a text command, use an asterisk (*).
39
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.Failures are logged in red to the console.
40
41
Editing Scripts
You can currently edit MonkeyTalk script in two different ways: through the table view and through the MonkeyTalk view. The Table View provides assistance with creating MonkeyTalk commands, and is ideal for new users. The MonkeyTalk view is intended for more-experienced users and provides for editing MonkeyTalk commands directly with a text editor.
7. 8. To edit through the table view, right click on the table and choose "Append row." Click in each cell to enter your new command. You can also use the drop down menus to select from a list of options. 9. To edit through the MonkeyTalk view, switch to the MonkeyTalk tab and edit the textual commands directly. If you wish to know more about MonkeyTalk commands, you can start by reading about the Command Syntax or the User Guide entry for Playback.
42
43
Verification in MonkeyTalk
During script playback, MonkeyTalk verifies that each referenced UI component exists and then executes the associated action. If an expected component doesn't exist, MonkeyTalk will report a script failure. For example, if your script attempts to tap on an OK button, and no OK button is currently displayed, the script will fail. Additionally, you can use MonkeyTalk's Verify commands to add explicit verification steps to your script to check that expected values match actual ones. For example, Perform an action through recording or editing the MonkeyTalk script. Check that the action was performed correctly with a verify. This is a very simple example, and you can do much more with creative verifies. Suppose we have an application where the user can set a value using a Slider control, and there is an associated label that shows the selected value. The following script moves the slider to the value 8000 and then tests that the label has updated. #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 button. The script's success or failure is reported in the console. You can do more than just Verify for simple values. Read the Test Specification or the User Guide entry for Tests for more information.
http://www.gorillalogic.com/testing-tools/monkeytalk/documentation/monkeytalk-spec http://www.gorillalogic.com/testing-tools/monkeytalk/documentation/monkeytalk-user-guide for running the tests with Ant Scripts: http://www.gorillalogic.com/testing-tools/monkeytalk/documentation/monkeytalk-userguide/ant
44
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.
45