1 | ## Appium
|
2 |
|
3 | [![NPM version](https://badge.fury.io/js/appium.svg)](https://npmjs.org/package/appium)
|
4 | [![Monthly Downloads](https://img.shields.io/npm/dm/appium.svg)](https://npmjs.org/package/appium)
|
5 |
|
6 | [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fappium%2Fappium.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fappium%2Fappium?ref=badge_shield)
|
7 |
|
8 | [![StandWithUkraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://github.com/vshymanskyy/StandWithUkraine/)
|
9 |
|
10 | [![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://vshymanskyy.github.io/StandWithUkraine/)
|
11 |
|
12 | Appium is an open-source, cross-platform test automation tool for native,
|
13 | hybrid, mobile web and desktop apps. Initially created to automate iOS and Android mobile
|
14 | applications Appium has grown to a full-featured platform that provides [WebDriver](https://www.w3.org/TR/webdriver/)-based automation possibilities for the whole set of different mobile and desktop platforms.
|
15 | See the full list of
|
16 | [officially-supported](https://appium.io/docs/en/latest/ecosystem/#drivers) and
|
17 | [third-party](https://appium.io/docs/en/latest/ecosystem/#other-drivers) drivers for more details.
|
18 |
|
19 | :bangbang: The current Appium 2.0 documentation can be found [here](https://appium.io/docs/en/latest/).
|
20 |
|
21 | :bangbang: Appium core team does not maintain Appium 1.x anymore since the 1st of January 2022. All recent versions of officially supported platform drivers are not compatible to Appium 1.x, and require Appium 2 to run. [Please read the migration guide from 1.x to 2.0](https://appium.io/docs/en/latest/guides/migrating-1-to-2/) to manage the Appium server.
|
22 |
|
23 | :bangbang: If you still use the deprecated Appium Desktop containing the built-in server then you won't be able to upgrade to Appium 2. Consider switching to [Appium Inspector](https://github.com/appium/appium-inspector) instead.
|
24 |
|
25 | ### Requirements
|
26 |
|
27 | - macOS, Linux or Windows operating system
|
28 | - Node.js 16+. Any relevant [LTS release](https://nodejs.dev/en/about/releases/) should work just fine.
|
29 | - NPM (Node Package Manager) 8+
|
30 |
|
31 | These are only server requirements. Each driver might have its own requirements. Consider checking the corresponding driver tutorial for more details.
|
32 |
|
33 | ### Server
|
34 |
|
35 | To install Appium 2 server using Node Package Manager (npm) run the following command:
|
36 |
|
37 | ```bash
|
38 | npm i --location=global appium
|
39 | ```
|
40 |
|
41 | To update Appium 2 server using Node Package Manager (npm) run the following command:
|
42 |
|
43 | ```bash
|
44 | npm install --location=global appium@latest
|
45 | ```
|
46 |
|
47 | :bangbang: Make sure Appium 1 is fully uninstalled before upgrading it to Appium 2 (`npm uninstall --location=global appium`). Unexpected errors might appear if this has not been done.
|
48 |
|
49 | ### Drivers
|
50 |
|
51 | Appium supports app automation across a variety of platforms, like iOS,
|
52 | Android, and Windows. Each platform is supported by one or more "drivers",
|
53 | which know how to automate that particular platform. Since version 2.0
|
54 | all drivers have been isolated from the Appium server app and can
|
55 | be managed independently using the [appium driver](https://appiumpro.com/editions/122-installing-appium-20-and-the-driver-and-plugins-cli) command line interface.
|
56 |
|
57 | In general, the drivers management in Appium 2 is as simple as:
|
58 |
|
59 | ```bash
|
60 | # To install a new driver from npm
|
61 | appium driver install --source=npm appium-xcuitest-driver[@<version>]
|
62 | # To install a driver from a local folder (useful for developers)
|
63 | appium driver install --source=local /Users/me/sources/appium-xcuitest-driver
|
64 | # To install a new driver from github (hm, maybe it's time to publish it to NPM?)
|
65 | appium driver install --source=github --package=appium-xcuitest-driver appium/appium-xcuitest-driver
|
66 |
|
67 | # To list already installed drivers
|
68 | appium driver list --installed
|
69 |
|
70 | # To update a driver (it must be already installed)
|
71 | appium driver update xcuitest
|
72 |
|
73 | # To uninstall a driver (it won't last forever, wouldn't it?)
|
74 | appium driver uninstall xcuitest
|
75 | ```
|
76 |
|
77 | You can find a full list of
|
78 | [officially-supported](https://appium.io/docs/en/latest/ecosystem/#drivers) and
|
79 | [third-party](https://appium.io/docs/en/latest/ecosystem/#other-drivers) drivers at
|
80 | the current Appium 2.0 documentation.
|
81 |
|
82 | ### Plugins
|
83 |
|
84 | The concept of plugins is something new that has been added exclusively to Appium2. Plugins allow you to extend server functionality without changing the server code. Plugins could be managed similarly to drivers:
|
85 |
|
86 | ```bash
|
87 | # To install an officially supported plugin
|
88 | appium plugin install images
|
89 | # To install a plugin from a local folder (useful for developers)
|
90 | appium plugin install --source=local /Users/me/sources/images
|
91 | # To install a new plugin from npm
|
92 | appium plugin install --source=npm appium-device-farm
|
93 |
|
94 | # To list already installed plugins
|
95 | appium plugin list --installed
|
96 |
|
97 | # To update a plugins (it must be already installed)
|
98 | appium plugin update appium-device-farm
|
99 |
|
100 | # To uninstall a plugin
|
101 | appium plugin uninstall appium-device-farm
|
102 | ```
|
103 |
|
104 | The main difference between drivers and plugins is that the latter must be explicitly enabled on server startup after it was installed (drivers are enabled by default after installation):
|
105 |
|
106 | ```bash
|
107 | appium server --use-plugins=device-farm,images
|
108 | ```
|
109 |
|
110 | You can find a full list of
|
111 | [officially-supported](https://appium.io/docs/en/latest/ecosystem/#plugins) and
|
112 | [third-party](https://appium.io/docs/en/latest/ecosystem/#other-plugins) plugins at
|
113 | the current Appium 2.0 documentation.
|
114 |
|
115 |
|
116 | ### Server Command Line Interface
|
117 |
|
118 | In order to start sending commands to Appium over the wire it must be listening
|
119 | on the URL where your client library expects it to listen.
|
120 | Use the following commands to run and configure Appium server:
|
121 |
|
122 | ```bash
|
123 | # Start the server on the default port and host (e.g. http://0.0.0.0:4723/)
|
124 | appium server
|
125 | # Start the server on the given port, host and use the base path prefix (the default prefix is /)
|
126 | appium server -p 9000 -a 127.0.0.1 -pa /wd/hub
|
127 |
|
128 | # Get the list of all supported command line parameters.
|
129 | # This list would also include descriptions of driver-specific
|
130 | # command line arguments for all installed drivers.
|
131 | # Each driver and plugin must have their command line arguments
|
132 | # exposed in a special JSON schema declared as a part of the corresponding
|
133 | # package.json file.
|
134 | appium server --help
|
135 | ```
|
136 |
|
137 | Appium supports execution of parallel server processes as well as parallel driver sessions within
|
138 | single server process. Refer the corresponding driver documentations regarding which mode is optimal
|
139 | for the particular driver or whether it supports parallel sessions.
|
140 |
|
141 | ### Why Appium?
|
142 |
|
143 | 1. You usually don't have to recompile your app or modify it in any way, due
|
144 | to the use of standard automation APIs on all platforms.
|
145 | 2. You can write tests with your favorite dev tools using any
|
146 | [WebDriver](https://w3c.github.io/webdriver/webdriver-spec.html)-compatible
|
147 | language such as [Java](https://github.com/appium/java-client),
|
148 | [JavaScript](https://webdriver.io/), [Python](https://github.com/appium/python-client),
|
149 | [Ruby](https://github.com/appium/ruby_lib), [C#](https://github.com/appium/dotnet-client)
|
150 | with the Selenium WebDriver API. There are also various third party
|
151 | client implementations for other languages.
|
152 | 3. You can use any testing framework.
|
153 | 4. Some drivers, like xcuitest and uiautomator2 ones have built-in mobile web and
|
154 | hybrid app support. Within the same script, you can switch seamlessly between native
|
155 | app automation and webview automation, all using the WebDriver model that's already
|
156 | the standard for web automation.
|
157 | 5. You can run your automated tests locally and in a cloud. There are multiple
|
158 | cloud providers that support various Appium drivers (mostly
|
159 | targeting iOS and Android mobile automation).
|
160 | 6. [Appium Inspector](https://github.com/appium/appium-inspector) allows
|
161 | visual debugging of automated tests and could be extremely useful for
|
162 | beginners.
|
163 |
|
164 | Investing in the
|
165 | [WebDriver](https://w3c.github.io/webdriver/webdriver-spec.html) protocol means
|
166 | you are betting on a single, free, and open protocol for testing that has become
|
167 | a web standard. Don't lock yourself into a proprietary stack.
|
168 |
|
169 | For example, if you use Apple's XCUITest library without Appium you can only
|
170 | write tests using Obj-C/Swift, and you can only run tests through Xcode.
|
171 | Similarly, with Google's UiAutomator or Espresso, you can only write tests in
|
172 | Java/Kotlin. Appium opens up the possibility of true cross-platform native app
|
173 | automation, for mobile and beyond. Finally!
|
174 |
|
175 | If you're new to Appium or want a more comprehensive description of what this is all
|
176 | about, please read our [Intro to Appium](https://appium.io/docs/en/latest/intro/).
|
177 |
|
178 | ### Quickstart
|
179 |
|
180 | Check out our [Quickstart](https://appium.io/docs/en/latest/quickstart/) guide
|
181 | to get going with Appium.
|
182 |
|
183 | There is also a sample code that contains [many examples of tests in a variety
|
184 | of different languages](https://github.com/appium/appium/tree/1.x/sample-code)!
|
185 |
|
186 | ### Documentation
|
187 |
|
188 | For prettily-rendered docs, please visit [Appium Documentation](https://appium.io).
|
189 | You can always find the full list of Appium doc pages at [Appium's GitHub
|
190 | Repo](https://github.com/appium/appium/tree/master/packages/appium/docs) as well.
|
191 |
|
192 | ### Contributing
|
193 |
|
194 | Please take a look at our [contribution documentation](CONTRIBUTING.md)
|
195 | for instructions on how to build, test, and run Appium from the source.
|
196 |
|
197 | ### Project History, Credits & Inspiration
|
198 |
|
199 | * [History](https://appium.io/docs/en/latest/intro/history/)
|
200 |
|
201 | ### User Forums
|
202 |
|
203 | Announcements and debates often take place on the [Discussion Group](https://discuss.appium.io),
|
204 | be sure to sign up!
|
205 |
|
206 | ### Troubleshooting
|
207 |
|
208 | Please find the troubleshooting guide at the corresponding driver repository/documentation.
|
209 |
|
210 | ### License
|
211 |
|
212 | [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fappium%2Fappium.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fappium%2Fappium?ref=badge_large)
|