VNC Plugin Reference/en: Unterschied zwischen den Versionen
Cg (Diskussion | Beiträge) |
Cg (Diskussion | Beiträge) |
||
Zeile 15: | Zeile 15: | ||
* [-] the geometry information (i.e. the location of widget elements) is kept inside expecco, and cannot be queried from the application. |
* [-] the geometry information (i.e. the location of widget elements) is kept inside expecco, and cannot be queried from the application. |
||
In view of those limitations, you should use the VNC plugin, if no other plugin is usable with the application. i.e. if one of the following applies: |
|||
* it is written in C/C++ and cannot be instrumented or recompiled |
* it is written in C/C++ and cannot be instrumented or recompiled |
Version vom 24. Januar 2017, 20:54 Uhr
Inhaltsverzeichnis
Introduction[Bearbeiten]
The VNC plugin interfaces to local or remote applications via the RFB protocol, which enables interaction with a remote screen on any other machine in the network.
Using VNC has one big advantage, and a number of disadvantages:
- [+] it allows interaction with and the testing of almost any application, and no instrumentation or recompilation of the tested application is needed, given that a VNC-server is be running and reachable on the target system. VNC servers are available or already installed on almost any operating system or device, even for embedded control systems, head units in cars, etc.
- [-] whilst all other UI testing plugins interact with the tested application directly, via a protocol which enables expecco to reflect (query) on internals of the app (especially its wieget element hierarchy and the attribute values), the VNC interface can only show the screen's or window's pixels, and can only send events based on screen coordinates. With VNC, expecco cannot ask the application about the position of GUI elements and cannot ask or any internal attribute values.
- [-] the VNC plugin cannot provide the values of internal attributes of widget elements (text, labels, enable state etc.)
- [-] VNC is very sensible to changes in the layout and look of the application.
- [-] the geometry information (i.e. the location of widget elements) is kept inside expecco, and cannot be queried from the application.
In view of those limitations, you should use the VNC plugin, if no other plugin is usable with the application. i.e. if one of the following applies:
- it is written in C/C++ and cannot be instrumented or recompiled
- it is written in Java and the JVM cannot be started with additional jars being loaded or the JVM provides no debugging interface (i.e. embedded Java)
- it runs under Windows and does not support the Accessability API
- it is an old style (hand-written) X-windows application (Xt or non-widget library)
Philosophy[Bearbeiten]
To allow for a maximum of flexibility, the VNC plugin uses description objects, which describe where and how to find UI elements. These descriptions are called "Screenplays" and are typically stored in attachments inside the test suite. Each screenplay describes the ui elements of an application. It is structured into multiple "Scenes", which correspond to pages/tabs or states of the application. Whenever the application changes its widget layout (i.e. changes to another UI-hierarch or UI-layout), a new stage-description is activated. Finally, each stage contains the players (UI-elements), and descriptions on how to find them.
The testsuite refers to UI-elements by scene- and elemnt identifiers, and the current active scene provides the information of where and how to find them on the screen.
Preparation of the System Under Test[Bearbeiten]
You need a VNCserver to be installed an running on the target system. Any freely available or commercial VNC/RFB server should work out of the box.
Locators[Bearbeiten]
Inside the suite, elements are referred to by their elementID inside the current scene. For example, a "Button-Press" action takes the elementID (a string), the button number and the position relative to the wiegdet's origin as argument. expecco will then find the element's geometry info in the scene, translate the coordinates to screen coordinates, and send a VNC button-press to the screen.
Currently, two kinds of locators are supported: - bounds - bitmap
Bounds Locator[Bearbeiten]
With bounds, the origin+corner (i.e. the rectangular bounds) of the element are stored in the scene, and this is used to locate the element - independent of what is actually shown on the screen. This kind of locator is especially useful, if you can get the geometry information from the widget developers, or when the position of the elements remains constant, but the look is changing often.
Bitmap Locator[Bearbeiten]
Here, a "prototype bitmap" is kept in the scene information, and the bitmap is "searched" on the screen. This makes the test less affected by changes in the exact position of the element, but more affected by changes in the look (i.e. changed icons or changed labels).
Zur Verbindung mit den Geräten wird Appium verwendet. Appium ist ein freies Open-Source-Framework zum Testen und Automatisieren von mobilen Anwendungen.
Dieses Dokument bezieht sich auf das Mobile Testing Plugin ab der expecco-Version 2.10. Die Dokumentation für Version 2.9 finden Sie unter Appium Plugin Reference.
Zur Einarbeitung in das Mobile Plugin empfehlen wir das Tutorial zu bearbeiten. Dieses führt anhand eines Beispiels Schritt für Schritt durch die Erstellung eines Testfalls und erklärt die nötigen Grundlagen.