Appium-desktop安裝與使用

來源:互聯網
上載者:User

標籤:產生   start   簡單   version   案頭   自動化   delete   新手   ppi   

  Appium-desktop是什嗎?

項目描述:

Appium Server and Inspector in Desktop GUIs for Mac, Windows, and Linux。

AppiumMobile Testing中有個很重新的組件Appium-Server,它主要用來監聽我們的行動裝置(真機或模擬器),然後將不同程式設計語言編寫的 appium 測試指令碼進行解析,然後,驅動行動裝置來運行測試。

Appium-Server:https://bitbucket.org/appium/appium.app/downloads/

但Appium-Server有一兩年沒有更新了。Window版在2015年底止步於的 AppiumForWindows_1_4_16_1.zip 

於是,新的工具 Appium-desktop 來了! 它來繼續 Appium-Server的使命,當然, Appium-Server當前仍然是可用的。

 

 

下載與安裝:

Appium-desktop項目地址:https://github.com/appium/appium-desktop

:https://github.com/appium/appium-desktop/releases

根據自己的平台選擇相關的包進行下載。本文以Windows為例,所以選擇 appium-desktop-Setup-1.2.4.exe 檔案進行下載。

安裝過程太簡單了,雙擊 exe 檔案,然後,等待安裝完就好了,中間都不需要你設定任何選項。所以,這裡就不貼圖了。

 

運行與使用:

安裝完成案頭會產生一個紫色的appium 表徵圖,雙擊開啟。

預設顯示監控的 host 和 port ,這和 Appium-Server中是一致的。點擊 “Start Server V 1.7.1” 按鈕啟動服務。

 

現在啟動 啟動你的行動裝置(真機或模擬器),編寫 Appium 自動化測試指令碼,可以通過Appium-desktop 來運行測試了。

 

 

以下為Python + Appium-Python-Client庫所編寫的測試指令碼。

#coding=utf-8from appium import webdriverdesired_caps = {}desired_caps[‘platformName‘] = ‘Android‘desired_caps[‘platformVersion‘] = ‘6.0‘desired_caps[‘deviceName‘] = ‘Android Emulator‘desired_caps[‘appPackage‘] = ‘com.android.calculator2‘desired_caps[‘appActivity‘] = ‘.Calculator‘driver = webdriver.Remote(‘http://localhost:4723/wd/hub‘, desired_caps)driver.find_element_by_name("1").click()driver.find_element_by_name("5").click()driver.find_element_by_name("9").click()driver.find_element_by_name("delete").click()driver.find_element_by_name("9").click()driver.find_element_by_name("5").click()driver.find_element_by_name("+").click()driver.find_element_by_name("6").click()driver.find_element_by_name("=").click()driver.quit()

 

運行效果如右半部分。

 

如果你看不懂本文,請參考我的《Appium新手入門

http://www.testclass.net/appium/

 

Appium-desktop安裝與使用

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.