Appium Desktop is a graphical frontend to Appium with additional tools.
If you’re on macOS, you will need to install Appium Desktop by copying the app from the downloaded DMG file to your own file system (the best place is the “Applications” folder). Running Appium from in side the attached DMG itself is not supported, and will not work.
The server start window
Starting a simple server
- When you open Appium Desktop, you are greeted with the server start window. The basic option is to start an Appium server with all its defaults and the ability to modify the host and port.
- The start button will also let you know which version of the Appium server you are running, which can be useful when reporting issues to the Appium team.
starting a server with advanced options
- By clicking on the ‘Advanced’ tab, you have the ability to set all the server flags that are available in Appium.
- This is for advanced users and should only be modified after consulting the Appium documentation.
Server presets
- If you use the advanced server options, you have the ability to save a configuration for later use.
- Simply save the preset on the ‘Advanced’ tab, and you will subsequently be able to recall and start the server with that configuration from the ‘Preset’ tab.
The server console output window
- Once you start the server, it will launch on the host and port you specified, and open a new window displaying the server log output.
- This is fairly straightforward and no real interaction is possible, beyond using the button to stop the server.
- You can also copy-and-paste the logs from this window which is useful in reporting Appium issues.
- One other button is available: ‘Start New Session’. Clicking this will open up the New Session window enabling you to start an Inspector session on the currently-running server.
The New Session window
- The New Session window allows you to construct a set of Appium desired capabilities used to launch an Appium session.
- You can launch a session against the currently-running Appium Desktop server (which is the default), or you can launch a session against a variety of other endpoints.
- Since it’s not required to run against Appium Desktop’s own server, you can get to the New Session window without starting an Appium Desktop server.
- Simply go to “File” (Windows/Linux) or “Appium” (Mac) and choose “New Session…”, which will open the New Session window without having to start a local server.
- In this case, attaching to the local server will be disabled.
- You can add available cloud providers as new tabs. When you select Select Cloud Providers tab on the view, Select Cloud Providers dialog appears. You can select some of them and click Done, they will appear on the New session window as tabs.
The Inspector
The Inspector is a visual representation of the state of your application along with the ability to perform certain interactions in your application through Appium.
- Appium sessions can take some time to load, especially on cloud services, so please be patient. When the session loads, a screenshot of your app will appear on the left.
- You can mouse over various UI elements in your application, and see them highlighted.
The top of the Inspector window contains a small toolbar with icons representing the ability to take certain actions in the Inspector:
- Back (call driver.back)
- Refresh (refresh the source and screenshot)
- Start Recording (open the recorder, see the next section for more information on the recorder)
- Quit the session (call driver.quit and close the Inspector)
The inspector for Hybrid or Web apps
- Appium Desktop can also inspect the Webview of your Hybrid app or inspect elements in the Chrome of Safari browser.
- It will automatically determine for Android or iOS if a webview is detected and will notify you about this in the right part of the screen.
A select box of all found contexts will be shown and after selecting a context the source will be updated and show the source. The below screenshot shows the HTML source of the Appium Desktop documentation website
.
- As of Appium Desktop version 1.18.0 it will automatically enable showing the HTML-source if a Chrome or Safari session is started.
More selector options
- XML is not a native programming language for iOS as it is with Android. Appium will automatically translate the iOS-UIHierarchy into XML, but this is a time-consuming process.
- The XML will be used to provide a XPATH that can be used to find elements.
- When you use that XPATH selector with iOS during automation, Appium always needs to do the translation which will slow down the test execution (for more info see Appium Pro newsletter 8).
As of Appium Desktop version 1.18.0 it will, if possible, also provide the:
selector options together with a Get Timing button.
.
- When you select an iOS element in Appium Desktop and press the Get Timing-button it will provide you the time in milliseconds it will take per selector to find the element and will automatically sort them from fast to the slowest.
- In most cases you will see that XPATH is the slowest locator strategy in comparison to the other options.
.
The Recorder
- Appium Desktop comes with a very basic action recorder, that watches for actions taken using Appium Desktop and displays language-and-framework-specific code that represents those actions.
- The code can then be copied-and-pasted into the appropriate Appium client code and used for tests.
NB: the goal of the Recorder is not to produce production-ready test code. It is designed as a tool to help explore the Appium API, and demonstrate how certain automation behaviors correspond to method calls in a particular language and Appium library. In sum, it is a learning tool, not a robust code generation feature, and should be used as such.
When you start recording, the Inspector will show an additional window:
At first, the Recorder will show no code. You will first have to take some action, like finding an element in the hierarchy and tapping on it, or sending keystrokes to it. When you do this, code will appear in the recorder window, corresponding to the particular language and framework you have chosen (which can be adjusted in the drop-down menu at the top right of the Recorder):
This code can be copied to your clipboard using the appropriate button at the top right of the Recorder pane. Note that by default what is shown are simply lines of code corresponding to the specific actions you have taken while recording—in general you cannot paste these lines into an empty text file and run the code. To run Appium test scripts in code requires that various dependencies (like the Appium client libraries) be installed, and that script boilerplate (like instantiating a driver and initializing a session) be present. To show this additional code, you can click the “Show Boilerplate” button. With boilerplate code shown, it is possible to copy and paste the code into a new file and run it.
The power of the Recorder will continue to grow as we add more languages, frameworks, and actions to Appium Desktop.