Chapter 3. The Appium GUI

This chapter focuses on the GUI for the Appium server. By the end of this chapter, we should get an understanding of all the terms that are available in the application.

In this chapter, we will learn about the following topics:

  • The Appium GUI for Windows
  • The Appium GUI for Mac

The Appium server

In the previous chapter, we downloaded the Appium server. We have two ways to start the server: either using the Appium GUI or using Command Prompt/Terminal. Now let's discuss the Appium GUI.

The Appium GUI for Windows

Appium developers have created the well-designed server GUI, using which we can easily start the server along with the desired settings. This GUI gives us a lot of options to set up the environment in order to start with automation testing.

The Appium GUI has the following icons/buttons:

  • Android Settings
  • General Settings
  • Developer Settings
  • About
  • Inspector
  • Launch/Stop
  • Clear

These buttons/icons can be seen in the following screenshot:

The Appium GUI for Windows

Android Settings

Under Android Settings, we have multiple options which we need before we start with the automation of mobile apps. Just click on the first icon from the Appium GUI; this will open the pop-up window along with a lot of fields. These fields are categorized using headings such as Application, Launch Device, Capabilities, and Advanced, as shown in the following screenshot:

Android Settings

Application

The Application pane contains various fields, which are listed in the following table:

Field

Description

Application Path

In this field, you can give the path of the Android APK that you want to test. You have two options to set the app's path: either to click on the Choose button or directly type into the box.

Package

This field is for the Android app package. For example, com.android.calculator2.

Wait for Package

This capability will wait for the application package, which we provide in the Package capability.

Launch Activity

Type the activity that you want to launch in the mobile device, for example, MainActivity.

Wait for Activity

This is the same as the wait for package functionality; it will wait for the app activity.

Use Browser

Select the browser from the dropdown, which you wish to launch.

Full Reset

This will uninstall the app after the session is complete.

No Reset

This will prevent the device from resetting.

Intent Action

This will be used to start the activity.

Intent Category

Here, we can specify the app activity that we want to start.

Intent Flags

This denotes the intent flags used to start the activity.

Intent Arguments

Here, you can pass additional arguments to start the activity.

Launch Device

The Launch Device pane contains a lot of fields, which are listed in the following table:

Field

Description

Launch AVD

Here, you need to type the name of the AVD to be launched.

Device Ready Timeout

Here, mention the timeout (in seconds) to wait for the device to be ready.

Arguments

We can pass additional emulator arguments to launch the AVD in this field.

Capabilities

The Capabilities pane contains the fields listed in the following table:

Field

Description

Platform Name

This denotes the name of the mobile platform.

Automation Name

You can select this from the dropdown.

PlatformVersion

Here, select the android version in which you wish to test the mobile app.

Device Name

This denotes the name of the device to be used.

Language

This is used to set the language for the Android device.

Locale

This is used to set the locale for the Android device.

Advanced

The Advanced pane contains the fields listed in the following table, along with their descriptions:

Field

Description

SDK Path

This denotes the Android SDK path.

Coverage Class

Here, we can pass a fully qualified instrumentation class.

Bootstrap Port

Here, set the port number to talk to Appium.

Selendroid Port

Here, we can set the port number for Selendroid.

Chromedriver Port

Here, we set the port in which ChromeDriver will start.

Another type of setting in the GUI is the developer settings.

General Settings

Click on the second icon in the GUI to open the developer settings. This also categorizes the fields into headings such as Server and Logging, as shown in the following screenshot:

General Settings

Server

The Server pane contains the fields listed in the following table, along with their descriptions:

Field

Description

Server Address

The IP address of the system on which the Appium server is running.

Port

The port on which the Appium server will talk to the WebDriver commands. The system takes the default port 4723.

Check for Updates

If you click on this, then Appium will automatically check for version updates.

Pre-Launch Application

This capability will launch the application in the device before it starts listening commands from the WebDriver.

Override Existing Session

Checking this will override the Appium sessions, if they exist.

Use Remote Server

If the Appium server is running on another machine, then you can use this functionality to connect the Appium Inspector.

Selenium Grid Configuration File

You can mention the Selenium Grid configuration file's path.

