本機,混合,移動網絡和桌面應用程序的跨平台測試自動化。
文檔|入門|生態系統| ChangElog |貢獻指南|討論論壇
Appium是一個開源自動化框架,可為各種不同的移動,桌面和物聯網平台提供基於Web驅動器的自動化可能性。 Appium是模塊化的,可擴展的,並且支持多種編程語言,這意味著整個相關軟件的生態系統:
截至2022年1月1日,Appium團隊不再維護或支持Appium 1。所有正式支持的平台駕駛員僅與Appium 2兼容。
如果您仍在使用Appium 1,請閱讀《遷移指南》。
警告
如果您使用Appium Desktop或Appium Server GUI,則將無法升級到Appium 2,因為這兩個工具都已棄用。請使用Appium Inspector與獨立的Appium 2服務器結合使用。
可以使用npm安裝Appium(目前不支持其他軟件包管理器)。請檢查安裝文檔以獲取系統要求和更多信息。
如果從Appium 1升級,請確保Appium 1已完全卸載( npm uninstall -g appium )。如果沒有這樣做,可能會出現意外錯誤。
npm i -g appium請注意,這只能安裝Core Appium服務器,該服務器無法自動自動化任何內容。請為您的目標平台安裝驅動程序,以使其自動化。
Appium支持各種平台的應用自動化,例如iOS,Android,MacOS,Windows等。每個平台都由一個或多個“驅動程序”支持,這些“驅動程序”知道如何自動化該特定平台。您可以在Appium生態系統的驅動程序頁面中找到官方支持和第三方驅動程序的完整列表。
驅動程序管理是使用Appium的擴展命令行接口完成的:
# Install an official driver from npm (see documentation for a list of such drivers)
appium driver install < driver-name >
# Install any driver from npm
appium driver install --source=npm < driver-name >
# See documentation for installation from other sources
# List already installed drivers
appium driver list --installed
# Update a driver (it must be already installed)
# This will NOT update the major version, in order to prevent breaking changes
appium driver update < driver-name >
# Update a driver to the most recent version (may include breaking changes)
appium driver update < driver-name > --unsafe
# Uninstall a driver (it won't last forever, will it?)
appium driver uninstall < driver-name > 客戶庫以不同的編程語言啟用編寫Appium測試。 Java,Python,Ruby和.Net C#有正式支持的客戶,以及其他語言的第三方客戶。您可以在Appium生態系統客戶端頁面中找到一個客戶的完整列表。
插件允許您在不更改服務器代碼的情況下擴展服務器功能。驅動程序和插件之間的主要區別在於,後者必須在Appium Server啟動上明確啟用(默認情況下啟用了所有已安裝驅動程序):
appium --use-plugins= < plugin-name >您可以在Appium生態系統插件頁面中找到正式支持和第三方插件的完整列表。
與驅動程序類似,插件管理也使用Appium的擴展命令行接口完成:
# Install an official plugin from npm (see documentation for a list of such plugins)
appium plugin install < plugin-name >
# Install any plugin from npm
appium plugin install --source=npm < plugin-name >
# See documentation for installation from other sources
# List already installed plugins
appium plugin list --installed
# Update a plugin (it must be already installed)
# This will NOT update the major version, in order to prevent breaking changes
appium plugin update < plugin-name >
# Update a plugin to the most recent version (may include breaking changes)
appium plugin update < plugin-name > --unsafe
# Uninstall a plugin
appium plugin uninstall < plugin-name > 為了開始將命令發送到Appium服務器,它必須在您的客戶端庫期望收聽的URL和端口上運行。 Appium的命令行接口用於啟動和配置服務器:
# Start the server on the default host (0.0.0.0) and port (4723)
appium server
# You can also omit the 'server' subcommand
appium
# Start the server on the given host, port and use a custom base path prefix (the default prefix is '/')
appium --address 127.0.0.1 --port 9000 --base-path /wd/hubAppium支持並行服務器進程的執行以及單個服務器進程中的並行驅動程序會話。請參閱相應的驅動程序文檔,涉及哪種模式最適合特定驅動程序或支持並行會話。
xcuitest和uiautomator2等一些驅動程序具有內置的移動網絡和混合應用程序支持。在同一腳本中,您可以在本機應用自動化和WebView自動化之間無縫切換,所有這些都使用已經是Web自動化標準的WebDriver模型。投資WebDriver協議意味著您正在押注已成為Web標準的單個,免費和開放的測試協議。不要將自己鎖定在專有的堆棧中。
例如,如果您不使用Appium的Apple的Xcuitest庫,則只能使用OBJ-C/Swift編寫測試,並且只能通過Xcode進行測試。同樣,使用Google的Uiautomator或Espresso,您只能在Java/Kotlin中編寫測試。 Appium為移動設備及其他地區提供了真正的跨平臺本機應用程序自動化的可能性!
如果您正在尋找有關這一切的更全面描述,請閱讀我們有關Appium如何工作的文檔?
Appium有一個贊助計劃!如果您或您的公司使用Appium並希望在財務上回饋該項目,我們使用這些資金來鼓勵開發和貢獻,並支持我們依靠的其他開源項目。通過我們的OpenCollyce頁面成為贊助商。
Appium非常感謝我們的發展和戰略合作夥伴,以持續的項目開發和領導能力貢獻!


我們的讚助商頁面提供了完整的讚助商列表。
Apache-2.0
@appium/logger軟件包在ISC許可下。