RobotFramework自動化測試架構-移動手機自動化測試Click A Point關鍵字的使用

來源:互聯網
上載者:User

標籤:pac   bsp   access   UI   位置   自動化測試   分享   介面   cto   

Click A Point關鍵字用來類比點擊APP介面上的一個點,該關鍵字接收兩個三個參數[ x=0 | y=0 | duration=100 ],x和y代表的是點的座標位置,duration代表的是點擊持續的時間長度。這三個參數如果沒有傳入的話,會分表預設x=0,y=0,duration=100。

樣本1:這裡依舊採用上面使用的APP介面來做操作樣本,使用Click A Point關鍵字來類比點擊一個button按鈕,輸入button按鈕所在的座標。

Open Application   http://localhost:4723/wd/hub  platformName=Android platformVersion=22       deviceName=98YFBP522VSU       app=C:/Users/yongqing/Desktop/app-debug.apk   appPackage=com.example.calculator    appActivity=MainActivity

Input Text       accessibility_id=輸入框 23                               

Input Text       id=com.example.calculator:id/factortwo       12                               

Click A Point  370  339  1000             

執行結果:

Starting test: RobotFrameworkTest1.TestSuite5.TestCase008

20170510 15:32:25.243 :  INFO : Typing text ‘23‘ into text field ‘accessibility_id=輸入框‘

20170510 15:32:25.243 :  INFO : msg:find accessibility_id=輸入框

20170510 15:32:32.005 :  INFO : Typing text ‘12‘ into text field ‘id=com.example.calculator:id/factortwo‘

20170510 15:32:32.006 :  INFO : msg:find id=com.example.calculator:id/factortwo

20170510 15:32:37.282 :  INFO : Clicking on a point (370,339).

Ending test:   RobotFrameworkTest1.TestSuite5.TestCase008         

從執行結果可以看到,還可以通過Click A Point關鍵字類比點擊一個button按鈕。

RobotFramework自動化測試架構-移動手機自動化測試Click A Point關鍵字的使用

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.