Logging

The Logging pane contains the fields listed in the following table, along with their descriptions:

Field

Description

Quiet Logging

This will prevent a verbose logging output.

Show Timestamps

The console output will be displayed along with timestamps.

Log to File

The log output will be stored in the mentioned file (For example, C:\appium\abc.log).

Log to WebHook

The log output will be sent to the HTTP listener.

Use Local Timezone

By clicking on this option, you can use your local time zone, otherwise it will use the node server's time zone.

Developer settings

If you click on the highlighted icon (shown here) in the GUI, you will get the following screen:

Developer settings

The Developer Settings pane will contain the options listed in the following table:

Field

Description

Enabled

Developer settings will be displayed if the box is checked.

Use External NodeJS Binary

If you have another Node.js version instead of the application itself supplied here, Appium will use the same version of Node.js.

Use External Appium Package

You can supply the Appium package here, if you have another one.

NodeJS Debug Port

The Node.js debugging port is where the debugger will run.

Break on Application Start

When the application starts, the Node.js debug server will break.

Custom Server Flags

Here, you can pass the server flags (For example, --device-name Nexus 5).

About

Clicking on this icon will display the Appium version you are using, as shown in the following screenshot:

About

Now, let's take a look at the Appium Inspector.

Inspector

Appium Inspector allows us to find the elements that we are looking for. It also comes with a record and playback functionality similar to that of the Selenium IDE, but currently, it does not work well with Windows. To open the Inspector, we have to click on the highlighted icon, as shown in the following screenshot, but first application should be prelaunched on the device:

Inspector

By using the Inspector, we can get the source code of a particular application, but it is hard to recognize the app elements. On Windows, UIAutomator is more powerful than Appium Inspector for inspecting the elements. In the next chapter, we will learn more about the UIAutomator.

The Launch/Stop button

This is used to start and stop the Appium server, which is shown in the following screenshot:

The Launch/Stop button

The Clear button

We can find this button in the bottom-right corner of the server screen; it is used to clear console logs.

The Appium GUI for Mac

Similarly, Mac also has an Appium GUI for Android automation; a lot of options are common with Windows. Let's discuss all the settings that are present in the GUI. The following is the screenshot of the Appium GUI on Mac

The Appium GUI for Mac

It contains the following icons:

  • Android Settings
  • iOS Settings
  • General Settings
  • Developer Settings
  • Robot Settings
  • Save configuration
  • Open configuration
  • Inspector
  • Appium doctor
  • Launch/Stop
  • Delete

Android Settings

We have already seen Android Settings on the Windows platform; these settings are the same on Mac OS as well, but there are some UI changes in the Appium server, as shown in the following screenshot. The Android Settings are divided into two tabs, Basic and Advanced.

Android Settings

iOS Settings

To set up the iOS, we need to click on the iOS Settings icon. It contains two options, Basic and Advanced. Under Basic, we will have the subheadings Application and Device Settings, and under Advanced, we will get the advanced iOS settings.

iOS Settings

Application

The options present under the Application tab are listed in the following table, along with their descriptions:

Field

Description

App Path

In this field, we can specify the path of the iOS application (.app, .zip, or .ipa) that we want to test.

Choose

This is used to browse the path of the application.

BundleID

This denotes the bundle ID of the application.

Use Mobile Safari

In the case of mobile web apps, we can select this option to start the Safari browser. Make sure BundleID and App Path is unchecked.

Device Settings

The options present under the Device Settings tab are listed in the following table, along with their descriptions:

Field

Description

Force Device

You can select the simulator iPhone or iPad mode from the dropdown.

Platform Version

This is used to select the mobile platform version.

Force Orientation

This is used to set the orientation of the simulator.

Force Language

This is used to set the language for the simulator.

Force Calendar

Here, we can choose the calendar format for the simulator.

Force Locale

This denotes the locale for the simulator.

UDID

If the UDID box is checked, then Appium will run the application on the attached iOS device; you need to make sure that bundleID is supplied and App Path is unchecked.

Full Reset

This will delete the entire simulator folder.

No Reset

This specifies that the simulator should not reset the app between sessions.

