1. 程式人生 > >RobotFramework客戶端RIDE完成對Android系統的自動化測試示例

RobotFramework客戶端RIDE完成對Android系統的自動化測試示例

說明:下載AndroidDemoProject.apk包,下載地址:http://pan.baidu.com/s/1gdH27pp,此包為未簽名
步驟一:首先啟動Appium Server 與android模擬器,如圖所示:

1.png

步驟二:執行RIDE,雙擊RIDE,測試指令碼如下:
*** Settings ***
Library AppiumLibrary
Library Collections

*** Test Cases ***
Appium-Demo[系統資訊註冊測試]-001
[Setup]
Open Application http://localhost:4723/wd/hub android 4.4.2 android_emulator_SDK D:\Sign\AndroidDemoProject.apk appium

... sh.calaba.demoproject .AndroidDemoProjectActivity
Wait Until Keyword Succeeds 2min 5sec Page Should Contain Element id=sh.calaba.demoproject:id/textView1
Click Element id=sh.calaba.demoproject:id/editText1
Input Text id=sh.calaba.demoproject:id/editText1 wangshengshun
Input Password id=sh.calaba.demoproject:id/editText2 shun456

Input Text id=sh.calaba.demoproject:id/editText3 [email protected]
Click Element id=sh.calaba.demoproject:id/radioButton1
Click Element id=sh.calaba.demoproject:id/checkBox1
Click Button 提交表單
Capture Page Screenshot D:\Appium\image\appium-screenshot.png
Close Application

2.png

步驟三:單擊“Run“選項卡->"Start"按鈕,啟動測試,在Appium命令視窗中會有資訊顯示,如下圖所示:


3.png

步驟四:點選”Report“,會自動生成測試報告,如下圖所示:

4.png