本机,混合,移动网络和桌面应用程序的跨平台测试自动化。
文档|入门|生态系统| 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许可下。