Show Simulator Log

This will write the simulator log in the console, if checked.

Advanced

The options present under the Advanced tab are listed in the following table, along with their descriptions:

Field

Description

Use Native Instruments Library

If this box is checked, Appium will use the Native Instruments Library rather than the library that comes with Appium.

Backend Retries

We can specify the number to retry the launching of Instruments before the reporting crashes or times out.

Instruments Launch Timeout

This denotes the amount of time to wait for the Instruments to launch (in ms).

Trace Template Path

This traces the template file to use with Instruments.

Choose

This is used to browse the trace's template path.

Xcode Path

This denotes the path of the Xcode application.

We have already discussed General Settings, Developer Settings, Launch, and Delete in Appium for Windows. Now, let's take a look at Robot Settings.

Robot Settings

If you want automation using a robot, then you need to enable Robot Settings. In Robot Settings, Appium will ask for the host and port numbers where the robot is connected, as shown here:

Robot Settings

Save/Open configuration

Appium has a feature to save the settings; we don't need to specify the settings again and again while testing the apps. It allows you to tag the configuration file, after which you can easily find out the saved file on the basis of the tag color.

To save the configuration file, we need to perform the following steps:

  1. Click on the Save configuration icon; this will open the popup, as shown here:
    Save/Open configuration
  2. Specify the filename:
    Save/Open configuration
  3. Click on the Tags textbox; it will display the list of tags, as shown in the following screenshot. We can select more than one tag.
    Save/Open configuration
  4. Select the location where you want to save the file.

We just saw how easy it is to save the configuration file. Using the saved file, we can quickly set the configuration by clicking on the Open configuration icon (which is visible in the left-hand side of the Save configuration icon) and selecting the saved file.

Appium doctor

It will tell you about the Appium setup; you can verify the setup using the Appium doctor. Click on the Doctor button in between the Inspector and Save buttons; this will display the information in the Appium GUI console, as shown here:

Appium doctor

If you get any configuration error that something is not being set up, then try to resolve it before you start with Appium.

Inspector

Appium comes with a great piece of functionality such an the Inspector; it is a record and playback tool like Selenium IDE. We can easily generate the test script without hurdles.

It shows all the elements of the mobile app, like UIAutomator does in Android. Now, let's take a look at the Inspector. Here, we are going to take an example of the BMI calculator app in iOS, which is shown in the following screenshot. First, we need to click on the Save button before clicking on the Inspector button, and we also need to specify the app path.

In the Appium Inspector window, we can see the following fields:

Inspector
  • Show Disabled: This will display the elements that are not enabled
  • Record: This will open the recording panel in the bottom of the window, as shown in the following screenshot, and you can perform actions using controls in the Appium Inspector:
    Inspector
  • Refresh: This will refresh the DOM 3-column as well as the screenshot
  • Screenshot: This area will display the screenshot taken for the app, and you can also click in the area to select elements in the DOM
  • Details: This will contain details about the selected element

You will find some more options such as the Touch section, Text section, Alerts section, Locator, and Misc, which will further categorize into some buttons that can take an action on the application under test.

Let's take a look at the following options:

  • Touch: This contains buttons to execute touch events such as tap, swipe, shake, and scroll
  • Text: This contains buttons to execute text events, such as typing and firing the JavaScript
  • Locator: This is a useful option provided by Appium; by using this, we can check whether the elements exist or not on the basis of locators.
  • Misc: This contains the buttons that can handle the alerts

The Recording panel

This panel contains the test scripts generated by the recorded actions that are performed on the application. It also contains some options that we can take on the recorded test scripts. Let's take a look at the panel's options:

  • A dropdown for language selection: You can change the recorded test scripts' language from the dropdown (in the screenshot, we selected Java)
  • Add Boilerplate: This will display the code with the Selenium instance along with the recorded scripts; otherwise, this will only show the code from the actions you have recorded
  • XPath Only: This will generate the scripts using the XPath identifier only
  • Replay: By clicking on the Replay button, we can execute the recorded scripts
  • Undo: This will delete the last recorded action
  • Redo: This will add the last undone action back
  • Clear: This will clear the recorded actions
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.46.175