2015年4月9日 星期四

MonkeyTalk (IDE篇)

嗨~ 大家好!!!

今天這一節要來說明一下關於 MonkeyTalk 錄製測試腳本 - IDE 的安裝和使用教學。

相信大家還記憶猶新,前幾篇我們介紹過 MonkeyTalk Agent 的植入方法。如果是測試 Android 裝置就要植入 MonkeyTalk Android Agent 到 Apps 的程式碼中。如果是測試 iOS 裝置就要植入 iOS Agent,這些都還只是第一步。如果是要錄製測試腳本的話,這時候就要用到 MonkeyTalk IDE,而用 IDE 所錄製的腳本,是可以共用在 Android 和 iOS 的測試裝置,換句話說就是只要錄製一個腳本,就可以使用在這兩種不同的裝置上。 

接下來我們就開始今天的說明:


Step 1: Download the zip file from link as below.

Step 2: After download then unzip the file and copy folder "MonkeyTalkIDE" to C:\
 


Step 3: Double click "MonkeyTalkIDE.exe".


Step 4: Change "Workspace" to C:\monkeytalk\workspace then tick "Use this as the default and do not ask again" and click "OK".


Step 5: Create the first test case for Android.
File | New | MonkeyTalk Project

Step 6: Enter "Project name" as "Android_TestCase"

Step 7: Select "Android_TestCase" then select "New" and click "Script"

Step 8: Enter File name "Demo.mt" then click "Finish"

Step 9: Show toolbar
Window | Show Toolbar


Step 10: Configure MonkeyTalk IDE link to Android SDK.
Window | Preferences

Tips 10-1: Select "MonkeyTalk" then add SDK path from "Android SDK" then click "Apply" and "OK" to finish this setting.

Step 12: Open Eclipse to load the project "HelloWorld"
Download and import the project from this link zip file.
HelloWorld_Agent.7z

Tips 12-1: Please make sure MonkeyTalk Agent for Android has set up in this "HelloWorld" project.
Please refer to MonkeyTalk Agent (Android篇)

Step 13: Load Android Emulator form Eclipse.
HelloWorld | Run As | 1 Android Application

Tips 13-1: Select "Choose a running Android device" then mark the device Target "Android 4.3.1" and click "OK"


Step 14: Open MonkeyTalk IDE to load the "Android Emulator"

Step 15: Click the Android icon then show the log "Connection type set to: Android Emulator or Tethered Device"

Step 16: Click "Record Button" to record the test scenario.

Step 17: Click "Stop Button" to stop the record scenario.

Step 18: Click "Play Button" to playback and test the record scenario.

Step 19: Check the logs from block as below.

Step 20: Check the report from the central block.
Android_TestCase(Project Name) | reports | DETAIL-Demo.mt.html(Testing Script Name)

恭喜各位!!! 經過了漫長的安裝,結合 MonkeyTalk Agent、MonkeyTalk IDE、Android SDK 和 Eclipse 最終才能串起這套 MonkeyTalk 自動化測試系統。

相信大家在安裝、使用和測試的過程中,一定會跟我一樣遇到許多問題,不過這些問題相信只要照著文章的步驟說明,會遇到的問題就會少很多,如果在過程中有遇到什麼問題,也歡迎大家直接在 Blog 留言發問,我將盡力的幫大家想辦法解決。

MonkeyTalk 的介紹就到這邊,完結篇!如果以後還有需要相關的說明,我們再來繼續討論,這一節就到這邊,我們下次見。

~ See you ~

參考出處:
http://www.eclipse.org/
http://www.cloudmonkeymobile.com/
http://developer.android.com/index.html
http://jpress.tw/android-dev2

2 則留言:

  1. 有问题请教太阳哥,
    在MonkeyTalk Agent (Android篇)我们已经created a new android project "HelloWorld", 在MonkeyTalk(IDE篇)Step12,为什么还要download and import the project from "HelloWorld_Agent.7z"?
    谢谢!

    回覆刪除
  2. Hi Bill,
    Sorry for reply you too late.
    如果您已經照著MonkeyTalk Agent (Android篇)created a new android project "HelloWorld",在本篇Step12就不用再download and import the project from "HelloWorld_Agent.7z"。這是給沒看(Android篇)的讀者直接下載使用的。您可以跳過這一步,沒問題。

    如果遇到問題,歡迎您隨時留言詢問。謝謝!

    回覆刪除