Appium Plugin Reference en: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Ff (Diskussion | Beiträge) |
(Weiterleitung nach Mobile Testing Plugin erstellt) |
||
(4 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
#REDIRECT[[Mobile Testing Plugin]] |
|||
= Introduction = |
|||
[[Category:Temporary Short Redirect]] |
|||
Appium is a free open source framework for testing and automation of mobile applications. These tests can be performed either on real mobile devices or on emulated devices. Regarding expecco, both Android and iOS devices are supported. With its Appium plugin expecco offers an interface for executing tests using the Appium framework. |
|||
The first chapter of this document describes the use of the Appium bundle, the Android SDK and the JDK customized by eXept Software. With this compilation you can quickly implement the first tests. |
|||
The first section of the chapter explains how to install the bundle on your operating system. If you have already installed the bundle, you can skip this section. |
|||
Following describes how you can start the individual components of the bundle. To get a quick impression of our Appium implementation, at the end of the chapter a short tutorial describes how you can perform initial tests using the bundles. |
|||
The second chapter is based on an exemplary test setup the Appium plugin and its interaction with the Appium server, and explains testing of mobile applications. The focus is placed on the technologies employed to allow developers a starting point for independent development of modules or to expand the existing function library. |
|||
= Setup = |
|||
== Installation of the Bundle == |
|||
To quickly perform your first steps with mobile testing in expecco you can download the Appium Bundle here: https://download.exept.de/transfer/h-expecco-2.8.0/appiumBundleSetup-1.2.exe. |
|||
The download consists of a single installation file. After the download you can start the installation by double-clicking on the file. Then follow the instructions on the screen and choose where to install the bundle. During the installation process the Appium app might start. You may close it as for the test the Appium server will be launched directly. |
|||
The PATH environment variable must be extended by the directory in which the adb.exe is located. In order to do this, please search the system control for the environment variables. Double-click on the variable named PATH in order to modify it. If no variable exists with this name, please generate a new one and specify the path of the directory that contains adb.exe, or attach it (separated by a semicolon)to the existing value of the variable. The path usually has the form of '' C: \ Program Files (x86) \ exept \ Appium Bundle \ android-sdk \ platform-tools'.'' |
|||
== Launching the Appium Server == |
|||
The bundle includes an Appium server that enables communication between expecco and the tester. You can start directly from shortcut on your desktop that was created during installation. Alternatively, you can also start the batch file "start_appium.bat" in the installation directory of the bundle. A window with a console on which the server is running and its log messages are output is openend . The server is ready, when the first log messages appear. |
|||
== Connecting a mobile device == |
|||
Before you can control a mobile device with the Appium plugin, you must allow for USB debugging. For Android devices, please see the settings under '' Developer options '' (see https://www.droidwiki.de/USB-Debugging). When a device is connected to the PC via USB, you may have to accept the setup of the connection to the device. |
|||
== Connection via the Appium connection dialog == |
|||
After lauching the Appium server and a device is connected via USB, you can setup a connection to a mobile application in expecco. Switch to expecco in the GUI browser where you can select 'Connect' and then select ' 'Appium' ' from the appearing drop-down menu. |
|||
[[Datei:AppiumGUIBrowser.png|border|]] |
|||
Thereupon the Appium connection dialog opens (see screenshot), in which you configure the desired parameters for the connection. |
|||
First, enter the address of the Appium server in the input box. By default, the Appium server on port '' 4723 '' is started. So enter the following: |
|||
<nowiki>http://<IP des Appium Hostrechners>:4723/wd/hub</nowiki> |
|||
As a next step you need to specify the configuration for the connection. For that, the Appium server requires so-called Capabilities. |
|||
For tests on Android, it is advisable to use the Android Wizard. The Android Assistant allows you to automatically fill capabilities for any USB-attached devices. |
|||
[[Datei:Appium GUI AndroidWizard.png|border|600px|]] |
|||
By clicking on '' Android Wizard ' the configuration wizard opens (see screenshot). Using this wizard, you can make the standing on available configurations via drop-down menus. |
|||
[[Datei:Appium Settings showSystemPackages.png|border|400px|]] |
|||
In the top field, please select the device with which you want to connect. In the drop-down menu are all accessible devices. After that the packets on the device are retrieved, this may take a few moments. The packets are divided into external packages and system packages. Your installed applications are among the foreign packages. If havn't installed any application so far, you can choose the calculator for example, which is already on the device. To do so, select the system packages. In the box below, you can enter a filter to reduce the list of packages. Enter '' Calc '' as a filter and you will find the calculator easier. (Depending on the device, the package is named differently, but still includes 'calculator' ') and select the package, and then in the bottom drop-down menu Activity from this package (z. B.' '. Calculator ''). When you click OK, the capabilities are set according to your choice. |
|||
[[Datei:AppiumSettingsWizard.png| 600px|]] |
|||
If you prefer to enter the Capabilities manually, please select the desired capabilities from the bottom left of the dropdown box . To add them to the configuration, click '' Add ''. Then you can enter the appropriate values for each Capabilities in the list. Using '' Remove '' you can delete registered Capabilities from the list. |
|||
he following capabilities are necessary for a connection setup: |
|||
* PlatformName: Select if you want to automate an Android or an iOS app. |
|||
* UDID: Select here on which device you want to automate the app, for example, '' emulator-5554 '' |
|||
For Android apps the following capabilities are additionally required: |
|||
* AppPackage: Please enter the package of the app to be automated, e.g. '' com.apple.calculator '' |
|||
* AppActivity: Please enter the Activity within the package, e.g. '' .Calculator '' |
|||
For iOS apps the following capabilities are additionally required: |
|||
* BundleId: Please enter the bundle ID of the app to be automated, e.g. ''com.apple.calculator '' |
|||
You will find more information on available capabilities here: |
|||
http://appium.io/slate/en/master/?java#appium-server-capabilities |
|||
After you have added all the capabilities, you can '' Save '' your settings to a file. Next time, you may import them via '' Load from file '' or use them in your tests. |
|||
By clicking on '' Connect '' you start to connect with the specified settings. |
|||
== Create tests with the Appium recorder == |
|||
Once you have setup a connection with a device, you can start the Appium recorder using the recording icon in the GUI browser. |
|||
[[Datei:AppiumRecorder.png|1000px|]] |
|||
In the menu bar, you can click on '' action '' to select the action you want to execute. The default value is '' touch '', which triggers a clicking on the selected item. You can now perform an action using the mouse by clicking on the display of the recorder, for example, on a figure of the calculator. You can see that the action on the device is running and the recorder is reloading the current screen contents of the device. In addition, a corresponding block is created in the work space of the GUI browser . |
|||
You can choose from the following actions: |
|||
* Actions |
|||
** '' Swipe '': Swipe across the screen from the position where you press the mouse up to the position where you release it. The duration is also considered. |
|||
** '' Tapping ': Tapping the screen at the cursor position with the same duration as your mouse is pressed (helpful for Long-click). |
|||
** '' Touch element '': similar to tapping, but for the item at the cursor position. |
|||
** '' Touch '': short touch of the element at the cursor position (click). |
|||
** '' Zoom '': not implemented yet. |
|||
** '' Set text '': after clicking on an item you can enter the text which is to be filled in; this only works for input fields. |
|||
* Test & Verify |
|||
** '' Compare attribute '': After clicking on an item, you can select one of its attributes. This will create a branch block, which compares the value of the attribute at the time of the tests with the specified value. |
|||
** '' Verify attribute '': After clicking on an item, you can select one of its attributes. This will create a block that fails when the value of the attribute does not comply with the specified value at the time of the test. |
|||
You can also use the four icons on the right-hand side to trigger the keys '' Home '', '' Previous '' '' menu '' and '' Power ''. |
|||
When recording the actions the blocks in the workspace are created linearly. You can also simply change the flow there, for example by using branching blocks or adding additional modules. Using the icon in the upper right corner, you can create the workspace as a new module in your test suite. |
|||
To run tests with these devices later on, you need to implement the '' Connect '' block from the Appium library at the beginning of the test - and at the end a '' Disconnect '' block accordingly. If you want to generate the Capabilities for the '' Connect '' - module you can use the module '' Read from File Capabilities, which is able to read a file created in the connection dialog. |
|||
== Disconnection == |
|||
In order to terminate an existing connection, perform a right-click on the connection entry in the GUI browser and select '' Remove connection '' or '' Disconnect and remove entry ''. In this way, the connection from Appium to the device under test is terminated. Only then, disconnect the device from the PC. You can stop the Appium server by closing the console window. |
|||
= Developer Guide = |
|||
== Architecture and Technologies == |
|||
The connection to the Appium test framework was implemented via the 'Appium Driver', an advanced version of Selenium WebDriver. This interface is based on HTML and JavaScript and was functionally enhanced so that it can be used as an interface to the Appium server and thus the services can be used for testing mobile applications. These two components communicate via the JSON Wire Protocol. |
|||
Currently, Appium supports testing on iOS and Android systems. Basically, the tests can be written in any programming language. However, when you create the tests you need to define the system on which the application under test is located. The server corresponds with this definition, selects the actions to be executed and sends these commands in a comprehensible form to the devices on the target system. As middleware for Android systems, the Android Debug Bridge is used. For iOS systems, Instruments is used. |
|||
[[Datei:appium_architekturskizze_mit_konsolenfenster.png | 650px|]] |
Aktuelle Version vom 12. Februar 2018, 16:17 Uhr
Weiterleitung nach: