https://doc.expecco.de/w2.x/api.php?action=feedcontributions&user=Mb&feedformat=atomexpecco Wiki (Version 2.x) - Benutzerbeiträge [de]2024-03-29T04:39:35ZBenutzerbeiträgeMediaWiki 1.33.0https://doc.expecco.de/w2.x/index.php?title=Compound_Network_Editor&diff=29222Compound Network Editor2024-03-12T10:19:43Z<p>Mb: Weiterleitung nach Compound Network Editor/en erstellt</p>
<hr />
<div>#redirect [[ Compound_Network_Editor/en ]]</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Release_Notes_23.x&diff=28142Release Notes 23.x2023-06-23T08:24:12Z<p>Mb: /* Release 23.1 */</p>
<hr />
<div>See also: [[Release Notes 22.x]]<br />
<br /><br />
<br />
== Release 23.1 ==<br />
*Feature: [[Environment_Editor/en#Fields|Static (Step-) Variables]]<br />
*Feature: Continue an interrupted test plan (i.e. even in a new expecco session and/or on another machine) <br />
*Feature: Webtest (Selenium WebDriver): Support of [[Selenium_WebDriver_Plugin/en#Compound_Paths|compound paths]] for embedded elements.<br />
*Feature: Webtest (Selenium WebDriver): [[Selenium_WebDriver_Plugin/en#Recorder|Recorder]] shows available windows and the current frame context.<br />
*Feature: Webtest (Selenium WebDriver): Support of [[Selenium_WebDriver_Plugin/en#Shadow_Elements|shadow elements]] in the GUI browser and recorder, accessible by compound paths.<br />
*Feature: Qt-Plugin supports Qt6 ([[QT_Testing/en#ExpeccoTestService_Library%3A_Delivery_in_Expecco_Versions|Qt-Versions]])<br />
*Feature: Expecco Remote Control & Monitoring Service with Web Front-End (App for Android or Apple IOS is available on request) ([[expecco Mobile Remote App/en|expecco Mobile Remote App]])<br />
*Feature: Diagram Editor: default style for new connections<br />
*Feature: Diagram Editor: shortcut keys for environment-freeze and others<br />
*Feature: Diagram Editor: connections can be named<br />
*Feature: User defined menu operations: Activity-Log in case of an error<br />
*Feature: Zip-Archive viewer/extractor/inspector in [[Attachment_Editor/en#Zip_Archive_Inspector | attachment editor]]<br />
*Feature: ManualTest actions are now part of the base system; the extra plugin licence is only needed to import Excel test descriptions<br />
*Feature: Logging with microsecond resolution timestamps now works in windows (if enabled in the settings) <br />
*Feature: Support XML report file fetching vi the REST interface<br />
*Feature: PCAN (USB Can-Bus Adapter) is now supported in 64-bit expecco<br />
*Feature: Folders can pass Tags to new sub-elements (inherit)<br />
*Feature: Menu entry to set Test Groups for Tree Elements<br />
*Standard Library: Warning Dialog with Opt-out option (show only once)<br />
*FMU/CBridge: [[Functional Mockup Interface | support FMI2 API; partial support for FMI3]]<br />
*FMU/CBridge: download resources to CBridge (eg. unifmu generated python FMUs work)<br />
*Base System: nth-root: lost precision when applied to higher than 64bit floats.<br />
*Base System: LargeFloats rounding was broken<br />
*Fix: WSDL import with namespace redefinitions</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Mobile_Testing_Plugin&diff=24502Mobile Testing Plugin2021-10-28T14:35:29Z<p>Mb: /* Hybrid-Apps und WebViews */</p>
<hr />
<div>= Einleitung =<br />
Mit dem ''Mobile Testing Plugin'' können Anwendungen auf Android- und iOS-Geräten getestet werden. Dabei ist es egal, ob reale mobile Endgeräte oder emulierte Geräte verwendet werden. Das Plugin kann (und wird üblicherweise) zusammen mit dem [[Expecco_GUI_Tests_Extension_Reference|GUI-Browser]] verwendet werden, der das Erstellen von Tests unterstützt. Zudem ist damit das Aufzeichnen von Testabläufen möglich.<br />
<br />
Zur Verbindung mit den Geräten wird [http://appium.io/ Appium] verwendet. Appium ist ein freies Open-Source-Framework zum Testen und Automatisieren von mobilen Anwendungen.<br />
<br />
Zur Einarbeitung in das Mobile Plugin empfehlen wir das [[#Tutorial|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.<br />
<br />
= Installation und Aufbau =<br />
Zur Verwendung des Mobile Testing Plugins müssen Sie expecco inkl. des Plugins Mobile Testing installiert haben und Sie benötigen die entsprechenden Lizenzen. expecco kommuniziert mit den Mobilgeräten über einen Appium-Server, der entweder auf demselben Rechner wie expecco läuft, oder auf einem zweiten Rechner. Dieser muss für expecco erreichbar sein.<br />
<br />
==Installationsübersicht==<br />
<br />
'''Rechner, auf dem expecco läuft:'''<br />
* Java JDK Version 8, 9, 10, 11 oder neuer <sup>1)</sup><br />
'''Rechner, an dem Android-Geräte angeschlossen sind:'''<br />
* Appium-Server'', diesen können Sie über das Mobile Testing Supplement installieren (s.u.), von dem wir regelmäßig einen neue Version zur Verfügung stellen''<br />
* Android SDK'', dieses erhalten Sie ebenfalls mit dem Mobile Testing Supplement''<br />
* Java JDK Version 8, 9, 10, 11 oder neuer <sup>1)</sup><br />
'''Rechner, an dem iOS-Geräte angeschlossen sind<sup>2)</sup>:'''<br />
* Appium-Server'', diesen können Sie über das Mobile Testing Supplement für Mac OS installieren (s.u.), von dem wir regelmäßig einen neue Version zur Verfügung stellen''<br />
* Xcode ''in einer Version, die die verwendete iOS-Version unterstützt, erhältlich über den Apple App Store''<br />
* Java JDK Version 8, 9, 10, 11 oder neuer <sup>1)</sup><br />
* Apple-Entwickler-Zertifikat mit zugehörigem privaten Schlüssel ''(zum Signieren des WebDriverAgents)''<br />
* Provisioning Profile mit den verwendeten Mobilgeräten<br />
<br />
<br />
Je nach Aufbau können die oben genannten Rechner auch das selbe Gerät sein. expecco kann sich sowohl über das Netzwerk mit einem entfernten Appium-Server und dort angeschlossenen Mobilgeräten verbinden, als auch lokal selbst einen Appium-Server starten und diesen mit lokalen Mobilgeräten verwenden. Einige Funktionen von expecco, die die Erstellung von Testfällen erleichtern, sind jedoch nur verfügbar, wenn die Mobilgeräte am selben Rechner angeschlossen sind, auf dem auch expecco läuft. Ein möglich Aufbau kann daher wie in folgender Abbildung aussehen:<br />
<br />
[[Datei:MobileTestingAufbau.png | 400px]]<br />
<br />
Im Folgenden wird die Installation von Appium und anderer nötiger Programme für Windows und Mac OS erklärt.<br />
<br />
<sup>1)</sup>: Zum Zeitpunkt der Erstellung dieses Dokuments wurden Versionen bis 11 auf Funktion verifiziert. Neuere Versionen sollten - sofern nicht grundlegende Änderungen von Oracle vorgenommen wurden, ebenfalls funktionieren.<br />
<br />
<sup>2)</sup>: Beachten Sie, dass aufgrund der Voraussetzungen (keine Anbindung an nicht-Apple Geräte verfügbar) iOS-Geräte nur von einem Mac aus angesteuert werden können. Sie benötigen also einen Mac als "Vermittler" (siehe auch unten: [[#Ich habe keinen Mac | "Ich habe keinen Mac"]])<br />
<br />
== Windows ==<br />
Am einfachsten installieren Sie alles mit unserem Mobile Testing Supplement <sup>1</sup>. In neueren Versionen ist allerdings aufgrund geänderter Lizenzbedingungen seitens Oracle kein JDK mehr enthalten, sodass sie dieses zusätzlich instalieren müssen.<br />
*'''expecco 20.1''': [https://download.exept.de/transfer/h-expecco-20.1.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.10.1.0]<br />
:Nur kleine Änderungen im Vergleich zur vorigen Version.<br />
*expecco 19.2: [http://download.exept.de/transfer/h-expecco-19.2.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.10.0.0]<br />
:Im Vergleich zur vorigen Version wurde Appium auf die Version 1.16.0-rc.1 aktualisiert und node 12 verwendet. <br />
*expecco 19.1: [http://download.exept.de/transfer/h-expecco-19.1.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.8.1.0]<br />
:Dieses installiert Appium in der Version 1.12.0 und enthält nun zusätzlich build-tools der Version 28.0.3 im android-sdk. Ansonsten ist es gleich wie die vorige Version.<br />
*expecco 18.2: [http://download.exept.de/transfer/h-expecco-18.2.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.7.3.0]<br />
:Dieses installiert Appium in der Version 1.8.1. Außerdem bietet das Supplement auch an, ''Android Debug Bridge'' und ''Google USB Driver'' ([https://gsmusbdrivers.com/download/adb-fastboot-drivers/ adb-setup-1.4.3]) zu installieren. Damit sind Treiber für ein breites Spektrum an Android-Geräten abgedeckt, sodass Sie nicht für jedes Gerät einen eigenen Treiber suchen und installieren müssen. Ein '''JDK ist (aufgrund geänderter Lizenzbedingungen seitens Oracle) nicht mehr enthalten''', dieses müssen Sie selbst herunterladen, z.B. von [https://www.oracle.com/technetwork/java/javase/downloads/index.html Oracle].<br />
*expecco 18.1: wie expecco 2.11<br />
*expecco 2.11: [http://download.exept.de/transfer/h-expecco-2.11.1/MobileTestingSupplement_1.6.0.2_Setup.exe Mobile Testing Supplement 1.6.0.2]<br />
:Dieses installiert ein Java JDK der Version 8, android-sdk und Appium in der Version 1.6.4. Außerdem bietet das Supplement auch einen universellen adb-Treiber ([http://download.clockworkmod.com/test/UniversalAdbDriverSetup.msi ClockworkMod]) an. Dieser vereint Treiber für ein breites Spektrum an Android-Geräten, sodass Sie nicht für jedes Gerät einen eigenen Treiber suchen und installieren müssen.<br />
*expecco 2.10: [http://download.exept.de/transfer/h-expecco-2.10.0/Mobile_Testing_Supplement_1.5.0.0_Setup.exe Mobile Testing Supplement 1.5.0.0]<br />
:Dieses installiert ein Java JDK der Version 8, android-sdk und Appium in der Version 1.4.16. Während der Installation wird die grafische Oberfläche von Appium gestartet, dieses Fenster können Sie sofort wieder schließen. Außerdem bietet das Supplement auch einen universellen adb-Treiber ([http://download.clockworkmod.com/test/UniversalAdbDriverSetup.msi ClockworkMod]) an. Dieser vereint Treiber für ein breites Spektrum an Android-Geräten, sodass Sie nicht für jedes Gerät einen eigenen Treiber suchen und installieren müssen.<br />
<br />
Wenn expecco Mobilgeräte verwenden soll, die an einem anderen Rechner angeschlossen sind, müssen Sie dort einen Appium-Server starten. Dies können Sie mit der Datei <code>appium_standalone.cmd</code> tun. Der Server wird dann mit dem Standard-Port 4723 gestartet. Falls Sie eine andere Portnummer verwenden wollen, starten Sie den Server mit<br />
<br />
appium_standalone.cmd -p <portnummer><br />
<br />
Der Server ist bereit, sobald die Zeile<br />
<blockquote>Appium REST http interface listener started on 0.0.0.0:4723</blockquote><br />
angezeigt wird, wobei Sie am Ende die verwendete Portnummer ablesen können.<br />
<br />
Beim ersten Starten von Appium – sowohl im Standalone als auch gestartet von expecco – kann es vorkommen, dass die Windows-Firewall den Node-Server blockiert. Lassen Sie den Zugriff zu, sonst kann Appium nicht gestartet werden.<br />
<br />
<sup>1</sup>) Sie können natürlich auch die Command Line Tools (adb, sdkmanager, avdmanager etc.) einer vorhandenen Android Studio Version verwenden, sowie Appium separat installieren.<br />
Da sich diese Tools regelmäßig ändern, und es in der Vergangenheit zu Inkompatibilitäten und Fehlern nach Releasewechseln kam, empfehlen wir zu Beginn, das mitgelieferte Paket zu verwenden. Dies ist möglicherweise nicht das aktuellste, wurde aber auf Lauffähigkeit getestet.<br />
<br />
Falls das Android Mobilgerät an einem entfernen Rechner angeschlossen ist,<br />
können Sie den aktuellen Bildschirminhalt z.B. mit dem [https://github.com/Genymobile/scrcpy scrcpy] tool live mitverfolgen.<br />
<br />
== Mac OS ==<br />
Hinweis: Wenn Sie nicht vorhaben, iOS-Geräte (iPhone, iPad, etc.) zu testen, können Sie das Folgende ignorieren. '''Der Apple-Rechner sowie das Mac-Setup werden für Android-Geräte nicht benötigt'''.<br />
<br />
=== Xcode ===<br />
Zur Automatisierung mit iOS-Geräten wird [https://developer.apple.com/xcode/ Xcode] benötigt. Sie erhalten dieses über den App Store. Dabei ist darauf zu achten, dass die Version zu den getesteten iOS-Versionen passt:<br />
{| class="wikitable"<br />
|-<br />
|'''iOS'''&nbsp;&nbsp; <br />
|'''Xcode'''<br />
|'''macOS'''<br />
|-<br />
|10.x<br />
|8.x<br />
|10.12 (Sierra)<br />
|-<br />
|11.x<br />
|9.x<br />
|10.13 (High Sierra)<br />
|-<br />
|12.x<br />
|10.x<br />
|10.14 (Mojave)<br />
|-<br />
|13.x<br />
|11.x<br />
|10.15 (Catalina)<br />
|}<br />
Ebenso müssen die Minor-Versionen passen, d.h. <br />
* für iOS 10.'''2''' mindestens Xcode 8.'''2''', <br />
* für iOS 10.'''3''' mindestens Xcode 8.'''3''', <br />
* usw. <br />
Wenn Sie also auf eine neuere iOS-Version wechseln, benötigen Sie in der Regel auch eine neuere Xcode-Version. Neuere Versionen von Xcode laufen möglicherweise nicht auf älteren Betriebssystemen, was wiederum eine Aktualisierung des Betriebssystems erforderlich machen kann. Falls Sie auch ältere iOS-Versionen testen wollen kann es sinnvoll sein, die entsprechenden Xcode-Versionen parallel zu installieren.<br />
<br />
Siehe auch [https://en.wikipedia.org/wiki/Xcode#Version_comparison_table Xcode-Versionen].<br />
<br />
=== Appium ===<br />
Appium können Sie über das Mobile Testing Supplement für Mac OS istallieren:<br />
* '''expecco 20.2''': [https://download.exept.de/transfer/h-expecco-20.2.0/Mobile_Testing_Supplement_for_Mac_OS.tar.bz2 Mobile Testing Supplement für Mac OS (1.2.2)]<br />
:Enthält Appium Version 1.18.3 und verwendet node 14.<br />
<br />
* expecco 20.1: [https://download.exept.de/transfer/h-expecco-20.1.0/Mobile_Testing_Supplement_for_Mac_OS.tar.bz2 Mobile Testing Supplement für Mac OS (1.2.0)]<br />
:Nur wenige Änderungen im Vergleich zur vorigen Version.<br />
<br />
* expecco 19.2: [http://download.exept.de/transfer/h-expecco-19.2.0/MobileTestingSupplement_for_MacOS.tar.bz2 Mobile Testing Supplement für Mac OS (1.1.98)]<br />
:Im Vergleich zur vorigen Version wurde Appium auf die Version 1.16.0-rc.1 aktualisiert und es wird node 12 verwendet. <br />
<br />
* expecco 19.1: [http://download.exept.de/transfer/h-expecco-19.1.0/Mobile_Testing_Supplement_for_Mac_OS_1.1.96.tar.bz2 Mobile Testing Supplement für Mac OS (1.1.96)]<br />
:Diese Version enthält Appium 1.12.0. <br />
<br />
* expecco 18.1: [http://download.exept.de/transfer/h-expecco-18.1.0/Mobile_Testing_Supplement_for_Mac_OS_1.1.94.tar.bz2 Mobile Testing Supplement für Mac OS (1.1.94)]<br />
:Diese Version enthält Appium 1.8.0.<br />
<br />
* expecco 2.11: [http://download.exept.de/transfer/h-expecco-2.11.1/Mobile_Testing_Supplement_for_Mac_OS_1.0.94.tar.bz2 Mobile Testing Supplement für Mac OS (1.0.94)]<br />
:Diese Version enthält Appium 1.6.4.<br />
<br />
* expecco 2.10: [http://download.exept.de/transfer/h-expecco-2.10.0/Mobile_Testing_Supplement_for_Mac_OS_1.0.tar.bz2 Mobile Testing Supplement für Mac OS]<br />
:Diese Version entält Appium 1.4.16.<br />
<br />
Nachdem Herunterladen des Supplements, können Sie es in ein Verzeichnis Ihrer Wahl (z. B. Ihr Home-Verzeichnis) verschieben und dort entpacken. Ein geeigneter Befehl in einer Shell könnte wie folgt aussehen, passen Sie dabei die Versionsnummer entsprechend an:<br />
<br />
tar -xvpf Mobile_Testing_Supplement_for_Mac_OS_1.1.98.tar.bz2<br />
<br />
Wenn Sie Ihre Standard-Xcode-Installation verwenden wollen, können Sie Appium direkt über die Datei im ''bin''-Verzeichnis mit der entsprechenden Versionsnummer starten:<br />
<br />
Mobile_Testing_Supplement/bin/start-appium-1.16.0-rc.1<br />
<br />
Falls Sie ein anderes Xcode als das als Standard konfigurierte verwenden wollen, müssen Sie Appium den entsprechenden Pfad über die Umgebungsvariable ''DEVELOPER_DIR'' angeben. <br />
Wenn Sie Xcode z. B. in ''/Applications/Xcode-11.3.app'' installiert haben, müssten Sie Appium so starten:<br />
<br />
DEVELOPER_DIR="/Applications/Xcode-11.3.app/Contents/Developer" Mobile_Testing_Supplement/bin/start-appium-1.16.0-rc.1<br />
<br />
Was als Standard-Xcode-Installation gesetzt ist, zeigt der Befehl:<br />
<br />
xcode-select -p<br />
<br />
Wenn Appium Ihre Xcode-Installation nicht findet, erscheint beim Verbinden eine Fehlermeldung in der Art:<br />
''<blockquote>org.openqa.selenium.SessionNotCreatedException - A new session could not be created. (Original error: Could not find path to Xcode, environment variable DEVELOPER_DIR set to: /Applications/Xcode.app but no Xcode found)</blockquote>''<br />
Starten Sie in diesem Fall Appium erneut, unter Angabe eines gültigen ''DEVELOPER_DIR''.<br />
<br />
=== Signierung ===<br />
Um eine Testverbindung mit einem Gerät aufbauen zu können, brauchen Sie einen Apple-Account. Zur Evaluierung können Sie einen kostenlosen Account verwenden. Dieser hat den Nachteil, dass erstellte Profile nur eine Woche gültig sind und danach neu erstellt werden müssen. Seien Sie auch vorsichtig, wenn Sie sich den Account teilen, da es vorkommen kann, dass Zertifikate widerrufen werden oder durch automatische Generierung ungültig werden. Als Folge können bereits signierte Apps nicht mehr verwendet werden.<br />
<br />
Schließen Sie zuerst das Gerät, das Sie verwenden möchten, über USB an den Mac an. Starten Sie Xcode und öffnen Sie ''Preferences''. Wechseln Sie zur Seite der Accounts und legen Sie einen Eintrag mit Ihrem Account an. Anschließend können Sie auf ''Manage Certificates...'' klicken, um die Zertifikate zu sehen, die zu diesem Account gehören. Zum Ausführen von Tests benötigen Sie ein iOS-Development-Zertifikat und den dazugehörigen privaten Schlüssel. Wenn Sie noch keines besitzen, erstellen Sie eines. Wenn Sie bereits eines haben, aber es nicht in Ihrem Schlüsselbund vorhanden ist (erkennbar an dem Hinweis "Not in Keychain"), können Sie es importieren. Öffnen Sie in jedem Fall die [https://support.apple.com/de-de/guide/keychain-access/welcome/mac Schlüsselbundverwaltung] auf dem Mac und wählen Sie den Schlüsselbund ''Anmeldung'' aus. Wenn im Schlüsselbund eines anderen Nutzers bereits ein entsprechendes Zertifikat angelegt ist, können Sie dieses dort als PKCS#12-Datei (Endung typischerweise .p12) exportieren. Um ein Zertifikat in Ihren Schlüsselbund zu importieren, wählen Sie im Menü ''Ablage'' die Option ''Objekte importieren''. Falls Sie nicht wissen, wo das Zertifikat gespeichert ist, können Sie es in Xcode auch widerrufen und in Ihrem Schlüsselbund neu anlegen. Machen Sie das jedoch nur, wenn Sie wissen, dass das alte Zertifikat nicht mehr in Verwendung ist, da es danach nicht mehr benutzt werden kann. Nun sollte der Schlüsselbund ein iOS-Development-Zertifikat enthalten. Wählen Sie im Rechtsklick-Menü den Punkt ''Informationen'' aus. Unter den Details des Zertifikats finden Sie die Team-ID, die hier als Organisationseinheit bezeichnet wird. Tragen Sie diese in den Einstellungen des Plugins im Feld ''Team-ID'' ein, siehe [[#Konfiguration_des_Plugins|Konfiguration des Plugins]].<br />
<br />
Kehren Sie zu Xcode zurück und wählen Sie im Menü ''File'' den Eintrag ''Open...'', um das WebDriverAgent-Projekt zu öffnen. Dieses befindet sich im Verzeichnis des Mobile Testing Supplements unter<br />
''<nowiki>Mobile_Testing_Supplement/lib/node_modules/appium-1.16.0-rc.1/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj</nowiki>''<br />
<br />
[[Datei:MobileTestingWebDriverAgentXcode.png]]<br />
<br />
Wählen Sie ''WebDriverAgentLib'' und die Seite ''Signing & Capabilities'' aus. Setzen Sie dort im Abschnitt ''Signing'' die Option ''Automatically manage signing'' und wählen Sie dann ein Team aus. Wechseln Sie nun zu ''WebDriverAgentRunner'' und tun Sie dort dasselbe.<br />
<!--(Das Folgende scheint nicht mehr aktuell zu sein.) Es sollten an dieser Stelle Fehler angezeigt werden, dass kein Provisioning Profile angelegt oder gefunden wurde. Wechseln Sie deshalb zur Seite ''Build Settings'' und suchen Sie hier im Abschnitt ''Packaging'' den Eintrag ''Product Bundle Identifier''. Ändern Sie diesen von com.facebook.WebDriverAgentRunner zu etwas, das von Xcode akzeptiert wird, indem Sie den Präfix ändern. Xcode kann nun ein passendes Provisioning Profile generieren und die Fehler auf der General-Seite sollten verschwinden. Danach können Sie Xcode beenden. --><br />
Durch das Setzen des Teams sollten die Fehler für den WebDriverAgentRunner verschwinden. Danach können Sie Xcode beenden.<br />
<br />
Wenn Sie sich nun von expecco eine Verbindung zu Ihrem Gerät aufbauen, wird der WebDriverAgent darauf installiert und gestartet, um anschließend zur zu testenden App zu wechseln. Auf dem Gerät muss jedoch noch der Ausführung des WebDriverAgents vertraut werden. Öffnen Sie dazu während des Verbindungsaufbaus auf dem Gerät in die Einstellungen und dort unter ''Allgemein'' den Eintrag ''Geräteverwaltung''. Dieser Eintrag ist nur sichtbar, wenn eine Entwickler-App auf dem Gerät installiert ist. Sie müssen daher möglicherweise warten, bis der WebDriverAgent installiert ist, bevor der Eintrag erscheint. Wählen Sie dort den Eintrag Ihres Apple-Accounts und vertrauen Sie ihm. Da der WebDriverAgent wieder deinstalliert wird, wenn der Start nicht funktioniert hat, müssen Sie dies während des Verbindungsaufbaus tun. Falls Ihnen das zu hektisch ist, können Sie auch folgenden Code ausführen:<br />
<br />
''<nowiki>xcodebuild -project Mobile_Testing_Supplement/lib/node_modules/appium-1.16.0-rc.1/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=<udid>' test</nowiki>''<br />
<br />
Damit wird der WebDriverAgent auf dem Gerät installiert ohne dass er wieder gelöscht wird. In der [https://support.apple.com/en-us/HT204460 Dokumentation von Apple] finden Sie nähere Informationen zum Installieren und Vertrauen solcher Apps.<br />
<br />
== Konfiguration des Plugins ==<br />
Bevor Sie loslegen, sollten Sie die Einstellungen des Mobile Testing Plugins überprüfen und ggf. anpassen.<br />
<br />
Öffnen Sie im Menü den Punkt "''Extras''" &#8594; "''Einstellungen''" und dort unter "''Erweiterungen''" den Eintrag "''Mobile Testing''" (s. Abb.). Standardmäßig werden diese Pfade automatisch gefunden (1). Um einen Pfad manuell anzupassen, deaktivieren Sie den entsprechenden Haken rechts davon. Sie erhalten in einer Drop-down-Liste einige Pfade zur Auswahl. Ist ein eingetragener Pfad falsch oder kann er nicht gefunden werden, wird das Feld rot markiert und es erscheint ein diesbezüglicher Hinweis. Stellen Sie sicher, dass alle Pfade richtig angegeben sind.<br />
<br />
[[Datei:MobileTestingEinstellungen.png | thumb | 400px | Konfiguration des Plugins]]<br />
<br />
*'''appium''': Geben Sie hier den Pfad zur ausführbaren Datei an mit der Appium in der Kommandozeile gestartet werden kann. Unter Windows wird diese Datei in der Regel "<code>appium.cmd</code>" heißen. Dieser Pfad wird benutzt, wenn expecco einen Appium-Server startet.<br />
*'''node''': Geben Sie hier den Pfad zur ausführbaren Datei an, die Node (auch "Node.js") startet. Dieser Pfad wird beim Starten eines Servers an Appium weitergegeben, damit Appium ihn unabhängig von der PATH-Variablen findet. Unter Windows heißt diese Datei in der Regel "<code>node.exe</code>".<br />
*'''JAVA_HOME''': Geben Sie hier den Pfad zu einem JDK an. Dieser Pfad wird an jeden Appium-Server weitergegeben. Lassen Sie das Feld frei, um den Wert aus der Umgebungsvariablen zu verwenden. Um einzustellen, welches Java von expecco verwendet werden soll, setzen Sie diesen Pfad in den Einstellungen für die Java Bridge.<br />
*'''ANDROID_HOME''': Geben Sie hier den Pfad zu einem SDK von Android an. Dieser Pfad wird an jeden Appium-Server weitergegeben. Lassen Sie das Feld frei, um den Wert aus der Umgebungsvariablen zu verwenden.<br />
*'''adb''': Hier steht der Pfad zum adb-Befehl. Unter Windows heißt die Datei adb.exe. Diese wird von expecco beispielsweise verwendet, um die Liste der angeschlossenen Geräte zu erhalten. Diesen Pfad sollten Sie automatisch wählen lassen, da dann der Befehl im ANDROID_HOME-Verzeichnis verwendet wird. Dieser wird auch von Appium verwendet. Falls expecco und Appium jedoch verschiedene Versionen von adb verwenden kann es zu Konflikten kommen.<br />
*'''android.bat''': Diese Datei wird nur benötigt, um damit den AVD und den SDK Manager zu starten. Automatisch wird hier die Datei im ANDROID_HOME-Verzeichnis gesucht.<br />
*'''aapt''': Geben Sie hier den Pfad zum aapt-Befehl an. Unter Windows heißt diese Datei ''aapt.exe''. expecco verwendet aapt nur im Verbindungseditor, um das Paket und die Activities einer apk-Datei zu lesen. Automatisch wird hier die Datei im ANDROID_HOME-Verzeichnis gesucht.<br />
<br />
[[Datei:MobileTestingJavaBridgeEinstellungen.png | thumb | 400px | Konfiguration des JDKs]]<br />
<br />
Ab expecco 2.11 gibt es das Feld ''Team-ID''. Wenn Sie iOS-Tests ausführen, tragen Sie hier die Team-ID Ihres Zertifikats ein. Diese wird für jede iOS-Verbindung verwendet, außer Sie setzen den Wert im Einzelfall in den Verbindungseinstellungen um. Wie Sie die Team-ID erhalten, lesen Sie im Abschnitt zur [[#Signierung|Signierung]] ber der Installation auf Mac OS. Mit expecco 2.10 können Sie die Team-ID nur für jede Verbindungseinstellung extra als Capability eintragen. Dazu müssen Sie jedoch die [[#Erweiterte_Ansicht|erweiterte Ansicht]] verwenden. Geben Sie hier die Capability ''xcodeOrgId'' an und setzen Sie als Wert die Team-ID des Zertifikats.<br />
<br />
Die Einstellung zur Serveradresse unten auf der Seite bezieht sich auf das Verhalten des Verbindungseditors. Dieser prüft am Ende, ob die Serveradresse auf ''/wd/hub'' endet, da dies die übliche Form ist. Falls nicht, wird in einem Dialog gefragt, wie darauf reagiert werden soll. Das festgelegte Verhalten kann hier eingesehen und verändert werden.<br />
<br />
Wechseln Sie ebenfalls zum Eintrag ''Java Bridge'' (s. Abb.). Hier muss der Pfad zu Ihrer Java-Installation angegeben werden, die von expecco benutzt wird. Tragen Sie hier ein JDK ein. Falls Sie unter Windows das aus dem Mobile Testing Supplement verwenden möchten, lautet der Pfad<br />
<nowiki>C:\Program Files (x86)\exept\Mobile Testing Supplement\jdk</nowiki><br />
Sie können auch die Systemeinstellungen verwenden.<br />
<br />
== Android-Gerät vorbereiten ==<br />
Wenn Sie ein Android-Gerät unter Windows anschließen benötigen Sie möglicherweise noch einen adb-Treiber für das Gerät. Einen passenden Treiber finden Sie üblicherweise auf der jeweiligen Webseite des Herstellers. Haben Sie den Universal-Treiber aus dem Mobile Testing Supplement installiert, sollte für die meisten Geräte bereits alles funktionieren. In einigen Fällen versucht auch Windows automatisch einen Treiber zu installieren, wenn Sie das Gerät zum ersten mal anschließen.<br />
<br><br />
===USB-Debugging Einschalten===<br />
'''Achtung:'''<br />
Bevor Sie ein Mobilgerät mit dem Appium-Plugin ansteuern können, müssen Sie für dieses Debugging erlauben!<br />
<br />
Für Android-Geräte finden Sie diese Option in den Einstellungen unter ''[https://www.droidwiki.org/wiki/Entwickleroptionen Entwickleroptionen]'' mit dem Namen ''[https://www.droidwiki.org/USB-Debugging USB-Debugging]''. Falls die Entwickleroptionen nicht angezeigt werden, können Sie diese freischalten, indem Sie unter "''Über das Telefon''" siebenmal auf "''Build-Nummer''" tippen.<br />
<br />
===Wach bleiben Aktivieren===<br />
Aktivieren Sie auch die Funktion ''Wach bleiben'', damit das Gerät nicht während der Testerstellung oder -ausführung den Bildschirm abschaltet.<br />
<br />
Aus Sicherheitsgründen muss USB-Debugging für jeden Computer einzeln zugelassen werden. Beim Verbinden des Geräts mit dem PC über USB müssen Sie dabei am Gerät der Verbindung zustimmen. Falls Sie dies für Ihren Computer noch nicht getan haben, aber auf dem Gerät kein entsprechender Dialog erscheint, kann es helfen, das Gerät aus- und wieder einzustecken. Das kann insbesondere dann passieren, wenn Sie den ADB-Treiber installiert haben während das Gerät bereits über USB angeschlossen war. Falls auch das nicht hilft, öffnen Sie die Benachrichtigungen, indem Sie sie vom oberen Bildschirmrand herunter ziehen. Dort finden Sie die USB-Verbindung und Sie können die Optionen dazu öffnen. Wählen Sie einen anderen Verbindungstypen aus; in der Regel sollten MTP oder PTP funktionieren.<br />
<br />
Sie können auch auf einem Emulator testen. Dieser muss nicht gesondert vorbereitet werden, da er bereits für USB-Debugging ausgelegt ist. Es ist sogar möglich, einen Emulator bei Testbeginn zu starten.<br />
<br />
Um zu überprüfen, ob ein Gerät, das Sie an Ihren Rechner angeschlossen haben, verwendet werden kann, öffnen Sie den [[#Verbindungseditor|Verbindungseditor]]. Das Gerät sollte dort angezeigt werden.<br />
<br />
=== Verbindung über WLAN ===<br />
Es ist auch möglich, Android-Geräte über WLAN zu verbinden. Dazu müssen Sie zunächst das Gerät über USB mit dem Rechner verbinden. Öffnen Sie dann die Eingabeaufforderung und geben Sie dir eint:<br />
<nowiki>adb tcpip 5555</nowiki><br />
Damit lauscht das Gerät auf eine TCP/IP-Verbindung an Port 5555. Sollten Sie mehrere Geräte angeschlossen oder Emulatoren laufen haben, müssen Sie genauer angeben, welches Gerät Sie meinen. Geben Sie in diesem Fall ein:<br />
<nowiki>adb devices -l</nowiki><br />
Sie erhalten eine Liste aller Geräte, wobei die erste Spalte deren Kennung ist. Schreiben Sie dann stattdessen<br />
<nowiki>adb -s <Gerätekennung> tcpip 5555</nowiki><br />
mit der Gerätekennung des gewünschten Geräts. Sie können die USB-Verbindung nun trennen. Jetzt müssen Sie die IP-Adresse Ihres Gerätes in Erfahrung bringen. Sie finden diese üblicherweise irgendwo in den Einstellungen des Geräts, beispielsweise beim Status oder in den WLAN-Einstellungen. Geben Sie dann ein:<br />
<nowiki>adb connect <IP-Adresse des Geräts></nowiki><br />
Damit sollte das Gerät nun über WLAN verbunden sein und kann genauso verwendet werden, wie mit USB-Verbindung. Sie können dies überprüfen, indem Sie wieder <tt>adb devices -l</tt> eingeben oder in expecco den Verbindungsdialog öffnen. In der Liste taucht das Gerät mit seiner IP-Adresse und dem Port auf. Bedenken Sie, dass die WLAN-Verbindung nicht mehr besteht, wenn der ADB-Server oder das Gerät neu gestartet werden.<br />
<br />
=== Verbindung zu einem Emulator ===<br />
Sie benötigen dazu den Emulator selbst, sowie mindestens ein AVD (Android Virtual Device). Hinweise zu Installation finden Sie in der [https://developer.android.com/studio/run/emulator Android Studio Dokumentation].<br />
<br />
Wenn Sie Android Studio bereits mit den Defaulteinstellungen installiert haben <sup>1)</sup>, sollte der Emulator bereits mitinstalliert sein. Falls nicht, wählen Sie in Android Studio "''Configure''" - "''SDK Manager''" - "''Android SDK''" - "''SDK Tools''" - ''Android Emulator''", sowie dort die "''Platform Tools''".<br />
Alternativ geht das auch über die Kommandzeile mit dem "sdkmanager" Kommando.<br />
<br />
Als nächstes benötigen Sie mindestens ein AVD; auch dies geht am einfachsten über den Dialog in Android Studio:<br />
wählen sie "''Configure''" - "''AVD Manager''" und folgen den Anweisungen (Deviceauswahl, Platform und Android Version). <br />
<br />
Auch wenn Sie den Emulator automatisieren benötigen sie Appium; installieren Sie dieses entweder mit dem Mobile Testing Supplement, oder direkt von der Appium homepage (https://github.com/appium/appium-desktop/releases).<br />
<br />
<sup>1)</sup>Android Studio selbst wird nicht von expecco benötigt; es bietet aber kompfortable Dialoge zum Installieren von Paketen und AVDs.<br />
<br />
== iOS-Gerät und App vorbereiten ==<br />
Das Ansteuern von iOS-Geräten ist nur über einen Mac möglich. Lesen Sie daher auch den Abschnitt zur [[#Mac_OS|Installation unter Mac OS]].<br />
<br />
Bevor Sie ein Mobilgerät mit dem Mobile Testing Plugin ansteuern können, müssen Sie für iOS-Geräte ab iOS 8 Debugging erlauben. Aktivieren Sie dazu die Option ''Enable UI Automation'' unter dem Menüpunkt ''Entwickler'' in den Einstellungen des Geräts. Falls Sie den Eintrag ''Entwickler'' in den Einstellungen nicht finden, gehen Sie wie folgt vor: Schließen Sie das Gerät über USB an den Mac an. Dabei müssen Sie ggf. am Gerät noch der Verbindung zustimmen. Starten Sie Xcode und wählen Sie dann in der Menüleiste am oberen Bildschirmrand im Menü ''Window'' den Eintrag ''Devices''. Es öffnet sich ein Fenster, in dem eine Liste der angeschlossenen Geräte angezeigt wird. Wählen Sie dort Ihr Gerät aus. Danach sollte der Eintrag ''Entwickler'' in den Einstellungen auf dem Gerät auftauchen. Dazu müssen Sie möglicherweise die Einstellungen beenden und neu starten.<br />
<br />
[[Datei:Alert.png | thumb | 270px | Beispiel für einen Alert unter iOS]]<br />
Ein Verbindungsaufbau zu dem Gerät ist nicht möglich solange es bestimmte Alerts zeigt. Ein solcher Alert kann z.&#x202f;B. erscheinen wenn FaceTime aktiviert ist, indem ein Hinweis auf anfallende SMS-Gebühren angezeigt wird (siehe Screenshot). Achten Sie darauf, das Gerät so zu konfigurieren, dass es im Leerlauf keine solchen Alerts zeigt.<br />
<br />
=== expecco 2.11 und später ===<br />
Sie können beliebige Apps testen, die auf dem verwendeten Gerät lauffähig oder bereits installiert sind. Wenn die App als Development-Build vorliegt, muss die UDID des Geräts in der App hinterlegt sein. In jedem Fall muss der WebDriverAgent für das Gerät signiert werden. Lesen Sie dazu den Abschnitt zur [[#Signierung|Signierung]] unter Mac OS.<br />
<br />
Falls Sie in einem Test den Home-Button verwenden wollen, müssen Sie auf dem Gerät AssistiveTouch aktivieren. Sie finden diese Option in den Einstellungen unter ''Allgemein'' > ''Bedienungshilfen'' > ''AssistiveTouch''. Platzieren Sie dann das Menü in der Mitte des oberen Bildschirmrands. Sie können das Drücken des Home-Buttons dann mit dem entsprechenden Menüeintrag im Recorder aufzeichnen oder direkt den Baustein ''Press Home Button'' benutzen.<br />
<br />
=== expecco 2.10 ===<br />
Die App, die Sie verwenden wollen, muss als Development-Build vorliegen. Außerdem muss die UDID des Geräts in der App hinterlegt sein.<br />
<br />
=== Development-Build signieren ===<br />
Ein Development-Build einer App ist nur für eine begrenzte Zahl von Geräten zugelassen und kann auf anderen Geräten nicht gestartet werden. Es ist aber möglich, das Zertifikat und die verwendbaren Geräte in einem Development-Build auszutauschen.<br />
<br />
* Evaluierung mit Demo-App von eXept:<br />
:Gerne stellen wir Ihnen eine Demo-App zur Verfügung, die als Development-Build vorliegt und die wir für Ihr Gerät signieren können. Senden Sie dazu bitte Ihrem eXept-Ansprechpartner die UDID Ihres Gerätes zu. Wie Sie die UDID Ihres Gerätes ermitteln können, ist im folgenden Abschnitt beschrieben.<br />
<br />
* Eigene App für Ihr Testgerät verwenden:<br />
:Wenn Sie von den App-Entwicklern einen Development-Build (IPA-Datei) erhalten, der für Ihr Testgerät zugelassen ist, können Sie diesen direkt verwenden. Dazu müssen Sie den Entwicklern die UDID Ihres Geräts mitteilen, damit sie diese eintragen können. '''Sie können die UDID eines Gerätes mithilfe von Xcode auslesen'''. Starten Sie dazu Xcode und wählen Sie in der Menüleiste am oberen Bildschirmrand im Menü ''Window'' den Eintrag ''Devices''. Es öffnet sich ein Fenster, in dem eine Liste der angeschlossenen Geräte angezeigt wird. Wählen Sie Ihr Gerät aus und suchen Sie in Eigenschaften den Eintrag ''Identifier''. Die UDID ist eine 40-stellige Hexadezimalzahl.<br />
<br />
* Extern entwickelte App für Ihr Testgerät umsignieren:<br />
:Es können auch Apps umsigniert werden, damit Sie auf anderen Geräten lauffähig sind. Dieser Vorgang ist jedoch kompliziert und setzt insbesondere einen Zugang zu einem Apple-Developer-Account voraus. Eine Dokumentation zur Vorgehensweise ist derzeit in Vorbereitung.<br />
<br />
:Für die Evaluierung unterstützen wir Sie gerne beim Umsignieren Ihrer App.<br />
<!--<br />
Melden Sie sich beim [https://developer.apple.com/ Apple-Webinterface] an. Navigieren Sie zu ''Certificates, IDs & Profiles''. Erzeugen Sie hier ggf. ein Developer-Zertifikat und ein Provisioning Profile für Ihr Gerät und laden Sie beide herunter. Sollten Sie noch keinen Developer Account haben, erstellen Sie hier einen: https://developer.apple.com/enroll/. Hierzu müssen Sie sich mit einer Apple-ID anmelden.<br />
<br />
# Team-ID herausfinden (''Membership'' -> ''Team ID'')<br />
# Unter ''Certificates, IDs & Profiles'' Development-Zertifikat auswählen (unter ''+'' anlegen, falls nicht vorhanden) und herunterladen.<br />
# Unter ''App ID'' Wildcard-App-ID erzeugen, falls nicht vorhanden. App-ID notieren (AppID = Prefix.ID)<br />
# Gerät hinzufügen, dazu UDID (bzw. ''Identifier'') des Geräts herausfinden (''Xcode'' -> ''Window'' (oben in Menüleiste) -> ''Devices'')<br />
# Provisionen Profile erstellen: ''iOS App Development'' -> ''AppID'' auswählen -> Zertifikat wählen -> Gerät auswählen -> Profilname anlegen -> Provisioning Profile herunterladen.<br />
# Das heruntergeladene Zertifikat importieren (''Downloads'' -> Zertifikat (.cer)<br />
# SHA1-Fingerabdruck kopieren. Dazu Rechtsklick auf Zertifikat -> ''Information'', anschließend bis zum Ende der Seite scrollen).<br />
# Entitlements.plist erstellen (''Terminal' öffnen -> Downloads/Mobile_Testing_Supplement/bin/gen-entitlements_plist 'Team-ID' 'App ID' Downloads/Mobile_Testing_Supplement/bin/re-sign-ipa <Pfad zum ipa (z.B. Downloads/expeccoMobileDemo.ipa)> \<br />
"<Zertifikat (SHA1-Fingerabdruck, z.B. 76 E8 4B E8 78 D5 D7 F9 2E 09 8B D7 E8 FB CE 30 0C F5 D0 EF)>" \<br />
<Pfad zum Provisionen Profile (z.B. /Users/exept_test/Downloads/dut.mobileprovision)> \<br />
<Pfad für das Ergebnis-ipa (z.B. Downloads/expeccoMobileDemo_re-signed.ipa)> \<br />
[Pfad zur entitlements.plist] (z.B. /Users/exept_test/entitlements.plist)<br />
<br />
Zum Umsignieren können Sie das entsprechende Skript aus dem Mobile Testing Supplement für Mac OS oder jedes beliebige andere Tool (z.B. isign) verwenden.<br />
--><br />
<br />
Weitere Informationen zur Verwendung von iOS-Geräten finden Sie auch in der [http://appium.io/slate/en/master/?java#appium-on-real-ios-devices Dokumentation von Appium].<br />
<br />
=== Native iOS-Apps ===<br />
Sie können auch Apps verwenden, die bereits nativ auf dem Gerät vorhanden sind. Dazu müssen Sie deren Bundle-ID kennen und diese dann in die Verbindungseinstellungen eintragen. Hier eine kleine Auswahl gängiger Apps:<br />
{| style="text-align:left"<br />
! App<br />
!<br />
! Bundle-ID<br />
|-<br />
| App Store<br />
| <br />
| com.apple.AppStore<br />
|-<br />
| Calculator<br />
| <br />
| com.apple.calculator<br />
|-<br />
| Calendar<br />
| <br />
| com.apple.mobilecal<br />
|-<br />
| Camera<br />
| <br />
| com.apple.camera<br />
|-<br />
| Contacts<br />
| <br />
| com.apple.MobileAddressBook<br />
|-<br />
| iTunes Store<br />
| <br />
| com.apple.MobileStore<br />
|-<br />
| Mail<br />
| <br />
| com.apple.mobilemail<br />
|-<br />
| Maps<br />
| <br />
| com.apple.Maps<br />
|-<br />
| Messages<br />
| <br />
| com.apple.MobileSMS<br />
|-<br />
| Phone<br />
| <br />
| com.apple.mobilephone<br />
|-<br />
| Photos<br />
| <br />
| com.apple.mobileslideshow<br />
|-<br />
| Settings<br />
| <br />
| com.apple.Preferences<br />
|}<br />
<br />
Weitere Bundle-IDs finden Sie [https://github.com/joeblau/apple-bundle-identifiers hier].<br />
<br />
= Beispiele =<br />
Bei den Demo-Testsuiten für expecco finden Sie auch Beispiele für Tests mit dem Mobile Testing Plugin. Wählen Sie dazu auf dem Startbildschirm die Option "''Beispiel aus Datei''" und öffnen Sie den Ordner "''mobile''".<br />
<br />
==<span id="TestsuiteMobileTestingDemo"><!-- Referenced by m01_MobileTestingDemo.ets --></span> ''m01_MobileTestingDemo.ets'' ==<br />
Die Testsuite enthält zwei einfache Testpläne: "''Simple CalculatorTest''" und "''Complex Calculator and Messaging Test''". Beide Tests verwenden einen Android-Emulator, den Sie vor Beginn starten müssen. Die Apps, die im Test verwendet werden, gehören zur Grundausstattung des Emulators und müssen daher nicht mehr installiert werden. Da sich die Apps unter jeder Android-Version unterscheiden können, ist es wichtig, dass Ihr Emulator unter Android 6.0 läuft. Außerdem muss die Sprache auf Englisch gestellt sein.<br />
<br />
; Simple CalculatorTest<br />
: Dieser Test verbindet sich mit dem Taschenrechner und gibt die Formel ''2+3'' ein. Das Ergebnis des Rechners wird mit dem erwarteten Wert ''5'' verglichen.<br />
<br />
; Complex Calculator and Messaging Test<br />
: Dieser Test verbindet sich mit dem Taschenrechner und öffnet anschließend den Nachrichtendienst. Dort wartet er auf eine einkommende Nachricht von der Nummer ''15555215556'', in der eine zu berechnende Formel gesendet wird. Die Nachricht wird zuvor über einen Socket beim Emulator erzeugt. Nach dem Eintreffen der Nachricht wird diese vom Test geöffnet und deren Inhalt gelesen. Danach wird wieder der Taschenrechner geöffnet, die erhaltene Formel eingegeben und das Ergebnis gelesen. Anschließend wechselt der Test wieder zum Nachrichtendienst und sendet das Ergebnis als Antwort.<br />
<br />
== ''m02_expeccoMobileDemo.ets'' und ''m03_expeccoMobileDemoIOS.ets'' ==<br />
Diese sind Bestandteil des Tutorials zum Mobile Testing Plugin. Der jeweils enthaltene Testfall ist unvollständig und wird im Zuge des Tutorials ergänzt. Lesen Sie dazu den Abschnitt [[#Tutorial|Tutorial]].<br />
<br />
= Tutorial =<br />
Dieses Tutorial beschreibt das grundsätzliche Vorgehen zur Erstellung von Tests mit dem Mobile Testing Plugin. Grundlage dafür ist ein mitgeliefertes Beispiel, bestehend aus einer einfachen App und einer expecco-Testsuite.<br />
<br />
Die App ''expecco Mobile Demo'' berechnet und überprüft verschiedene alltägliche Codes: die IBAN aus dem europäischen Zahlungsverkehr, die internationalen GTIN-13-Produktcodes, wie man sie bei Strichcodes im Einzelhandel findet, und die Seriennummern auf Euro-Banknoten.<br />
<br />
Die Testsuite enthält Testfälle für einzelne Funktionen der App. Dabei sind noch nicht alle Funktionen abgedeckt, sondern werden im Laufe des Tutorials ergänzt.<br />
<br />
Es gibt zwei Versionen dieses Tutorials:<br />
*'''[[#Erste_Schritte_mit_Android|Erste Schritte mit Android]]'''<br />
*'''[[#Erste_Schritte_mit_iOS|Erste Schritte mit iOS]]'''<br />
<br />
Das Vorgehen ist in beiden Versionen nahezu identisch, lediglich die Verbindungskonfigurationen werden unterschiedlich erzeugt. Die fertigen Tests unterscheiden sich dann im Wesentlichen in den Pfaden zur Adressierung der benutzten Elemente, da diese technologieabhängig sind.<br />
<br />
==<span id="FirstStepsAndroid"><!-- Referenced by m02_expeccoMobileDemo.ets --></span> Erste Schritte mit Android ==<br />
Es wird vorausgesetzt, dass Sie das Kapitel [[#Installation_und_Aufbau|Installation und Aufbau]] bereits gelesen und die nötigen Vorbereitungen für die Verwendung von Android-Geräten unter Windows abgeschlossen haben.<br />
<br />
=== Schritt 1: Demo ausführen ===<br />
Starten Sie expecco und öffnen Sie die Testsuite "''m02_expeccoMobileDemo.ets''" über die Schaltfläche "''Beispiel aus Datei''" (Abb. 1). Ab expecco 2.11 befindet sich diese im Unterordner "''mobile''". In dieser Testsuite befindet sich bereits ein vorgefertigter Testplan mit einigen Testfällen für diese App.<br />
<br />
[[Datei:MobileTestingBeispielÖffnen.png | frame | left | Abb. 1: Beispiel-Testsuite öffnen]]<br />
<br clear="all"><br />
In der Testsuite ist das Paket der Demo-App als Anhang enthalten ("''expeccoMobileDemo-debug.apk''"). Mithilfe des bereitgestellten Bausteins "''Export Demo App''" können Sie die Datei an einen beliebigen Ort auf Ihrem Rechner exportieren. Wählen Sie dazu den Baustein aus (1) und klicken Sie auf den grünen Play-Knopf (2) um den Baustein auszuführen (Abb. 2). Der Baustein öffnet einen Dateidialog, in dem Sie angeben, wo das Paket gespeichert werden soll.<br />
<br />
[[Datei:MobileTestingExportApp.png | frame | left | Abb. 2: App exportieren]]<br />
<br clear="all"><br />
Bevor wir uns mit dem weiteren Inhalt der Testsuite beschäftigen, konfigurieren Sie zuerst die Verbindung und welches Gerät Sie benutzen wollen. Schließen Sie dazu ein Gerät über USB an Ihren Rechner an oder starten Sie einen Emulator.<br />
<br />
[[Datei:MobileTestingVerbinden.png | frame | left | Abb. 3: Verbindungseditor öffnen]]<br />
<br clear="all"><br />
Öffnen Sie nun den GUI-Browser (1) und wählen Sie unter "''Verbinden''" (2) den Eintrag "''Mobile Testing''" (3) (Abb. 3), um den Verbindungsdialog zu öffnen.<br />
<br />
Sie sehen eine Liste aller angeschlossenen Android-Geräte (1) (Abb. 3). Sollte Ihr Gerät nicht in der Liste auftauchen, stellen Sie sicher, dass es eingeschaltet und über USB verbunden ist. Lesen Sie ansonsten den Abschnitt [[#Android-Ger.C3.A4t_vorbereiten|Android-Gerät vorbereiten]]<br />
<br />
[[Datei:MobileTestingGerätAuswählen.png | frame | left | Abb. 4: Gerät im Verbindungsdialog auswählen]]<br />
<br clear="all"><br />
Haben Sie Ihr Gerät in der Liste gefunden, wählen Sie es aus und klicken Sie auf "''Weiter''" (2).<br />
<br />
Als nächstes geben Sie an, welche App Sie verwenden wollen (Abb. 5). Dabei können Sie wählen, ob Sie eine App starten möchten, die bereits auf dem Gerät installiert ist ("''App auf dem Gerät''") oder ob eine App installiert und gestartet werden soll ("''App installieren''"). Für den Fall, dass Sie eine bereits installierte App benutzen wollen, erhalten Sie eine Liste aller auf dem Gerät installierten Pakete (1), die in Systempakete und Fremdpakete (2) unterteilt sind, sowie deren Activities (3). Diese können Sie dann einfach in den jeweiligen Feldern auswählen.<br />
<br />
[[Datei:MobileTestingAppAuswählen.png | frame | left | Abb. 5: Auf dem Gerät installierte App angeben]]<br />
<br clear="all"><br />
Für dieses Tutorial soll die App installiert werden, die Sie eben aus der Testsuite exportiert haben. Wählen Sie also "''App installieren''" aus und tragen Sie bei App (1) den entsprechenden Pfad ein (Abb. 6). Sie können den Knopf links benutzen (2), um einen Dateidialog zu öffnen, mit dem Sie zu der Datei navigieren können, um sie einzugeben. Das Paket (3) und die Activity (4) der App werden automatisch eingetragen. Sollte die App mehrere Activities besitzen, können Sie die gewünschte auswählen. Klicken Sie nun auf "''Weiter''" (5).<br />
<br />
[[Datei:MobileTestingAppInstallieren.png | frame | left | Abb. 6: App angeben, die auf dem Gerät installiert werden soll]]<br />
<br clear="all"><br />
Auf der letzten Seite sehen Sie eine Übersicht aller bisherigen Angaben (1) (Abb. 7). Darunter können Sie einen Namen für die Verbindung angeben, unter dem sie im GUI-Browser angezeigt wird (2). Außerdem lässt sich eine Verbindung über diesen Namen identifizieren und in Bausteinen verwenden; der Name muss daher eindeutig sein. Falls Sie keinen Namen angeben, wird generisch einer erzeugt. Geben Sie als Namen "''expeccoMobileDemo''" ein. Im Feld darunter ist die Adresse zum Appium-Server einzutragen (3). Appium ist die Schnittstelle, über die die angeschlossenen Geräte gesteuert werden. Für dieses Tutorial wird die Verwaltung der Instanzen des Appium-Servers von expecco übernommen. Tragen Sie dafür ist die lokale Standard-Adresse "''<nowiki>http://localhost:4723/wd/hub</nowiki>''" ein. Diese ist immer der unterste Eintrag der Vorschlagsliste. Außerdem ist die Option "''Bei Bedarf starten''" aktiviert (4). expecco überprüft dann, ob an der Adresse bereits ein Appium-Server läuft und startet und beendet ihn bei Bedarf automatisch. Wenn der Port ''4723'' bereits belegt ist oder wenn Sie einmal mehrere Verbindungen parallel betreiben wollen, verwenden Sie an dieser Stelle entsprechend einen anderen Port. Es ist dabei üblich die ungeraden Portnummern oberhalb von ''4723'' zu verwenden, also ''4725'', ''4727'' usw. Natürlich können Sie auch entfernte Server verwenden, das automatische Starten und Beenden eines Servers kann expecco aber nur lokal für Sie übernehmen.<br />
<br />
[[Datei:MobileTestingServerkonfiguration.png | frame | left | Abb. 7: Verbindungsnamen und Appium-Server konfigurieren]]<br />
<br clear="all"><br />
Klicken Sie nun auf "''Speichern''" (5) um die Einstellungen für die Testausführung zu speichern. Einstellungen können als Anhang einer Testsuite oder in eine externe Datei gespeichert werden (Abb. 8). Falls Sie mehrere Projekte gleichzeitig offen haben, können Sie in der Liste das Projekt auswählen, in dem der Anhang angelegt werden soll. Klicken Sie auf "''Speichern''" im Bereich "''Einstellungen im Anhang speichern''" und geben Sie als Name "''expeccoMobileDemo''" an. Klicken Sie nun auf ''Server starten und verbinden'' (6) um mit der angegebenen Konfiguration eine Verbindung herzustellen.<br />
<br />
[[Datei:MobileTestingEinstellungenSpeichern.png | frame | left | Abb. 8: Einstellungen speichern]]<br />
<br clear="all"><br />
Der Verbindungsaufbau kann eine Weile dauern. Warten Sie bis die Verbindung aufgebaut ist und im GUI-Browser angezeigt wird. Sie sehen, dass die App auf dem Gerät gestartet wird. Nun wissen Sie, dass die Konfiguration funktioniert. Die gespeicherten Einstellungen sollen nun für den Test verwendet werden, der dann die gleiche Verbindung aufbaut. Wählen Sie die Verbindung im GUI-Browser aus, machen Sie einen Rechtsklick und wählen Sie im Kontextmenü "''Verbindung abbauen''", damit es zu keinem Konflikt kommt. Wechseln Sie dann zurück zum Reiter der Testsuite.<br />
<br />
In der Testsuite wurden die Einstellungen als Anhang "''expeccoMobileDemo''" angelegt (Abb 9). Wählen Sie den Baustein ''Connect'' (1) aus und wechseln Sie rechts zur Ansicht "''Netzwerk''" (2). Ziehen Sie per Drag-and-drop die Einstellungen in das Netzwerk des Bausteins (3). Verbinden Sie den Ausgangspin ''pathName'' mit dem Eingangspin ''stringOrFilename[1]'' des Bausteins "''Connect from File''" (4). Mit "''Übernehmen''" (5) bestätigen Sie die Änderungen. Dieser Baustein wird zu Beginn des Tests die Verbindung zur App herstellen.<br />
<br />
[[Datei:MobileTestingConnectblock.png | frame | left | Abb. 9: Verbindungsbaustein editieren]]<br />
<br clear="all"><br />
Wechseln Sie nun zum Testplan "''Demo-Test''" (1) (Abb. 10). Dieser Testplan enthält bereits einige fertige Testfälle. Vor und nach der Ausführung (2) ist außerdem jeweils ein Baustein eingetragen: Der eben bearbeitete Baustein "''Connect''" für den Aufbau und der Baustein "''Disconnect''" für den Verbindungsabbau. Durch das Eintragen der beiden Bausteine an dieser Stelle geschieht der Verbindungsabbau insbesondere auch dann, wenn der Test vorzeitig abgebrochen wird, z. B. weil einer der Testfälle fehlschlägt.<br />
<br />
[[Datei:MobileTestingTestplan.png | frame | left | Abb. 10: Testplanausführung]]<br />
<br clear="all"><br />
Jetzt können Sie den Testplan "''Demo-Test''" starten, indem Sie auf den grünen Play-Knopf (3) klicken. Der Testplan sollte ohne Fehler durchlaufen.<br />
<br />
=== Schritt 2: Einen Baustein mit dem Recorder erstellen ===<br />
Mit Hilfe des integrierten Recorders lassen sich einfach Ausführungssequenzen aufnehmen und in einem AKtionsbaustein speichern. Dafür muss eine Verbindung zu einem Testgerät bestehen, mit dessen Hilfe der Test erstellt wird.<br />
<br />
Um eine Verbindung aufzubauen, wechseln Sie zurück zum GUI-Browser. In diesem ist noch die Verbindung eingetragen, die Sie zuvor angelegt haben. Da für die Verbindung im Testlauf derselbe Name verwendet wurde, wurden die Einstellungen damit überschrieben (In unserem Fall waren die Einstellungen ohnehin identisch). Die Verbindung ist zur Zeit nicht aktiv, da sie am Ende der Ausführung abgebaut wurde. Die Einstellungen sind dort aber noch eingetragen. Um die Verbindung mit dieser Konfiguration wieder aufzubauen, wählen Sie sie aus, gefolgt von einem Rechtsklick und ''Verbinden''.<br />
<br />
Warten Sie, bis die Verbindung aufgebaut ist (1) und drücken Sie dann den Aufnahme-Knopf (2), um eine Aufzeichnung zu starten (Abb. 11).<br />
<br />
[[Datei:MobileTestingRecorderStarten.png | frame | left | Abb. 11: Recorder starten]]<br />
<br clear="all"><br />
Es öffnet sich ein Fenster mit dem Mobile Testing Recorder (Abb. 12). Dieser zeigt einen Screenshot des verbundenen Geräts. Über diese Anzeige können Sie das Gerät fernsteuern. Dabei wird jede Aktion, die Sie ausführen, im Hintergrund aufgezeichnet.<br />
<br />
In der oberen Menüleiste können Sie das Werkzeug auswählen (1), mit dem Sie eine Aktion eingeben möchten. Als Voreinstellung ist das Werkzeug "''Auto''" ausgewählt. Sie können damit bestimmte Aktionen aufzeichnen, indem Sie mit dem Mauszeiger entsprechende Gesten auf der Anzeige ausführen. Wenn Sie zum Beispiel mit der linken Maustaste lange klicken, entspricht das einem langen Antippen des Elements an dieser Stelle. Anstatt die gewünschte Aktion mit der entsprechenden Geste zu bestimmen, können Sie diese alternativ auch manuell auswählen.<br />
<br />
Es soll nun ein neuer Test für das Erkennen korrekter GTIN-13-Codes aufgenommen werden. Klicken Sie zunächst in der Anzeige kurz auf den Button "''GTIN-13 (EAN-13)''" (2) der App um einen entsprechenden Klick auf dem Gerät auszulösen. Während der Ausführung dieser Aktion wird der Rahmen des Recorders kurzzeitig rot. Falls der Recorder danach nicht die aktuelle Ansicht der App darstellen sollte, klicken Sie im Recorder auf das Aktualisierungssymbol (3).<br />
<br />
[[Datei:MobileTestingRecorder1.png | frame | left | Abb. 12: Über Recorder zur GTIN-13-Activity wechseln]]<br />
<br clear="all"><br />
Anschließend soll im Eingabefeld der neuen Seite eine korrekte GTIN-13 eingegeben werden. Führen Sie dazu einen Rechtsklick auf dem Eingabefeld (1) aus und wählen Sie im Kontextmenü die Aktion "''Text setzen''" (2) (Abb. 13). Geben Sie in den sich daraufhin öffnenden Dialog eine beliebige gültige Artikelnummer im GTIN-13-Format ein, bspw. "''4006381333986''" (3). Dieser Text wird nun in der App gesetzt.<br />
<br />
[[Datei:MobileTestingRecorder2.png | frame | left | Abb. 13: GTIN-13-Code über Recorder eingeben]]<br />
<br clear="all"><br />
Klicken Sie nun auf "''Verify''" (1) (Abb. 14). In der App erscheint nun als Ergebnis "''OK''" (2). Der Test soll feststellen, ob tatsächlich dieses Ergebnis angezeigt wird. Nach einem Rechtsklick darauf können Sie im Kontextmenü die Aktion "''Attribut zusichern''" (3) auswählen. Wählen Sie im Dialog, der sich daraufhin öffnet, die Eigenschaft "''text''" (4) aus und bestätigen Sie mit "''OK''" (5). Dieses Mal wird keine Aktion auf dem Gerät ausgelöst, sondern nur ein Baustein aufgezeichnet, der fehlschlägt, sollte das Ergebnis vom erwarteten Wert "''OK''" abweichen.<br />
<br />
[[Datei:MobileTestingRecorder3.png | frame | left | Abb. 14: Antwort der App über Recorder auslesen]]<br />
<br clear="all"><br />
Schließen Sie nun den Recorder. Im ''Arbeitsbereich'' des GUI-Browsers sehen Sie, dass für jede der aufgenommenen Aktionen ein Baustein angelegt wurde (Abb. 15). Sie können nun testen, ob sich das Aufgenommene wieder abspielen lässt. Dazu müssen Sie zunächst die App auf Ihrem Gerät in den Anfangszustand zurückbringen, indem Sie auf dem Gerät die Schaltfläche "''HOME''" oben rechts benutzen. Klicken Sie dann in expecco auf den grünen Play-Knopf (1). Wird alles grün, war die Ausführung erfolgreich. Erstellen Sie nun daraus einen neuen Baustein in der Testsuite, indem Sie auf das Bausteinsymbol (2) in der rechten oberen Ecke klicken. Geben Sie ihm den Namen "''GTIN_Verify_OK''" (3) und bestätigen Sie (4).<br />
<br />
[[Datei:MobileTestingArbeitsbereich.png | frame | left | Abb. 15: Neuen Baustein aus Arbeitsbereich exportieren]]<br />
<br clear="all"><br />
Bauen Sie nun die Verbindung ab, indem Sie die Verbindung auswählen, rechtsklicken und im Kontextmenü "''Verbindung abbauen''" auswählen.<br />
<br />
Wechseln Sie zurück zum Reiter der Testsuite. Dort wurde der neue Baustein angelegt. Wählen Sie wieder den Testplan "''Demo-Test''" aus und fügen Sie den aufgenommenen Testfall "''GTIN_Verify_OK''" per Drag-and-drop am Ende des Testplans hinzu. Übernehmen Sie die Änderung und starten Sie erneut. Der Testplan sollte wieder ohne Fehler durchlaufen.<br />
<br />
=== Schritt 3: XPath anpassen mithilfe des GUI-Browsers ===<br />
Ihr neuer Baustein funktioniert auf anderen Geräten möglicherweise nicht. Die verwendeten Elemente werden über einen XPath adressiert und dieser kann auf anderen Geräten nicht stimmen. Lesen Sie dazu den Abschnitt [[#XPath_anpassen_mithilfe_des_GUI-Browsers|XPath anpassen mithilfe des GUI-Browsers]]. Falls Ihnen ein weiteres Gerät zur Verfügung steht, können Sie nun versuchen, die Pfade in Ihren erstellten Bausteinen zu verallgemeinern. Sie können diesen Schritt aber auch überspringen.<br />
<br />
Wenn es Ihnen schwerfällt, verkürzte Pfade zu finden, orientieren Sie sich dabei an den Pfaden der bereits vorhandenen Bausteine. Starten Sie den Test erneut. Sollte der Test jetzt fehlschlagen, überprüfen Sie die Pfade noch einmal im GUI-Browser.<br />
Um den Test nun auf einem zweiten Gerät auszuführen, öffnen Sie im Menü "''Erweiterungen''" > "''Mobile Testing''" > "''Verbindungseinstellungen erstellen''". Sie erhalten einen Dialog ähnlich zum Verbindungsdialog. Allerdings können Sie hier nur Einstellungen erstellen und speichern aber keine Verbindung herstellen. Sie haben jedoch die Möglichkeit, einzelne Aspekte der Einstellungen zu speichern wie bspw. nur das Gerät. Wählen Sie das neue Gerät aus und klicken Sie länger auf das Symbol zum Speichern im Anhang bis sich das verzögerte Menü öffnet (Abb. 16). Wählen Sie hier "''Geräte-Einstellungen speichern''". Benennen Sie den Anhang am besten nach dem Gerät. Danach können Sie den Dialog wieder schließen.<br />
<br />
[[Datei:MobileTestingGerätSpeichern.png | frame | left | Abb. 16: Einstellungen für ein Gerät speichern]]<br />
<br clear="all"><br />
Wählen Sie den Baustein "''Connect''" aus und ziehen Sie die Einstellungen für das neue Gerät in dessen Netzwerk. Verbinden Sie nun dessen Ausgangspin ''pathName'' mit dem Eingangspin ''stringOrFilename[2]'' des Bausteins "''Connect from File''". Der Baustein Connect from File liest die Angaben an den Eingangspins von oben nach unten ein, mehrfache Eigenschaften werden dabei ersetzt. In diesem Fall werden also die Einstellungen zum verwendeten Gerät ersetzt, während die übrigen Einstellungen gleich bleiben. Wenn Sie die Pfade geschickt gewählt haben, wird der Test nun auch auf dem anderen Gerät erfolgreich ablaufen.<br />
<br />
=== Schritt 4: Noch einen Baustein erstellen ===<br />
Falls sich gleiche Abläufe im Test wiederholen, können Sie dafür bereits erstellte Bausteine wiederverwenden oder abwandeln. Der in Schritt 2 erstellte Baustein prüft die Erkennung korrekter GTIN-13-Codes. Es fehlt noch ein Test, der umgekehrt das Erkennen eines falschen GTIN-13-Codes prüft. Die Struktur der beiden Tests ist identisch, sie unterscheiden sich lediglich in ihren Parametern. Kopieren Sie daher den Baustein "''GTIN_Verify_OK''" und benennen Sie die Kopie in "''GTIN_Verify_NOT_OK''" um. Ändern Sie die Eingabe der GTIN-13 in einen falschen Code zum Beispiel durch Ändern der letzten Ziffer ("''4006381333987''") und setzen Sie den Überprüfungswert der Ausgabe auf "''NOT OK''" (Abb. 17).<br />
<br />
[[Datei:MobileTestingGTIN_Verify_NOT_OK.png | frame | left | Abb. 17: Baustein editieren]]<br />
<br clear="all"><br />
Fügen Sie diesen neuen Test ebenfalls zum Testplan Demo-Test hinzu und setzen Sie ihn ans Ende. Führen Sie den Testplan aus, aber vergessen Sie nicht, vorher die Verbindung im GUI-Browser abzubauen.<br />
<br />
Der neue Test wird fehlschlagen, weil Ihr aufgenommener Baustein nicht wieder zur Startseite der App zurückkehrt, die Tests aber jeweils von dort aus starten. In den anderen Bausteinen ist dies bereits berücksichtigt; sie führen abschließend immer den Baustein "''Back to main menu''" aus. Sie sehen das, indem Sie einen der anderen Bausteine, z. B. "''GTIN_Calculate''", auswählen und auf seine Schema-Ansicht wechseln. Dort steht der Baustein "''Back to main menu''" im Feld "''Nach Ausführung''" (Abb. 18). Wie beim entsprechenden Feld beim Testplan wird auch dieser Baustein immer am Ende ausgeführt, unabhängig davon, ob der Test erfolgreich verläuft oder abbricht. Ergänzen Sie diesen Eintrag nun in Ihren Bausteinen "''GTIN_Verify_OK''" und "''GTIN_Verify_NOT_OK''". Wählen Sie dazu den Baustein aus und ziehen Sie in der Schema-Ansicht den Baustein ''Back to main menu'' einfach auf das Eingabefeld "''Nach Ausführung''". Nun können Sie den Testplan starten und alle Tests sollten wieder problemlos ausgeführt werden.<br />
<br />
[[Datei:AppiumDemo Nach Ausführung.png | frame | left | Abb. 18: Nach-Ausführungs-Baustein setzen]]<br />
<br clear="all"><br />
<br />
=== Schritt 5: Test vervollständigen ===<br />
Für die Activity IBAN sind bereits alle Antwortmöglichkeiten der App mit Testfällen abgedeckt. In der GTIN-13-Activity werden ein korrekter und ein fehlerhafter Code getestet und eine Prüfziffer berechnet, das Verhalten der App bei Eingaben falscher Länge wird aber bisher nicht getestet (Bei Verify "''Input must be exactly 13 digits''" und "''…12 digits''". bei Calculate). Die Activity zum Prüfen der Seriennummern von Eurobanknoten wird noch gar nicht getestet. Wie bei der IBAN können hier drei Fälle auftreten: eine korrekte Seriennummer wurde eingegeben (Antwort: "''OK''"), eine falsche Seriennummer wurde eingegeben (Antwort: "''NOT OK''") oder die Angabe entspricht nicht dem Format (Antwort: "''A serial number consists of 12 characters with the first one or two being capital letters (A-Z).''"). Sie können die Testabdeckung jetzt noch erweitern, indem Sie entsprechende Testfälle erstellen. Die Bausteine dafür können Sie wie in Schritt 2 mit dem Recorder erstellen und die XPaths bei Bedarf verallgemeinern. Wenn Sie mit dem grundsätzlichen Umgang mit expecco vertraut sind, können Sie Bausteine natürlich auch ohne Recorder erstellen, indem Sie sie manuell aus vorhandenen Bausteinen der Bibliothek zusammensetzen. Sie können auch beide Vorgehensweisen nach Belieben kombinieren.<br />
<br />
Beachten Sie, dass die hier vorgestellten Testfälle jeweils nur einzelne Eingaben prüfen. Wenn Sie Testfälle für Ihre eigenen Apps schreiben, wollen Sie vermutlich engmaschiger testen, indem Sie noch weitere unterschiedliche Werte eingeben, die insbesondere auch Randfälle enthalten.<br />
<br />
==<span id="FirstStepsIOS"><!-- Referenced by m03_expeccoMobileDemoIOS.ets --></span> Erste Schritte mit iOS ==<br />
Es wird vorausgesetzt, dass Sie das Kapitel [[#Installation_und_Aufbau|Installation und Aufbau]] bereits gelesen und die nötigen Vorbereitungen für die Verwendung von iOS-Geräten unter Mac OS abgeschlossen haben. Schließen Sie das Gerät, das Sie verwenden wollen, an den Mac an. Laden Sie die iOS-Version der [http://download.exept.de/transfer/h-expecco-2.11.0-pre/expeccoMobileDemo.ipa expeccoMobileDemo-App] auf den Mac herunter. Da es sich bei der App um einen Debug-Build handelt, müssen Sie sie noch für Ihr Gerät signieren (siehe [[#iOS-Ger.C3.A4t_und_App_vorbereiten|iOS-Gerät und App vorbereiten]]). Starten Sie nun einen Appium-Server auf dem Mac.<br />
<br />
=== Schritt 1: Demo ausführen (iOS) ===<br />
Starten Sie expecco und öffnen Sie die Testsuite "''m03_expeccoMobileDemoIOS.ets''" über die Schaltfläche "''Beispiel aus Datei''" (Abb. 1). Ab expecco 2.11 befindet sich diese im Unterordner "''mobile''". Ansonsten laden Sie die Testsuite [http://download.exept.de/transfer/h-expecco-2.10.0/m03_expeccoMobileDemoIOS.ets m03_expeccoMobileDemoIOS.ets] auf den Rechner, auf dem sich Ihre expecco-Installation befindet, und öffnen diese. In dieser Testsuite befindet sich bereits ein vorgefertigter Testplan mit einigen Testfällen für diese App.<br />
<br />
[[Datei:MobileTestingIOSBeispielÖffnen.png | frame | left | Abb. 1: Beispiel-Testsuite öffnen]]<br />
<br clear="all"><br />
Bevor wir uns mit dem weiteren Inhalt der Testsuite beschäftigen, konfigurieren Sie zuerst die Verbindung und welches Gerät Sie benutzen wollen. Öffnen Sie nun den GUI-Browser (1) und wählen Sie unter "''Verbinden''" (2) den Eintrag "''Mobile Testing''" (3) (Abb. 2), um den Verbindungsdialog zu öffnen.<br />
[[Datei:MobileTestingVerbinden.png | frame | left | Abb. 2: Verbindungseditor öffnen]]<br />
<br clear="all"><br />
<br />
Hier können Sie ein iOS-Gerät nur von Hand eintragen. Wählen Sie dazu "''iOS-Gerät eingeben''" (Abb. 3). Den Namen und die iOS-Version des Geräts können Sie dessen Eigenschaften entnehmen. Um die Gerätekennung des Geräts zu erfahren, öffnen Sie auf dem Mac in Xcode das Fenster Devices (Command-Shift-2). Dort werden alle angeschlossenen Geräte sowie die zur Verfügung stehenden Simulatoren angezeigt. Hier sehen Sie auch die Gerätekennung (udid) Ihres Geräts und welche Apps installiert wurden. Nachdem Sie das Gerät im Verbindungseditor eingegeben haben, wählen Sie es in der Liste aus und klicken Sie dann auf Weiter.<br />
<br />
[[Datei:MobileTestingIOSGerät.png | frame | left | Abb. 3: Hinzufügen eines iOS-Geräts]]<br />
<br clear="all"><br />
<br />
Als nächstes geben Sie an, welche App Sie verwenden wollen. Dabei können Sie wählen, ob Sie eine App starten möchten, die bereits auf dem Gerät installiert ist ("''App auf dem Gerät''") oder ob eine App installiert und gestartet werden soll ("''App installieren''"). Für den Fall, dass Sie eine bereits installierte App benutzen wollen, müssen Sie deren Bundle-ID angeben. Diese erfahren Sie ebenfalls im Devices-Fenster von Xcode. Für die Demo-App lautet sie beispielsweise "''de.exept.expeccoMobileDemo''".<br />
<br />
Für dieses Tutorial soll die Demo-App erst installiert werden. Wählen Sie also "''App installieren''" aus und tragen Sie bei App den Pfad zu der Datei auf dem Mac ein (Abb. 4). Wenn Sie expecco 2.11 verwenden, können Sie auf dieser Seite auch die Team-ID angeben, die für iOS-Verbindungen angibt, welches Zertifiat verwendet werden soll. Falls Sie bereits in den [[#Konfiguration_des_Plugins|Plugin-Einstellungen]] eine ID angegeben haben, wird diese verwendet. Sie wird hier grau dargestellt, solange Sie keinen anderen Wert angeben. Klicken Sie nun auf "''Weiter''".<br />
<br />
[[Datei:MobileTestingIOSAppInstallieren.png | frame | left | Abb. 4: App angeben, die auf dem Gerät installiert werden soll]]<br />
<br clear="all"><br />
<br />
Auf der letzten Seite sehen Sie eine Übersicht aller bisherigen Angaben (1) (Abb. 5). Unterhalb der Capabilityliste können Sie einen Namen für die Verbindung angeben, unter dem sie im GUI-Browser angezeigt wird (2). Außerdem lässt sich eine Verbindung über diesen Namen identifizieren und in Bausteinen verwenden; der Name muss daher eindeutig sein. Falls Sie keinen Namen angeben, wird generisch einer erzeugt. Geben Sie als Namen "''expeccoMobileDemo''" ein. Im Feld darunter ist die Adresse zum Appium-Server einzutragen (3). Wenn Sie den Appium-Server mit Standardeinstellungen gestartet haben, müssen Sie dazu nur in der Standardadresse (unterster Eintrag der Vorschlagsliste) "''localhost''" durch die IP-Adresse des Macs ersetzen (im Bild "''172.23.1.49''"). Um sicher zu gehen, auf welchem Port der Appium-Server lauscht, sehen Sie in dessen Ausgabe. Dort finden am Anfang die Zeile<br />
<nowiki>info: Appium REST http interface listener started on 0.0.0.0:4723</nowiki><br />
Steht hier am Ende nicht der Standardport ''4723'' ändern Sie diese Angabe entsprechend ebenfalls in der Konfiguration.<br />
<br />
Wenn die Option "''Bei Bedarf starten''" (4) aktiviert ist, überprüft expecco, ob an der Adresse bereits ein Appium-Server läuft, und startet und beendet ihn bei Bedarf automatisch. Das ist allerdings nur für lokale Serveradressen möglich, schalten Sie diese Option daher ab.<br />
<br />
[[Datei:MobileTestingServerkonfigurationIOS.png | frame | left | Abb. 5: Verbindungsnamen und Appium-Server konfigurieren]]<br />
<br clear="all"><br />
<br />
Klicken Sie nun auf "''Speichern''" (5) um die Einstellungen für die Testausführung zu speichern. Einstellungen können als Anhang einer Testsuite oder in eine externe Datei gespeichert werden (Abb. 6). Falls Sie mehrere Projekte gleichzeitig offen haben, können Sie in der Liste das Projekt auswählen, in dem der Anhang angelegt werden soll. Klicken Sie auf "''Speichern''" im Bereich "''Einstellungen im Anhang speichern''" und geben Sie als Name "''expeccoMobileDemo''" an. Klicken Sie nun auf "''Verbinden''" (6) um mit der angegebenen Konfiguration eine Verbindung herzustellen.<br />
<br />
[[Datei:MobileTestingEinstellungenSpeichern.png | frame | left | Abb. 6: Einstellungen speichern]]<br />
<br clear="all"><br />
<br />
Der Verbindungsaufbau kann eine Weile dauern. Wenn Sie die Server-Adresse korrekt angegeben haben, sollten Sie in der Ausgabe des Appium-Servers den Verbindungsversuch erkennen. Auf Ihrem iOS-Gerät sollte dabei die App gestartet werden. Passiert nichts auf dem Gerät, kann es daran liegen, dass entweder das Gerät oder die App nicht gefunden wird. Versucht Appium hingegen, die App zu starten und dies schlägt fehl, ist wahrscheinlich die App falsch signiert. Deinstallieren Sie in diesem Fall die App, damit sie mit einer neuen Signatur wieder installiert werden kann.<br />
<br />
Warten Sie bis die Verbindung aufgebaut ist und im GUI-Browser angezeigt wird. Nun wissen Sie, dass die Konfiguration funktioniert. Die gespeicherten Einstellungen sollen nun für den Test verwendet werden, der dann die gleiche Verbindung aufbaut. Wählen Sie die Verbindung im GUI-Browser aus, machen Sie einen Rechtsklick und wählen Sie im Kontextmenü "''Verbindung abbauen''", damit es zu keinem Konflikt kommt. Wechseln Sie dann zurück zum Reiter der Testsuite.<br />
<br />
In der Testsuite wurden die Einstellungen als Anhang "''expeccoMobileDemo''" angelegt (Abb 7). Wählen Sie den Baustein ''Connect'' (1) aus und wechseln Sie rechts zur Ansicht "''Netzwerk''" (2). Ziehen Sie per Drag-and-drop die Einstellungen in das Netzwerk des Bausteins (3). Verbinden Sie den Ausgangspin ''pathName'' mit dem Eingangspin ''stringOrFilename[1]'' des Bausteins "''Connect from File''" (4). Mit "''Übernehmen''" (5) bestätigen Sie die Änderungen. Dieser Baustein wird zu Beginn des Tests die Verbindung zur App herstellen.<br />
<br />
[[Datei:MobileTestingConnectblock.png | frame | left | Abb. 7: Verbindungsbaustein editieren]]<br />
<br clear="all"><br />
<br />
Wechseln Sie nun zum Testplan "''Demo-Test''" (1) (Abb. 8). Dieser Testplan enthält bereits einige fertige Testfälle. Vor und nach der Ausführung (2) ist außerdem jeweils ein Baustein eingetragen: Der eben bearbeitete Baustein "''Connect''" für den Aufbau und der Baustein "''Disconnect''" für den Verbindungsabbau. Durch das Eintragen der beiden Bausteine an dieser Stelle geschieht der Verbindungsabbau insbesondere auch dann, wenn der Test vorzeitig abgebrochen wird, z. B. weil einer der Testfälle fehlschlägt.<br />
<br />
[[Datei:MobileTestingTestplan.png | frame | left | Abb. 8: Testplanausführung]]<br />
<br clear="all"><br />
Jetzt können Sie den Testplan "''Demo-Test''" starten, indem Sie auf den grünen Play-Knopf (3) klicken. Der Testplan sollte ohne Fehler durchlaufen.<br />
<br />
=== Schritt 2: Einen Baustein mit dem Recorder erstellen (iOS) ===<br />
Mit Hilfe des integrierten Recorders lassen sich einfach Ausführungssequenzen aufnehmen und in einem Baustein speichern. Dafür muss eine Verbindung zu einem Testgerät bestehen, mit dessen Hilfe der Test erstellt wird.<br />
<br />
Um eine Verbindung aufzubauen, wechseln Sie zurück zum GUI-Browser. In diesem ist noch die Verbindung eingetragen, die Sie zuvor angelegt haben. Da für die Verbindung im Testlauf derselbe Name verwendet wurde, wurden die Einstellungen damit überschrieben (In unserem Fall waren die Einstellungen ohnehin identisch). Die Verbindung ist zur Zeit nicht aktiv, da sie am Ende der Ausführung abgebaut wurde. Die Einstellungen sind dort aber noch eingetragen. Um die Verbindung mit dieser Konfiguration wieder aufzubauen, wählen Sie sie aus, gefolgt von einem Rechtsklick und "''Verbinden''".<br />
<br />
Warten Sie, bis die Verbindung aufgebaut ist (1) und drücken Sie dann den Aufnahme-Knopf (2), um eine Aufzeichnung zu starten (Abb. 9).<br />
<br />
[[Datei:MobileTestingRecorderStarten.png | frame | left | Abb. 9: Recorder starten]]<br />
<br clear="all"><br />
Es öffnet sich ein Fenster mit dem Mobile Testing Recorder (Abb. 10). Dieser zeigt einen Screenshot des verbundenen Geräts. Über diese Anzeige können Sie das Gerät fernsteuern. Dabei wird jede Aktion, die Sie ausführen, im Hintergrund aufgezeichnet.<br />
<br />
In der oberen Menüleiste können Sie das Werkzeug auswählen (1), mit dem Sie eine Aktion eingeben möchten. Als Voreinstellung ist das Werkzeug "''Auto''" ausgewählt. Sie können damit bestimmte Aktionen aufzeichnen, indem Sie mit dem Mauszeiger entsprechende Gesten auf der Anzeige ausführen. Wenn Sie zum Beispiel mit der linken Maustaste lange klicken, entspricht das einem langen Antippen des Elements an dieser Stelle. Anstatt die gewünschte Aktion mit der entsprechenden Geste zu bestimmen, können Sie diese alternativ auch manuell auswählen.<br />
<br />
Es soll nun ein neuer Test für das Erkennen korrekter GTIN-13-Codes aufgenommen werden. Klicken Sie zunächst in der Anzeige kurz auf den Button "''GTIN-13 (EAN-13)''" (2) der App um einen entsprechenden Klick auf dem Gerät auszulösen. Während der Ausführung dieser Aktion wird der Rahmen des Recorders kurzzeitig rot. Falls der Recorder danach nicht die aktuelle Ansicht der App darstellen sollte, klicken Sie im Recorder auf das Aktualisierungssymbol (3).<br />
<br />
[[Datei:MobileTestingRecorder1iOS.png | frame | left | Abb. 10: Über Recorder zur GTIN-13-Activity wechseln]]<br />
<br clear="all"><br />
Anschließend soll im Eingabefeld der neuen Seite eine korrekte GTIN-13 eingegeben werden. Führen Sie dazu einen Rechtsklick auf dem Eingabefeld (1) aus und wählen Sie im Kontextmenü die Aktion "''Text setzen''" (2) (Abb. 11). Geben Sie in den sich daraufhin öffnenden Dialog eine beliebige gültige Artikelnummer im GTIN-13-Format ein, bspw. "''4006381333986''" (3). Dieser Text wird nun in der App gesetzt.<br />
<br />
[[Datei:MobileTestingRecorder2iOS.png | frame | left | Abb. 11: GTIN-13-Code über Recorder eingeben]]<br />
<br clear="all"><br />
Klicken Sie nun auf "''Verify''" (1) (Abb. 12). In der App erscheint nun als Ergebnis "''OK''" (2). Der Test soll feststellen, ob tatsächlich dieses Ergebnis angezeigt wird. Nach einem Rechtsklick darauf können Sie im Kontextmenü die Aktion "''Attribut zusichern''" (3) auswählen. Wählen Sie im Dialog, der sich daraufhin öffnet, die Eigenschaft ''value'' (4) aus und bestätigen Sie mit "''OK''" (5). Dieses Mal wird keine Aktion auf dem Gerät ausgelöst, sondern nur ein Baustein aufgezeichnet, der fehlschlägt, sollte das Ergebnis vom erwarteten Wert "''OK''" abweichen.<br />
<br />
[[Datei:MobileTestingRecorder3iOS.png | frame | left | Abb. 12: Antwort der App über Recorder auslesen]]<br />
<br clear="all"><br />
Schließen Sie nun den Recorder. Im ''Arbeitsbereich'' des GUI-Browsers sehen Sie, dass für jede der aufgenommenen Aktionen ein Baustein angelegt wurde (Abb. 13). Sie können nun testen, ob sich das Aufgenommene wieder abspielen lässt. Dazu müssen Sie zunächst die App auf Ihrem Gerät in den Anfangszustand zurückbringen, indem Sie auf dem Gerät die Schaltfläche "''Home''" oben links benutzen. Klicken Sie dann in expecco auf den grünen Play-Knopf (1). Wird alles grün, war die Ausführung erfolgreich. Erstellen Sie nun daraus einen neuen Baustein in der Testsuite, indem Sie auf das Bausteinsymbol (2) in der rechten oberen Ecke klicken. Geben Sie ihm den Namen "''GTIN_Verify_OK''" (3) und bestätigen Sie (4).<br />
<br />
[[Datei:MobileTestingArbeitsbereich.png | frame | left | Abb. 13: Neuen Baustein aus Arbeitsbereich exportieren]]<br />
<br clear="all"><br />
Bauen Sie nun die Verbindung ab, indem Sie die Verbindung auswählen, rechtsklicken und im Kontextmenü ''Verbindung abbauen'' auswählen.<br />
<br />
Wechseln Sie zurück zum Reiter der Testsuite. Dort wurde der neue Baustein angelegt. Wählen Sie wieder den Testplan "''Demo-Test''" aus und fügen Sie den aufgenommenen Testfall "''GTIN_Verify_OK''" per Drag-and-drop am Ende des Testplans hinzu. Übernehmen Sie die Änderung und starten Sie erneut. Der Testplan sollte wieder ohne Fehler durchlaufen.<br />
<br />
=== Schritt 3: XPath anpassen mithilfe des GUI-Browsers (iOS) ===<br />
Ihr neuer Baustein funktioniert auf anderen Geräten möglicherweise nicht. Die verwendeten Elemente werden über einen XPath adressiert und dieser kann auf anderen Geräten nicht stimmen. Lesen Sie dazu den Abschnitt [[#XPath_anpassen_mithilfe_des_GUI-Browsers|XPath anpassen mithilfe des GUI-Browsers]]. Falls Ihnen ein weiteres Gerät zur Verfügung steht, können Sie nun versuchen, die Pfade in Ihren erstellten Bausteinen zu verallgemeinern. Sie können diesen Schritt aber auch überspringen.<br />
<br />
Wenn es Ihnen schwerfällt, verkürzte Pfade zu finden, orientieren Sie sich dabei an den Pfaden der bereits vorhandenen Bausteine. Starten Sie den Test erneut. Sollte der Test jetzt fehlschlagen, überprüfen Sie die Pfade noch einmal im GUI-Browser.<br />
Um den Test nun auf einem zweiten Gerät auszuführen, öffnen Sie im Menü "''Erweiterungen''" > "''Mobile Testing''" > "''Verbindungseinstellungen erstellen''". Sie erhalten einen Dialog ähnlich zum Verbindungsdialog. Allerdings können Sie hier nur Einstellungen erstellen und speichern aber keine Verbindung herstellen. Sie haben jedoch die Möglichkeit, einzelne Aspekte der Einstellungen zu speichern wie bspw. nur das Gerät. Geben Sie das neue Gerät ein und wählen Sie es aus. Klicken Sie länger auf das Symbol zum Speichern im Anhang bis sich das verzögerte Menü öffnet und wählen Sie hier "''Geräte-Einstellungen speichern''" (Abb. 14). Benennen Sie den Anhang am besten nach dem Gerät. Danach können Sie den Dialog wieder schließen.<br />
<br />
[[Datei:MobileTestingGerätSpeichern.png | frame | left | Abb. 14: Einstellungen für ein Gerät speichern]]<br />
<br clear="all"><br />
Wählen Sie den Baustein "''Connect''" aus und ziehen Sie die Einstellungen für das neue Gerät in dessen Netzwerk. Verbinden Sie nun dessen Ausgangspin ''pathName'' mit dem Eingangspin ''stringOrFilename[2]'' des Bausteins "''Connect from File''". Der Baustein Connect from File liest die Angaben an den Eingangspins von oben nach unten ein, mehrfache Eigenschaften werden dabei ersetzt. In diesem Fall werden also die Einstellungen zum verwendeten Gerät ersetzt, während die übrigen Einstellungen gleich bleiben. Wenn Sie die Pfade geschickt gewählt haben, wird der Test nun auch auf dem anderen Gerät erfolgreich ablaufen.<br />
<br />
=== Schritt 4: Noch einen Baustein erstellen (iOS) ===<br />
Falls sich gleiche Abläufe im Test wiederholen, können Sie dafür bereits erstellte Bausteine wieder-verwenden oder abwandeln. Der in Schritt 2 erstellte Baustein prüft die Erkennung korrekter GTIN-13-Codes. Es fehlt noch ein Test, der umgekehrt das Erkennen eines falschen GTIN-13-Codes prüft. Die Struktur der beiden Tests ist identisch, sie unterscheiden sich lediglich in ihren Parametern. Kopieren Sie daher den Baustein "''GTIN_Verify_OK''" und benennen Sie die Kopie in "''GTIN_Verify_NOT_OK''" um. Ändern Sie die Eingabe der GTIN-13 in einen falschen Code zum Beispiel durch Ändern der letzten Ziffer ("''4006381333987''") und setzen Sie den Überprüfungswert der Ausgabe auf "''NOT OK''" (Abb. 15).<br />
<br />
[[Datei:MobileTestingGTIN_Verify_NOT_OK_iOS.png | frame | left | Abb. 15: Baustein editieren]]<br />
<br clear="all"><br />
Fügen Sie diesen neuen Test ebenfalls zum Testplan Demo-Test hinzu und setzen Sie ihn ans Ende. Führen Sie den Testplan aus, aber vergessen Sie nicht, vorher die Verbindung im GUI-Browser abzubauen.<br />
<br />
Der neue Test wird fehlschlagen, weil Ihr aufgenommener Baustein nicht wieder zur Startseite der App zurückkehrt, die Tests aber jeweils von dort aus starten. In den anderen Bausteinen ist dies bereits berücksichtigt; sie führen abschließend immer den Baustein "''Back to main menu''" aus. Sie sehen das, indem Sie einen der anderen Bausteine, z. B. "''GTIN_Calculate''", auswählen und auf seine Schema-Ansicht wechseln. Dort steht der Baustein "''Back to main menu''" im Feld "''Nach Ausführung''" (Abb. 16). Wie beim entsprechenden Feld beim Testplan wird auch dieser Baustein immer am Ende ausgeführt, unabhängig davon, ob der Test erfolgreich verläuft oder abbricht. Ergänzen Sie diesen Eintrag nun in Ihren Bausteinen "''GTIN_Verify_OK''" und "''GTIN_Verify_NOT_OK''". Wählen Sie dazu den Baustein aus und ziehen Sie in der Schema-Ansicht den Baustein "''Back to main menu''" auf das Eingabefeld "''Nach Ausführung''". Nun können Sie den Testplan starten und alle Tests sollten wieder problemlos ausgeführt werden.<br />
<br />
[[Datei:AppiumDemo Nach Ausführung.png | frame | left | Abb. 16: Nach-Ausführungs-Baustein setzen]]<br />
<br clear="all"><br />
<br />
=== Schritt 5: Test vervollständigen (iOS) ===<br />
Für die Activity IBAN sind bereits alle Antwortmöglichkeiten der App mit Testfällen abgedeckt. In der GTIN-13-Activity werden ein korrekter und ein fehlerhafter Code getestet und eine Prüfziffer berechnet, das Verhalten der App bei Eingaben falscher Länge wird aber bisher nicht getestet (Bei Verify "''Input must be exactly 13 digits''" und "''…12 digits''". bei Calculate). Die Activity zum Prüfen der Seriennummern von Eurobanknoten wird noch gar nicht getestet. Wie bei der IBAN können hier drei Fälle auftreten: eine korrekte Seriennummer wurde eingegeben (Antwort: "''OK''"), eine falsche Seriennummer wurde eingegeben (Antwort: "''NOT OK''") oder die Angabe entspricht nicht dem Format (Antwort: "''A serial number consists of 12 characters with the first one or two being capital letters (A-Z).''"). Sie können die Testabdeckung jetzt noch erweitern, indem Sie entsprechende Testfälle erstellen. Die Bausteine dafür können Sie wie in Schritt 2 mit dem Recorder erstellen und die XPaths bei Bedarf verallgemeinern. Wenn Sie mit dem grundsätzlichen Umgang mit expecco vertraut sind, können Sie Bausteine natürlich auch ohne Recorder erstellen, indem Sie sie manuell aus vorhandenen Bausteinen der Bibliothek zusammensetzen. Sie können auch beide Vorgehensweisen nach Belieben kombinieren.<br />
<br />
Beachten Sie, dass die hier vorgestellten Testfälle jeweils nur einzelne Eingaben prüfen. Wenn Sie Testfälle für Ihre eigenen Apps schreiben, wollen Sie vermutlich engmaschiger testen, indem Sie noch weitere unterschiedliche Werte eingeben, die insbesondere auch Randfälle enthalten.<br />
<br />
= Dialoge des Mobile Testing Plugins =<br />
== Verbindungseditor ==<br />
Mithilfe des Verbindungseditors können Sie schnell Verbindungen definieren, ändern oder aufbauen. Je nach Aufgabe weist der Dialog kleine Unterschiede auf und wird unterschiedlich geöffnet:<br />
*Um eine Verbindung aufzubauen, klicken Sie im GUI-Browser auf "''Verbinden'"' klicken und wählen dann "''Mobile Testing''".<br />
*Um eine bestehende Verbindung im GUI-Browser zu ändern oder zu kopieren, wählen Sie diese aus, machen einen Rechtsklick und wählen im Kontextmenü "''Verbindung bearbeiten''" oder "''Verbindung kopieren''" aus.<br />
*Wollen Sie Verbindungseinstellungen nicht für den GUI-Browser sondern zur Verwendung in einem Test erstellen, wählen Sie im Menü des Mobile Testing Plugins den Punkt "''Verbindungseinstellungen erstellen...''". Darüber können nur die Einstellungen für eine Verbindung erstellt werden, ohne dass eine Verbindung tatsächlich angelegt wird.<br />
<br />
Einige der Schaltflächen sind nur beim Erstellen von Verbindungseinstellungen sichtbar:<br />
[[Datei:MobileTestingVerbindungseditorMenu.png]]<br />
#"''Einstellungen löschen''": Setzt alle Einträge zurück. (Nur beim Erstellen von Einstellungen sichtbar.)<br />
#"''Einstellungen aus Datei laden''": Erlaubt das Öffnen einer gespeicherten Einstellungsdatei (*.csf). Deren Einstellungen werden in den Dialog übernommen. Bereits getätigte Eingaben ohne Konflikt bleiben dabei erhalten.<br />
#"''Einstellungen aus Anhang laden''": Erlaubt das Öffnen eines Anhangs mit Verbindungseinstellungen aus einem geöffneten Projekt. Diese Einstellungen werden in den Dialog übernommen. Bereits getätigte Eingaben ohne Konflikt bleiben dabei erhalten.<br />
#"''Einstellungen in Datei speichern''" sowie<br />
#"''Einstellungen in Anhang speichern''": Hier können Sie die eingetragenen Einstellungen in eine Datei (*.csf) speichern oder als Anhang in einem geöffneten Projekt anlegen. Beide Optionen besitzen ein verzögertes Menü, in dem Sie auswählen können, nur einen bestimmten Teil der Einstellungen zu speichern. (Nur beim Erstellen von Einstellungen sichtbar.)<br />
#"''Erweiterte Ansicht''": Damit können Sie in die erweiterte Ansicht wechseln, um zusätzliche Einstellungen vorzunehmen. Lesen Sie dazu mehr am Ende des Kapitels. (Nur beim Erstellen von Einstellungen sichtbar.)<br />
#"''Hilfe''": An der rechten Seite wird ein Hilfetext zum jeweiligen Schritt ein- oder ausgeblendet.<br />
<br />
<br />
Der Dialog ist in drei Schritte unterteilt. Im ersten Schritt wählen Sie das Gerät, das Sie verwenden möchten, im zweiten Schritt wählen Sie aus, welche App verwendet werden soll und im letzten Schritt erfolgen die Einstellungen zum Appium-Server.<br />
<br />
===<span id="AppiumConnectionEditorStep1"><!-- Referenced by AppiumConnectionEditor in Mobile Testing Plugin --></span>Schritt 1: Gerät auswählen===<br />
Im oberen Teil erhalten Sie eine Liste aller angeschlossenen Appium-Geräte, die erkannt werden. Mit der Checkbox darunter können Sie die Geräte ausblenden, die zwar erkannt werden, aber nicht bereit sind. Falls Sie ein Gerät eintragen wollen, das nicht angeschlossen ist, können Sie dies mit dem entsprechenden Knopf "''Android-Gerät eingeben''" bzw. "''iOS-Gerät eingeben''" anlegen. Dazu müssen Sie jedoch die benötigten Eigenschaften Ihres Geräts kennen. Das Gerät wird dann in einer zweiten Geräteliste angelegt und kann dort ausgewählt werden. Wenn keine Liste mit angeschlossenen Elementen angezeigt werden kann, werden stattdessen verschiedene Meldungen angezeigt:<br />
*Keine Geräte gefunden<br />
*:expecco konnte kein Android-Geräte finden.<br />
*:Um eine Verbindung zu einem Gerät automatisch zu konfigurieren, stellen Sie sicher, dass es<br />
*:*angeschlossen ist<br />
*:*eingeschaltet ist<br />
*:*einen passenden adb-Treiber installiert hat<br />
*:*für Debugging freigeschaltet ist (siehe unten).<br />
*Keine verfügbaren Geräte gefunden<br />
*:expecco konnte keine verfügbaren Android-Geräte finden. Es wurden aber nicht verfügbare gefunden, z.B. mit dem Status "unauthorized".<br />
*:Um eine Verbindung zu einem Gerät automatisch zu konfigurieren, stellen Sie sicher, dass es<br />
*:*angeschlossen ist<br />
*:*eingeschaltet ist<br />
*:*einen passenden adb-Treiber installiert hat<br />
*:*für Debugging freigeschaltet ist (siehe unten).<br />
*:Um nicht verfügbare Geräte anzuzeigen, aktivieren Sie unten diese Option.<br />
*Verbindung verloren<br />
*:expecco hat die Verbindung zum adb-Server verloren. Versuchen Sie die Verbindung wieder herzustellen, indem Sie auf den Button klicken.<br />
*Verbindung fehlgeschlagen<br />
*:expecco konnte sich nicht mit dem adb-Server verbinden. Möglicherweise läuft er nicht oder der angegebene Pfad stimmt nicht.<br />
*:Überprüfen Sie die adb-Konfiguration in den Einstellungen und versuchen Sie den adb-Server zu starten und eine Verbindung herzustellen indem Sie auf den Knopf klicken.<br />
*Verbinden ...<br />
*:expecco verbindet sich mit dem adb-Server. Dies kann einige Sekunden dauern.<br />
*adb-Server starten ...<br />
*:expecco startet den adb-Server. Dies kann einige Sekunden dauern.<br />
<br />
<!--Bei "''Automatisierung durch''" können Sie angeben, welche Automation-Engine verwendet werden soll. Lassen Sie die Einstellung auf "''(Default)''" wird die entsprechende Capability gar nicht gesetzt. Ansonsten stehen Appium, Selendroid und ab expecco 2.11 XCUITest zur Verfügung. In der Regel wird Selendroid nur für Android-Geräte vor Version 4.1 gebraucht.-->Mit "''Weiter''" gelangen Sie zum nächsten Schritt. Wenn Sie Einstellungen für den GUI-Browser eingeben, ist das erst möglich, wenn ein Gerät ausgewählt wurde.<br />
<br />
<span id="UnlockingDeveloperOptions">Anmerkung zum Freischalten</span>: In jüngeren Android Versionen werden die Entwickleroptionen zunächst nicht mehr in den Einstellungen angeboten. Falls ihr Android Gerät in den Einstellungen keinen Eintrag zu "''Entwickleroptionen''" zeigt, wählen Sie zunächst den Eintrag "''Telefoninfo''", dann "''SoftwareVersionsInfo''" und klicken darin mehrfach auf den Eintrag "''BuildVersion''".<br />
<br />
===<span id="AppiumConnectionEditorStep2"><!-- Referenced by AppiumConnectionEditor in Mobile Testing Plugin --></span>Schritt 2: App auswählen===<br />
Hier können Sie Angaben zur App machen, die getestet werden soll. Dabei können Sie entscheiden, ob Sie eine App verwenden wollen, die bereits auf dem Gerät installiert ist, oder ob für den Test eine App installiert werden soll. Wählen Sie oben den entsprechenden Reiter aus. Je nachdem, ob Sie im vorigen Schritt ein Android- oder ein iOS-Gerät ausgewählt haben, ändert sich die erforderte Eingabe.<br />
<br />
*'''Android'''<br />
**''App auf dem Gerät''<br />
**:Wenn Sie im ersten Schritt ein angeschlossenes Gerät ausgewählt haben, werden die Pakete aller installierten Apps automatisch abgerufen und Sie können die Auswahl aus den Drop-down-Listen treffen. Die installierten Apps sind in Fremdpakete und Systempakete unterteilt; wählen Sie die entsprechende Paketliste aus. Diese Auswahl gehört nicht zu den Einstellungen, sondern stellt nur die entsprechende Paketliste zur Verfügung. Sie können den Filter benutzen, um die Liste weiter einzuschränken und dann das gewünschte Paket auswählen. Die Activities des ausgwählten Pakets werden ebenfalls automatisch abgerufen und als Drop-down-Liste zur Verfügung gestellt. Wählen Sie die Activity aus, die gestartet werden soll. In der Regel wird automatisch eine Activity aus der Liste eingetragen. Falls Sie kein verbundenes Gerät verwenden, müssen Sie die Eingabe des Pakets und der Activity von Hand vornehmen.<br />
**''App installieren''<br />
**:Geben Sie bei "''App''" den Pfad zu einer App an. Der Pfad muss für den Appium-Server gültig sein, der verwendet wird. Sie können auch eine URL angeben. Benutzen Sie einen lokalen Appium-Server, können Sie den rechten Butten benutzen, um zu der Installationsdatei der App zu navigieren und diesen Pfad einzutragen. Wenn möglich werden dabei auch das entsprechende Paket und die Activity in den Feldern darunter eingetragen. Diese Angabe ist aber nicht notwendig.<br />
<br />
*'''iOS'''<br />
**''App auf dem Gerät''<br />
**:Geben Sie die Bundle-ID einer installierten App an. Sie können die IDs der installierten Apps bspw. mithilfe von Xcode erfahren. Starten Sie dazu Xcode und wählen Sie in der Menüleiste am oberen Bildschirmrand im Menü "''Window''" den Eintrag "''Devices''". Es öffnet sich ein Fenster, in dem eine Liste der angeschlossenen Geräte angezeigt wird. Wenn Sie Ihr Gerät auswählen, sehen Sie in der Übersicht eine Auflistung der von Ihnen installierten Apps.<br />
**''App installieren''<br />
**:Geben Sie bei "''App''" den Pfad zu einer App an. Der Pfad muss für den Appium-Server gültig sein, der verwendet wird. Sie können auch eine URL angeben. Zu den Vorraussetzungen an Apps für reale Geräte lesen Sie bitte den Abschnitt [[#iOS-Ger.C3.A4t_und_App_vorbereiten|iOS-Geräte und App vorbereiten]].<br />
<br />
Im unteren Teil können Sie festlegen, ob die App beim Verbindungsabbau zurückgesetzt bzw. deinstalliert werden soll, und ob sie initial zurückgesetzt werden soll. Auch hier wird die entsprechende Capability gar nicht gesetzt, wenn Sie "''(Default)''" auswählen. Mit "''Weiter''" gelangen Sie zum nächsten Schritt.<br />
<br />
===<span id="AppiumConnectionEditorStep3"><!-- Referenced by AppiumConnectionEditor in Mobile Testing Plugin --></span>Schritt 3: Servereinstellungen===<br />
Im letzten Schritt befindet sich zunächst im oberen Teil eine Liste aller Capabilities, die sich aus Ihren Angaben der vorigen Schritte ergeben. Wenn Sie sich mit Appium auskennen und noch zusätzliche Capabilities setzen möchten, die der Verbindungseditor nicht abdeckt, können Sie durch Klicken auf "''Bearbeiten''" in die erweiterte Ansicht gelangen. Lesen Sie dazu den Abschnitt weiter unten.<br />
<br />
Wenn Sie Einstellungen für den GUI-Browser eingeben, können Sie den ''Verbindungsnamen'' eintragen, mit dem die Verbindung angezeigt wird. Dies ist auch der Name unter dem Bausteine diese Verbindung verwenden können, wenn sie aufgebaut ist. Wenn Sie das Feld frei lassen, wird ein Name generiert. Um die Adresse für den Appium-Server anzugeben, erhalten Sie die lokale Standard-Adresse und bereits verwendete Adressen zur Auswahl. Wenn Sie den Haken für "''Bei Bedarf starten''" setzen, versucht expecco beim Verbinden einen Appium-Server an der angegebenen Adresse zu starten, wenn dort noch keiner läuft. Dieser Server wird dann beim Beenden der Verbindung ebenfalls heruntergefahren. Dies funktioniert nur für lokale Adressen. Achten Sie darauf, nur Portnummern zu verwenden, die auch frei sind. Verwenden Sie am besten nur ungerade Portnummern ab dem Standardport 4723. Beim Verbindungsaufbau wird ebenfalls die folgende Portnummer verwendet, wodurch es sonst zu Konflikten kommen könnte.<br />
<br />
Je nachdem, wie Sie den Dialog geöffnet haben, gibt es nun verschiedene Schaltflächen um ihn abzuschließen. In jedem Fall haben Sie die Option zu speichern. Dabei öffnet sich ein Dialog, indem Sie entweder ein geöffnet Projekt auswählen können, um die Einstellungen dort als Anhang zu speichern, oder auswählen es in einer Datei zu speichern, die Sie anschließend angeben können. Durch das Speichern wird der Dialog nicht beendet, wodurch Sie anschließend noch eine andere Option auswählen könnten.<br />
<br />
Wenn Sie den Editor zum Verbindungsaufbau geöffnet haben, können Sie abschließend auf "''Verbinden''" oder "''Server starten und verbinden''" klicken, je nachdem, ob der Haken für den Serverstart gesetzt ist. Für das Ändern oder Kopieren einer Verbindung im GUI-Brower heißt diese Option "''Übernehmen''", da in diesem Fall nur der Verbindungseintrag geändert bzw. neu angelegt wird, der Verbindungsaufbau aber nicht gestartet wird. Das können Sie bei Bedarf anschließend über das Kontextmenü tun. Falls Sie Capabilities einer bestehenden Verbindung geändert haben, fordert Sie anschließend ein Dialog auf zu entscheiden, ob diese Änderungen direkt übernommen werden sollen, indem die Verbindung abgebaut und mit den neuen Verbindungen aufgebaut wird, oder nicht. In diesem Fall werden die Änderungen erst wirksam, nachdem Sie die Verbindung neu aufbauen.<br />
<br />
Zur Verwendung des Verbindungseditors lesen Sie auch den entsprechenden Abschnitt im jeweiligen Tutorial in Schritt 1 (Android: [[#Schritt_1:_Demo_ausf.C3.BChren|Demo ausführen]], iOS: [[#Schritt_1:_Demo_ausf.C3.BChren_.28iOS.29|Demo ausführen (iOS)]]).<br />
<br />
===Erweiterte Ansicht===<br />
Die erweiterte Ansicht des Verbindungseditors erhalten Sie entweder durch Klicken auf "''Bearbeiten''" im dritten Schritt oder jederzeit über den entsprechenden Menüeintrag, wenn Sie den Editor über das Plugin-Menü gestartet haben. In dieser Ansicht erhalten Sie eine Liste aller eingestellten Appium-Capabilities. Zu dieser können Sie weitere hinzufügen, Einträge ändern oder entfernen. Um eine Capability hinzuzufügen, wählen Sie diese aus der Drop-down-Liste des Eingabefelds aus. In dieser befinden sich alle bekannten Capabilities sortiert in die Kategorien ''Common'', ''Android'' und ''iOS''. Haben Sie eine Capability ausgewählt, wird ein kurzer Informationstext dazu angezeigt. Sie können in das Feld auch von Hand eine Capability eingeben. Klicken Sie dann auf "''Hinzufügen''", um die Capabilitiy in die Liste einzutragen. Dort können Sie in der rechten Spalte den Wert setzen. Um einen Entrag zu löschen, wählen Sie diesen aus und klicken Sie auf "''Entfernen''". Mit "''Zurück''" verlassen Sie die erweiterte Ansicht.<br />
<br />
[[Datei:MobileTestingErweiterteAnsicht.png]]<br />
<br />
== Laufende Appium-Server ==<br />
Im Menü des Mobile Testing Plugins finden Sie den Eintrag "''Appium-Server...''". Mit diesem öffnen Sie ein Fenster mit einer Übersicht aller Appium-Server, die von expecco gestartet wurden und auf welchem Port diese laufen. Durch Klicken auf das Icon in der Spalte "''Log anzeigen''" können Sie das Logfile des entsprechenden Servers anschauen. Dieses wird beim Beenden des Servers wieder gelöscht. Mit den icons in der Spalte "''Beenden''" kann der entsprechenden Server beendet werden. Allerdings wird dies verhindert, wenn expecco über diesen Server noch eine offene Verbindung hat.<br />
<br />
Außerdem können Sie hier auch Server starten. Verwenden Sie die Eingabefelder zur Konfiguration der Serveradresse. Sie können die Felder auch frei lassen, um die Standardwerte zu verwenden. Bitte beachten Sie, dass Server nur lokal gestartet werden können und der gewählte Port nicht belegt sein darf. Typischerweise werden die ungeraden Portnummern ab 4723 verwendet. Die folgende Portnummer wird beim Verbinden mit einem Gerät ebenfalls benötigt, wodurch es mit den geraden Nummern zu Konflikten kommen könnte.<br />
<br />
[[Datei:MobileTestingAppiumServer.png]]<br />
<br />
Im Menü des Mobile Testing Plugins finden Sie auch den Eintrag "''Alle Verbindungen und Server beenden''". Dies ist für den Fall gedacht, dass Verbindungen oder Server auf andere Weise nicht beendet werden können. Beenden Sie Verbindungen wenn möglich immer im GUI-Browser oder durch Ausführen eines entsprechenden Bausteins. Server, die Sie in der Server-Übersicht gestartet haben, beenden Sie dort; Server, die mit einer Verbindung gestartet wurden, werden automatisch mit dieser beendet.<br />
<br />
Beachten Sie, dass in der Übersicht nur Server aufgelistet sind, die von expecco gestartet und verwaltet werden. Mögliche andere Appium-Server, die auf andere Art gestartet wurden, werden nicht erkannt.<br />
<br />
== Recorder ==<br />
Besteht im GUI-Browser eine Verbindung zu einem Gerät, kann der integrierte Recorder verwendet werden, um mit diesem Gerät einen Testabschnitt aufzunehmen. Sie starten den Recorder, indem Sie im GUI-Browser die entsprechende Verbindung auswählen und dann auf den Aufnahme-Knopf klicken. Für den Recorder öffnet sich ein neues Fenster. Die aufgezeichneten Aktionen werden im Arbeitsbereich des GUI-Browsers angelegt. Daher ist es möglich, das Aufgenommene parallel zu editieren.<br />
<br />
[[Datei:MobileTestingRecorder.png|caption|]]<br />
<br />
;Komponenten des Recorderfensters<br />
#'''Aktualisieren''': Holt das aktuelle Bild und den aktuellen Elementbaum vom Gerät. Dies wird nötig, wenn das Gerät zur Ausführung einer Aktion länger braucht oder sich etwas ohne das Anstoßen durch den Recorder ändert.<br />
#'''Follow-Mouse''': Das Element unter dem Mauszeiger wird im GUI-Browser ausgewählt.<br />
#'''Element-Highlighting''': Das Element unter dem Mauszeiger wird rot umrandet.<br />
#'''Elemente einzeichnen''': Die Rahmen aller Elemente der Ansicht werden angezeigt.<br />
#'''Werkzeuge''': Auswahl, mit welchem Werkzeug aufgenommen werden soll. Die gewählte Aktion wird bei einem Klick auf die Anzeige ausgelöst. Dabei stehen folgende Aktionen zur Verfügung:<br />
#*Aktionen auf Elemente:<br />
#**Klicken: Kurzer Klick auf das Element, über dem der Cursor steht. Zur genaueren Bestimmung, welches Element verwendet wird, benutzen Sie die Funktion Follow-Mouse oder Element-Highlighting.<br />
#**Element antippen: Ähnlich zum Klicken, nur dass zusätzlich die Dauer des Klicks aufgezeichnet wird. Dadurch sind auch längere Klicks möglich.<br />
#**Text setzen: Ermöglicht das Setzen eines Textes in Eingabefelder.<br />
#**Text löschen: Löscht den Text eines Eingabefelds.<br />
#*Aktionen auf das Gerät:<br />
#**Antippen: Löst einen Klick auf die Bildschirmposition aus, bei dem auch die Dauer berücksichtigt wird.<br />
#**Wischen: Wischen in einer geraden Linie vom Punkt des Drückens des Mausknopfes bis zum Loslassen. Die Dauer wird ebenfalls aufgezeichnet.<br />
#:Beachten Sie bei diesen Aktionen, dass das Ergebnis sich auf verschiedenen Geräten unterscheiden kann, bspw. bei verschiedenen Bildschirmauflösungen.<br />
#*Erstellen von Testablauf-Bausteinen<br />
#**Attribut prüfen: Vergleicht den Wert eines festgelegten Attributs des Elements mit einem vorgegebenen Wert. Das Ergebnis triggert den entsprechenden Ausgang.<br />
#**Attribut zusichern: Vergleicht den Wert eines festgelegten Attributs des Elements mit einem vorgegebenen Wert. Bei Ungleichheit schlägt der Test fehl.<br />
#*Auto<br />
#:Ist das Auto-Werkzeug ausgewählt, können alle Aktionen durch spezifische Eingabeweise benutzt werden: ''Klicken'', ''Element antippen'' und ''Wischen'' funktionieren weiterhin durch Klicken, wobei sie anhand der Dauer und der Bewegung des Cursors unterschieden werden. Um ein ''Antippen'' auszulösen, halten Sie beim Klicken Strg gedrückt. Die übrigen Aktionen erhalten Sie durch einen Rechtsklick auf das Element in einem Kontextmenü.<br />
#'''Softkeys''': Nur unter Android. Simuliert das Drücken der Knöpfe Zurück, Home, Fensterliste und Power.<br />
#'''Home-Button''': Nur unter iOS ab expecco 2.11. Ermöglicht das Drücken des Home-Buttons. Vor expecco 19.2 funktioniert es nur, wenn AssistiveTouch aktiviert ist und sich das Menü in der Mitte des oberen Bildschirmrands befindet. Ab expecco 19.2 verwendet die Funktion kein AssistiveTouch mehr.<br />
#'''Anzeige''': Zeigt einen Screenshot des Geräts. Aktionen werden mit der Maus je nach Werkzeug ausgelöst. Wenn eine neue Aktion eingegeben werden kann, hat das Fenster einen grünen Rahmen, sonst ist er rot.<br />
#'''Fenster an Bild anpassen''': Ändert die Größe des Fensters so, dass der Screenshot vollständig angezeigt werden kann.<br />
#'''Bild an Fenster anpassen''': Skaliert den Screenshot auf eine Größe, mit der er die volle Größe des Fensters ausnutzt.<br />
#'''Ausrichtung anpassen''': Korrigiert das Bild, falls dieses auf dem Kopf stehen sollte. Über den Pfeil rechts daneben kann das Bild auch um 90° gedreht werden, falls dies einmal nötig sein sollte. Die Ausrichtung des Bildes ist für die Funktion des Recorders unerheblich, dieser arbeitet ausschließlich auf den erhaltenen Elementen.<br />
#'''Skalierung''': Ändert die Skalierung des Screenshots.<br />
#'''Kontrollleuchte''': Zeigt den Zustand des Recorders an<br />
#:''grün'': Der Recorder ist bereit<br />
#:''rot'': Der Recorder ist blockiert, weil die Anzeige und die Elementliste aktualisiert werden<br />
#:''grau'': Der Recorder kann nicht mehr verwendet werden, da die Verbindung zum Gerät verloren gegangen ist<br />
<br />
;Verwendung<br />
Mit jedem Klick im Fenster wird eine Aktion ausgelöst und im Arbeitsbereich des GUI-Browsers aufgezeichnet. Dort können Sie das Aufgenommene abspielen, editieren oder daraus einen neuen Baustein erstellen.<br />
Aktionen zum Auslösen von Sofkeys finden Sie direkt in der Menüleiste (s.o.). Um Aktionen auf Elemente aufzuzeichen, ändern Sie entweder die Auswahl des Werkzeugs in der Menüleiste (s.o.) und klicken dann auf das Element oder wählen Sie die entsprechende Aktion aus dem Kontextmenü durch einen Rechtsklick auf das entsprechende Element aus. Für Texteingabe ist es zudem möglich, den Cursor über dem Element zu platzieren und den Text einzugeben. Dabei öffnet sich der Eingabedialog für diese Aktion.<br />
Zur Verwendung des Recorders lesen Sie auch Schritt 2 im Tutorial ([[#Schritt_2:_Einen_Baustein_mit_dem_Recorder_erstellen|Android]] bzw. [[#Schritt_2:_Einen_Baustein_mit_dem_Recorder_erstellen_2|iOS]]).<br />
<br />
== AVD Manager und SDK Manager ==<br />
AVD Manager und SDK Manager sind beides Anwendungen von Android. Im Menü des Mobile Testing Plugins bietet expecco die Möglichkeit, diese zu starten. Ansonsten finden Sie diese Programme bei Ihrer Android-Installation. Mit dem AVD Manager können Sie AVDs, also Konfigurationen für Emulatoren, erstellen, bearbeiten und starten. Mit dem SDK Manager erhalten Sie einen Überblick über Ihre Android-Installation und können diese bei Bedarf erweitern.<br />
<br />
= Hybrid-Apps und WebViews =<br />
<br />
'''!!! WICHTIGER HINWEIS - Wenn Sie Probleme haben, auf den Webview zu wechseln, geben Sie bitte unter den Android Einstellungen - Apps -Standard Apps "Chrome" als "Browser-App" an !!!<br />
'''<br />
<br />
Hybrid-Apps enthalten neben den Plattform-nativen Elementen weitere Elemente, die in einen WebView eingebunden sind. Diese Elemente können ebenfalls bedient werden, allerdings muss zuvor in den entsprechenden Kontext gewechselt werden. Mit dem Baustein "''Get Current Context''" erhalten Sie den aktuellen Kontext. Zu Beginn ist dies "''NATIVE_APP''", also der Kontext der nativen Elemente. Mit dem Baustein "''Get Context Handles''" bekommen Sie eine Collection aller vorhandenen Kontexte. Gibt es einen WebView-Kontext, so heißt dieser "''WEBVIEW_1''" oder "''WEBVIEW_<package>''" mit dem Paket des WebViews. Es kann auch mehrere WebView-Kontexte geben. Zu jedem WebView-Kontext gibt es im nativen Kontext ein entsprechendes WebView-Element. Mit dem Baustein "''Switch to Context''" können Sie in einen solchen Kontext wechseln und haben fortan nur Zugriff auf die Elemente in diesem Kontext.<br />
<br />
Im GUI-Browser werden zum einen oben im Baum die vorhandenen Kontexte angezeigt, zum anderen wird der Baum eines Kontexts unterhalb des entsprechenden WebView-Elements eingefügt.<br />
<br />
= XPath anpassen mithilfe des GUI-Browsers =<br />
Bausteine, die auf einem Gerät fehlerfrei funktionieren, tun dies auf anderen Geräten möglicherweise nicht. Auch können kleine Änderungen der App dazu führen, dass ein Baustein nicht mehr den gewünschten Effekt hat. Man sollte einen Baustein daher so robust formulieren, dass er für eine Vielzahl von Geräten verwendet werden kann und kleine Anpassungen an der App verkraftet. Dazu muss man das grundlegende Funktionsprinzip der Adressierung verstehen. Dies wird im Folgenden am Beispiel der App aus dem Tutorial erläutert.<br />
<br />
Die Ansicht der App setzt sich aus einzelnen Elementen zusammen. Dazu gehören die Schaltflächen "''GTIN-13 (EAN-13)''" und "''Verify''", das Eingabefeld der Zahl "''4006381333986''" und das Ergebnisfeld, in dem OK erscheint, wie auch alle anderen auf der Anzeige sichtbaren Dinge. Diese sichtbaren Elemente sind in unsichtbare Strukturelemente eingebettet. Alle Elemente zusammen sind in einer zusammenhängenden Hierarchie, dem Elementbaum, organisiert.<br />
<br />
[[Datei:MobileTestingGUIBrowser.png | frame | left | Abb. 1: Funktionen des GUI-Browsers]]<br />
<br clear="all"><br />
Sie können sich diesen Baum im GUI-Browser ansehen. Wechseln Sie dazu in den GUI-Browser (Abb. 1) und starten Sie eine beliebige Verbindung. Sobald die Verbindung aufgebaut ist, können Sie den gesamten Baum aufklappen (1) (Klick bei gedrückter Strg-Taste). Er enthält alle Elemente der aktuellen Seite der App.<br />
<br />
Ein Baustein, der nun ein bestimmtes Element verwendet, muss dieses eindeutig angeben, indem er dessen Position im Elementbaum mit einem Pfad im XPath-Format beschreibt. Dieses Format ist ein verbreiteter Web-Standard für XML-Dokumente und -Datenbanken, eignet sich aber genauso für Pfade im Elementbaum.<br />
<br />
Wenn Sie ein Element im Baum auswählen, wird unten der von expecco automatisch generierte XPath (2) für das Element angezeigt, der auch beim Aufzeichnen verwendet wird. Oberhalb davon in der Mitte des Fensters befindet sich eine Liste der Eigenschaften (3) des ausgewählten Elements. Man nennt diese Eigenschaften auch Attribute. Sie beschreiben das Element näher wie beispielsweise seinen Typ, seinen Text oder andere Informationen zu seinem Zustand. Links unten können Sie zur besseren Orientierung im Baum die ''Vorschau'' (4) aktivieren, um sich den Bildausschnitt des Elements anzeigen zu lassen.<br />
<br />
Der Elementbaum für gleiche Ansicht einer App kann sich je nach Gerät unterscheiden. Es sind diese Unterschiede, die verhindern, eine Aufnahme von einem Gerät unverändert auch auf allen anderen Geräten abzuspielen: Ein XPath, der im einen Elementbaum ein bestimmtes Element identifiziert, beschreibt nicht unbedingt das gleiche Element im Elementbaum auf einem anderen Gerät. Es kann stattdessen passieren, dass der XPath auf kein Element, auf ein falsches Element oder auf mehrere Elemente passt. Dann schlägt der Test fehl oder er verhält sich unerwartet.<br />
<br />
Man könnte natürlich für jedes Gerät einen eigenen Testfall schreiben. Das brächte aber unverhältnismäßigen Aufwand bei Testerstellung und -wartung mit sich. Das Problem lässt sich auch anders lösen, da ein jeweiliges Element nicht nur durch genau einen XPath beschrieben wird. Vielmehr erlaubt der Standard mithilfe verschiedener Merkmale unterschiedliche Beschreibungen für ein und dasselbe Element zu formulieren. Das Ziel ist daher, einen Pfad zu finden, der auf allen für den Test verwendeten Geräten funktioniert und überall eindeutig zum richtigen Element führt.<br />
<br />
Im Beispiel besteht die Verbindung zur Android-App aus dem Tutorial und der Eintrag des "''GTIN-13''"-Buttons ist ausgewählt (5). Dessen automatisch generierter XPath (2) kann beispielsweise so aussehen:<br />
<br />
<blockquote>//hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[@resource id='android:id/content']/android.widget.RelativeLayout/android.widget.Button[@resource-id='de.exept.expeccomobiledemo:id/gtin_13']</blockquote><br />
<br />
Er ist offensichtlich lang und unübersichtlich. Der sehr viel kürzere Pfad<br />
<br />
<blockquote>//*[@text='GTIN-13 (EAN-13)']</blockquote><br />
<br />
führt zum selben Element.<br />
<br />
Für die iOS-App lautet der automatisch generierte XPath für diesen Button beispielsweise<br />
<br />
<blockquote>//AppiumAUT/XCUIElementTypeApplication/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeButton[2]</blockquote><br />
bzw.<br />
<blockquote>//AppiumAUT/UIAApplication/UIAWindow[1]/UIAButton[2]</blockquote><br />
<br />
und kann kürzer als<br />
<br />
<blockquote>//*[@name='GTIN-13 (EAN-13)']</blockquote><br />
<br />
geschrieben werden.<br />
<br />
Sie können den Pfad entsprechend im GUI-Browser ändern und durch "''Pfad überprüfen''" (6) feststellen, ob er weiterhin auf das ausgewählte Element zeigt, was expecco mit "''Verify Path: OK''" (7) bestätigen sollte. Der erste, sehr viel längere Pfad, beschreibt den gesamten Weg vom obersten Element des Baumes bis hin zum gesuchten Button. Der zweite Pfad hingegen wählt mit "*" zunächst sämtliche Elemente des Baumes und schränkt die Auswahl dann auf genau die Elemente ein, die ein ''text''- bzw. ''name''-Attribut mit dem Wert "''GTIN-13 (EAN-13)''" besitzen, in unserem Fall also genau der eine Button, den wir suchen.<br />
<br />
Im folgenden werden Android-ähnliche Pfade zur Veranschaulichung verwendet. Die Elemente in iOS-Apps heißen zwar anders, wodurch andere Pfade entstehen; das Prinzip ist jedoch das gleiche.<br />
<br />
[[Datei:MobileTestingBaum1.png | frame | Abb. 2: Elementbaum einer fiktiven App]]<br />
<br />
Sie können solche Pfade mit Hilfe weniger Regeln selbst formulieren. Sehen Sie sich den einfachen Baum einer fiktiven Android-App in Abb. 2 an: Die Einrückungen innerhalb des Baumes geben die Hierarchie der Elemente wieder. Ein Element ist ein ''Kind'' eines anderen Elementes, wenn jenes andere Element das nächsthöhere Element mit einem um eins geringeren Einzug ist. Jenes Element ist das ''Elternelement'' des Kindes. Sind mehrere untereinander stehende Elemente gleich eingerückt, so sind sie also alle Kinder desselben Elternelements.<br />
<br />
Ein Pfad durch alle Ebenen der Hierarchie zum TextView-Element ist nun:<br />
<br />
<blockquote>//hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.TextView</blockquote><br />
<br />
Die Elemente sind mit Schrägstrichen voneinander getrennt. Es fällt auf, dass der Name des ersten Elements nicht mit dem im Baum übereinstimmt. Das oberste Element in der Hierarchie heißt immer "''hierarchy''" (für iOS wäre es "''AppiumAUT''"), expecco zeigt im Baum stattdessen den Namen der Verbindung an, damit man mehrere Verbindungen voneinander unterscheiden kann. Die weiteren Elemente tragen jeweils das Präfix "''android.widget.''", das im Baum zur besseren Übersicht nicht angezeigt wird. Bei IOS gibt es kein Präfix, das durch einen Punkt abgetrennt wäre, expecco 2.11 blendet aber entsprechend "''XCUIElementType''" am Anfang aus. Mit jedem Schrägstrich führt der Pfad über eine Eltern-Kind-Beziehung in eine tiefere Hierarchie-Ebene, d. h. "''FrameLayout''" ist ein Kindelement von "''hierarchy''", "''LinearLayout''" ist ein Kind von "''FrameLayout''" usw. Die in eckigen Klammern geschriebenen Wörter dienen nur als Orientierungshilfe im Baum. Sie gehören nicht zum Typ.<br />
<br />
Ein Pfad muss nicht beim Element "''hierarchy''" beginnen. Man kann den Pfad beginnend mit einem beliebigen Element des Baumes bilden. Man kann also verkürzt auch<br />
<br />
<blockquote>//android.widget.TextView</blockquote><br />
<br />
schreiben. Der Pfad führt zum selben "''TextView''"-Element, da es nur ein Element dieses Typs gibt. Anders verhält es sich bei dem Pfad<br />
<br />
<blockquote>//android.widget.Button.</blockquote><br />
<br />
Da es zwei Elemente vom Typ "''Button''" gibt, passt dieser Pfad auf zwei Elemente, nämlich den Button, der mit "''An''" markiert ist, und den ''Button'', der mit "''Aus''" markiert ist. Es würde an dieser Stelle aber auch nicht helfen den langen Pfad von ''hierarchy'' aus beginnend anzugeben. Um einen mehrdeutigen Pfad weiter zu differenzieren, kann man explizit ein Element aus einer Menge wählen, indem man den numerischen Index in eckigen Klammern dahinter schreibt. Der Pfad aus dem obigen Beispiel lässt sich damit so anpassen, dass er eindeutig auf den ''Button'' mit der Markierung "''Aus''" weist:<br />
<br />
<blockquote>//android.widget.Button[1].</blockquote><br />
<br />
Ihnen fällt sicher auf, dass der Index eine 1 ist obwohl das zweite Element gemeint ist. Das kommt daher, dass die Zählung bei 0 beginnt. Der Button mit der Markierung "An" hat also die Nummer 0 und der ''Button'' mit der Markierung "''Aus''" hat die Nummer 1.<br />
<br />
Dieser Ansatz, einen expliziten Index zu verwenden, hat zwei Nachteile: Zum einen lässt sich an dem Pfad nur schwer ablesen welches Element gemeint ist, zum andern ist der Pfad sehr empfindlich schon gegenüber kleinsten Änderungen, wie zum Beispiel dem Vertauschen der beiden ''Button''-Elemente oder dem Einfügen eines weiteren ''Button''-Elements in der App.<br />
<br />
Es wäre daher wünschenswert, das gemeinte Element über eine ihm charakteristische Eigenschaft wie einen Attributwert, zu adressieren. Für Android-Apps eignet sich hierfür häufig das Attribut "''resource-id''". Im Idealfall muss bei der Entwicklung der App darauf geachtet werden, dass jedes Element eine eindeutige Id erhält. Die ''resource-id'' hat den großen Vorteil, dass sie unabhängig vom Text des Elements oder der Spracheinstellung des Geräts ist. Für iOS-Apps kann entsprechend das Attribut "''name''" verwendet werden, wenn es von der App sinnvoll gesetzt wird. Der XPath-Standard erlaubt solche Auswahlbedingungen zu einem Element anzugeben. Angenommen, der ''Button'' mit der Markierung "''Aus''" hat die Eigenschaft ''resource-id'' mit dem Wert ''off'' und der ''Button'' mit der Markierung "''An''" hat als ''resource-id'' den Wert ''on'', dann kann man als eindeutigen Pfad für den "Aus"-''Button''<br />
<br />
<blockquote>//android.widget.Button[@resource-id='off']</blockquote><br />
<br />
formulieren. Wie an dem Beispiel zu sehen werden solche Bedingungen wie ein Index in eckigen Klammern an den Elementtyp angehängt. Der Name eines Attributes wird mit einem "@" eingeleitet und der Wert mit einem "=" in Anführungszeichen angehängt. Ist der Attributwert global eindeutig, kann man den vorausgehenden Pfad sogar durch den globalen Platzhalter * ersetzen, der auf jedes Element passt. Das obige Beispiel mit dem GTIN-13-''Button'' war ein solcher Fall.<br />
<br />
[[Datei:MobileTestingBaum2.png | frame | Abb. 3: Elementbaum einer fiktiven App mit Erweiterungen]]<br />
<br />
Abb. 3 zeigt eine Erweiterung des Beispiels aus Abb. 2. Die App hat nun ein weiteres, nahezu identisches ''LinearLayout'' bekommen. Die ''Buttons'' sind in ihren Attributen jeweils ununterscheidbar. Deshalb funktioniert der vorige Ansatz nicht, einen eindeutigen Pfad nur mithilfe eines Attributwerts zu formulieren. Offensichtlich unterscheiden sich aber ihre benachbarten ''TextViews''. Es ist möglich die jeweilige ''TextView'' in den Pfad mit aufzunehmen, um einen ''Button'' dennoch eindeutig zu adressieren. Ein Pfad zum ''Button'' mit der Markierung "''An''" unterhalb der ''TextView'' mit der Markierung "''Druckschalter''" kann dabei wie folgt aussehen:<br />
<br />
<blockquote>//android.widget.TextView[@resource-id='push']/../android.widget.Button[@resource-id='on']</blockquote><br />
<br />
Der erste Teil beschreibt den Pfad zu der ''TextView'' mit der Markierung "''Druckschalter''" und der ''resource-id'' mit dem Wert ''push''. Danach folgt ein Schrägstrich gefolgt von zwei Punkten. Die zwei Punkte sind eine spezielle Elementbezeichnung, die nicht ein Kindelement benennt, sondern zum Elternelement wechselt, in diesem Fall also das ''LinearLayout'', in dem die ''TextView'' eingebettet ist. Im Kontext dieses ''LinearLayout'' ist der restliche Pfad, nämlich der ''Button'' mit der ''resource-id'' mit dem Wert ''on'', eindeutig.<br />
<br />
Der XPath-Standard bietet noch sehr viel mehr Ausdrucksmittel. Mit der hier knapp vorgestellten Auswahl ist es aber bereits möglich für die meisten praktischen Testfälle gute Pfade zu formulieren. Eine vollständige Einführung in XPath ginge über den Umfang dieser Einführung weit hinaus. Sie finden zahlreiche weiterführende Dokumentationen im Web und in Büchern.<br />
<br />
Eine universelle Strategie zum Erstellen guter XPaths gibt es nicht, da sie von den Testanforderungen abhängt. In der Regel ist es sinnvoll, den XPath kurz und dennoch eindeutig zu halten. Häufig lassen sich Elemente über Eigenschaften identifizieren wie beispielsweise ihren Text. Will man aber gerade den Text eines Elements auslesen, kann dieser natürlich nicht im Pfad verwendet werden, da er vorher nicht bekannt ist. Ebenso wird der Text variieren, wenn die App mit verschiedenen Sprachen gestartet wird.<br />
<br />
Jeder Baustein, der auf einem Element arbeitet, hat einen Eingangspin für den XPath. Im GUI-Browser finden Sie in der Mitte oben eine Liste von Bausteinen mit Aktionen, die Sie auf das ausgewählte Element anwenden können. Suchen Sie den Baustein ''Click'' (8) im Ordner Elements und wählen Sie ihn aus (Abb. 1). Er wird im rechten Teil unter "''Test''" eingefügt, der Pin für den XPath ist mit dem automatisch generierten Pfad des Elements vorbelegt (9). Sie können den Baustein hier auch ausführen. Die Ansicht wechselt dann auf "''Lauf''". Ändert sich durch die Aktion der Zustand Ihrer App, müssen Sie den Baum anschließend aktualisieren (10).<br />
<br />
Wenn Sie in der unteren Liste eine Eigenschaft auswählen, wechselt die Anzeige der Bausteine zu "''Eigenschaften''", wo Sie die eigenschaftsbezogenen Bausteine finden. Wie bei den Aktionen können Sie auch hier einen Baustein auswählen, der dann rechts in Test mit dem Pfad des Elements und der ausgewählten Eigenschaft eingetragen wird, sodass Sie ihn direkt ausführen können.<br />
<br />
== Weitere Locator-Strategien ==<br />
Appium bietet neben XPath noch weitere Strategien zur Adressierung von Elementen an. Einige davon stehen Ihnen '''ab Version 20.1''' ebenfalls mit expecco zur Verfügung. Diese sind nicht ganz so mächtig wie XPath, dafür aber häufig schneller bei der Auflösung auf dem Gerät. Insbesondere bei der Verwendung mit iPhones, wo die Hierarchie bei jeder XPath-Auflösung erst aufgebaut werden muss, bieten alternative Strategien einen Vorteil für die Laufzeit.<br />
<br />
XPath ist weiterhin der Standard, das heißt alle Locator ohne besondere Angabe werden als XPath interpretiert. Um eine der anderen Strategien zu verwenden, schreiben Sie diese mit einem Gleichzeichen vor den gewünschten Locator. Diese Technik können Sie sowohl an den Blöcken verwenden, als auch im GUI-Browser testen.<br />
<br />
{|<br />
|-<br />
| style="vertical-align:top" | AccessibilityId || style="padding-bottom:0.5em" | Verwendet den Wert des Elements, der dazu dient, die App barrierefrei zu machen. Für iOS ist das das Attribut '''Accessibility-id''', für Android das Attribut '''content-descr'''. ''Beispiel: accessibilityId=Löschen''<br />
|-<br />
| style="vertical-align:top" | className || style="padding-bottom:0.5em" | Verwendet den Namen der Klasse des Elements. ''Beispiel: className=android.widget.FrameLayout''<br />
|-<br />
| style="vertical-align:top" | id || style="padding-bottom:0.5em" | Verwendet die Kennung des Elements. Für iOS ist das das Attribut '''name''', für Android das Attribut '''resource-id'''. ''Beispiel: id=android:id/text1''<br />
|-<br />
| style="vertical-align:top" | iOSClassChain<sup>1</sup> || style="padding-bottom:0.5em" | Verwendet die Hierarchie der Elemente ähnlich wie bei XPath. Eine Erklärung zum Aufbau finden Sie [https://github.com/facebookarchive/WebDriverAgent/wiki/Class-Chain-Queries-Construction-Rules hier]. ''Beispiel: iOSClassChain=XCUIElementTypeWindow/XCUIElementTypeButton[`label == "Ok"`]''<br />
|-<br />
| style="vertical-align:top; padding-right:1em" | iOSNsPredicateString<sup>1</sup> || style="padding-bottom:0.5em" | Verwendet einfache Kriterien, wie Attribute, die auch kombiniert werden können. ''Beispiel: iOSNsPredicateString=type == 'XCUIElementTypeButton' AND name == 'Weiter'''<br />
|-<br />
| style="vertical-align:top" | name<sup>1</sup> || style="padding-bottom:0.5em" | Verwendet den Namen des Elements. ''Beispiel: name=Bestätigen''<br />
|-<br />
|}<br />
<br />
:<sup>1</sup> ''nur für iOS''<br />
<br />
Um eine direkte Beschleunigung mit iOS zu erzielen, ohne dass Sie Ihre bisherigen Pfade anpassen müssen, wandelt expecco zudem Pfade, die nur aus einem Element mit Klasse und name-Attribut bestehen, zur Laufzeit automatisch in einen entsprechenden Locator der Strategie iOSNsPredicateString um. Wenn Sie einen Pfad explizit als XPath markieren, wird diese Anpassung nicht vorgenommen.<br />
<br />
=<span id="troubleshooting"><!-- Referenced by error dialog on connection error --></span>Probleme und Lösungen=<br />
==Locator sind Versionsabhängig oder variabel ==<br />
Dann sollten Sie die Locator (xPath) entweder in einer Variablen<br />
halten oder ein Locator-Mapping in einem Screenplay Anhang definieren. Es ist auch möglich, lediglich Teile des Locators (z.B. Lochtor-Pfad eines Elternelements oder Attributwert) in einer Variable zu halten und im Freezevalue des Locator-Pins mit "$(varName)"einzufügen.<br />
==Unsichtbare UI-Elemente==<br />
Beachten Sie, dass im [[#Recorder|Recorder]] auch Elemente berücksichtigt werden, die Sie auf dem Bildschirm nicht sehen. Schalten Sie daher das Element-Highlighting an oder nutzen Sie die Follow-Mouse-Funktion und den Elementbaum im GUI-Browser, um festzustellen, ob das richtige Element verwendet wird.<br />
==iOS: Kabel nicht zertifiziert==<br />
In manchen Fällen erscheint beim Verbinden eines iOS-Geräts über USB der Hinweis, das verwendete Kabel sei nicht zertifiziert. In diesem Fall hilft es nur, das entsprechende Kabel auszutauschen.<br />
==iOS: Alerts beim Verbinsungsaufbau==<br />
Stellen Sie sicher, dass beim Verbindungsaufbau mit einem iOS-Gerät keine Alerts geöffnet sind. Der Aufbau schlägt sonst fehl, da die App nicht in den Vordergrund kommen kann. Siehe auch [[#iOS-Ger.C3.A4t_und_App_vorbereiten|iOS-Gerät und App vorbereiten]].<br />
==iOS: .ipa installieren nicht möglich==<br />
Beachten Sie, dass auf iOS-Simulatoren keine ''.ipa''-Dateien sondern nur ''.app''-Dateien installiert werden können.<br />
==Android: Gerät nicht im Verbindungsdialog==<br />
Wenn ein über USB angeschlossenes Android-Gerät nicht im Verbindungsdialog auftaucht, versuchen Sie, den USB-Verbindungstyp zu ändern. In der Regel sollten MTP oder PTP funktionieren. Prüfen Sie nochmal, ob "USB Debugging" in den Entwicklereinstellungen des Geräts aktiviert ist (diese Einstellungen sind bei manchen Geräten zunächst unsichtbar, und müssen durch einen Trick zugänglich gemacht werden). Siehe auch [[#Android-Ger.C3.A4t_vorbereiten|Android-Gerät vorbereiten]].<br />
<br />
==Android: Softkeys==<br />
Bei Android-Geräten, die Softkeys automatisch ein- und ausblenden, kann es vorkommen, dass der Recorder im unteren Bereich Elemente abschneidet, die durch die Softkeys verdeckt würden, auch wenn sie zu diesem Zeitpunkt gar nicht angezeigt werden. In diesem Fall hift es, die Softkeys so einzustellen, dass sie permanent angezeigt werden.<br />
<br />
==Keine Aktion bei Klick==<br />
Der Baustein zum Klicken auf ein Element ist erfolgreich, aber auf dem Gerät wurde keine Aktion ausgeführt.<br />
:Dies kann vorkommen, wenn das Element von einem anderen Element verdeckt ist und ein Klick auf das Element deshalb nicht möglich ist. In diesem Fall wird von Appium kein Fehler geworfen, sondern es passiert einfach nichts. Wenn Sie dennoch einen Klick an der Position des Elements machen möchten, auch wenn es verdeckt ist, benutzen Sie stattdessen den Baustein ''Tap'' und übergeben Sie diesem die Position des Elements (''Get Location''). Wenn Sie stattdessen vor einem Klick prüfen möchten, ob das Element zu diesem Zeitpunkt verdeckt ist, versuchen Sie, ob Ihnen die Eigenschaften ''Is Displayed'' oder ''Is Enabled'' weiterhelfen.<br />
<br />
==Kein Update nach Aktion==<br />
Über den Recorder wurde eine Aktion ausgeführt, für die auch ein Baustein aufgezeichnet wurde, der Recorder zeigt aber immer noch das alte Bild.<br />
:Der Recorder zeigt kein Livebild des Geräts, sondern immer nur eine Momentaufnahme. Nachdem eine Aktion ausgeführt wurde, aktualisiert sich der Recorder automatisch. Es kann aber vorkommen, dass das Bild schon aktualisiert wurde, bevor die Auswirkungen der Aktion auf dem Gerät vollständig abgeschlossen sind. In diesem Fall sollten Sie den Recorder von Hand aktualisieren über das Symbol mit den blauen Pfeilen, siehe Beschreibung zum [[#Recorder|Recorder]].<br />
<br />
=="clickable" Attribut falsch==<br />
Ein Element hat im "''clickable''" Attribut/Property den Wert "''false''", ist aber dennoch anklickbar.<br />
:Das "''clickable''" Attribute muss explizit vom App-Programmierer gesetzt werden, und hat tatsächlich keine Relevanz für das tatsächliche Verhalten der App. Sie sollten dieses Attribut i.A. in Ihren Tests nicht beachten.<br>Leider existieren viele Apps, bei denen der Programmierer hier "lazy" war.<br />
<br />
==Verbindungsaufbau schlägt fehl==<br />
Schlägt der Verbindungsaufbau mit dem Appium-Server fehl, erhalten Sie in expecco eine Fehlermeldung ähnlicher der unten abgebildeten.<br />
<br />
[[Datei:MobileTestingVerbindungsfehler.png]]<br />
<br />
Hier sehen Sie die Art des aufgetretenen Fehlers. Klicken Sie auf "''Details''" um nähere Informationen zu erhalten. Mögliche Fehler sind:<br />
*''org.openqa.selenium.remote.UnreachableBrowserException''<br />
:Der angegebene Server läuft nicht oder ist nicht erreichbar. Überprüfen Sie die Serveradresse.<br />
*''org.openqa.selenium.WebDriverException''<br />
:Lesen Sie in den Details in der ersten Zeile die Meldung hinter ''Original Error'':<br />
:*''Unknown device or simulator UDID''<br />
::Entweder ist das Gerät nicht richtig angeschlossen oder die udid stimmt nicht.<br />
:*''Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65''<br />
::Dieser Fehler kann verschiedene Ursachen haben. Entweder konnte tatsächlich der WebDriverAgent nicht gebaut werden, weil die Signierungseinstellungen falsch sind oder das passende Provisioning Profile fehlt. Lesen Sie dazu den Abschnitt zur [[#Signierung|Signierung]]. Es kann auch sein, dass der WebDriverAgent auf dem Gerät nicht gestartet werden kann, weil sich beispielsweise ein Alert im Vordergrund befindet oder Sie dem Entwickler nicht vertraut haben.<br />
:*''Could not install app: 'Command 'ios-deploy [...] exited with code 253'''<br />
::Die angegebene App kann nicht auf dem iOS-Gerät installiert werden, weil es nicht im Provisioning Profile der App eingetragen ist.<br />
:*''Bad app: [...] App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name.'''<br />
::Der Pfad zur App ist falsch. Stellen Sie sicher, dass sich die Datei unter dem angegebenen Pfad auf dem Mac befindet.<br />
:*''packageAndLaunchActivityFromManifest failed.''<br />
::Die angegebene ''apk''-Datei ist vermutlich kaputt.<br />
:*''Could not find app apk at [...]''<br />
::Der Pfad zur App ist falsch. Stellen Sie sicher, dass sich die ''apk''-Datei am angegebenen Pfad befindet.<br />
<br />
<br />
Falls der Fehler nicht durch eine der oben gelisteten Ursachen bedingt ist, kann es sein, dass die auf dem Gerät befindlichen Automation-Anwendungen nicht mehr richtig funktionieren. Hier hilft es, diese vom Mobilgerät zu deinstallieren. Beim nächsten Verbindungsaufbau werden sie dann automatisch neu installiert.<br />
<br />
*Für iOS-Geräte ist das der WebDriverAgent, den Sie einfach vom Home-Screen deinstallieren können. Dies behebt in der Regel Probleme durch den Wechsel des verwendeten Macs oder der Xcode-Version.<br />
<br />
*Für Android-Geräte ist es der UIAutomator2; hier tritt auf einigen Geräten sporadisch ein Problem auf, die Ursache dafür ist uns z.Z. noch nicht bekannt. Zur Deinstallation navigieren Sie auf dem Gerät zu "''Einstellungen''" > "''Anwendungen''"<sup>*</sup> und suchen in der Liste nach folgenden Einträgen:<br />
Appium Settings<br />
io.appium.uiautomator2.server<br />
io.appium.uiautomator2.server.test<br />
:Klicken Sie auf die jeweilige Anwendung und dann auf "''Deinstallieren''".<br />
<sup>*</sup>''Der entsprechende Eintrag heißt auf manchen Geräten möglicherweise etwas anders.''<br />
<br />
<br />
Falls dies nicht hilft, kann eventuell die Ausgabe des Appium-Servers weiterhelfen. Für einen von expecco gestarteten Server finden Sie das Log in der Liste der [[#Laufende_Appium-Server|laufenden Appium-Server]].<br />
<br />
==Ich habe keinen Mac==<br />
Vielleicht hilft Ihnen diese Webseite weiter: [https://www.howtogeek.com/289594/how-to-install-macos-sierra-in-virtualbox-on-windows-10 https://www.howtogeek.com/289594/how-to-install-macos-sierra-in-virtualbox-on-windows-10]</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Mobile_Testing_Plugin&diff=24501Mobile Testing Plugin2021-10-28T14:35:03Z<p>Mb: /* Hybrid-Apps und WebViews */</p>
<hr />
<div>= Einleitung =<br />
Mit dem ''Mobile Testing Plugin'' können Anwendungen auf Android- und iOS-Geräten getestet werden. Dabei ist es egal, ob reale mobile Endgeräte oder emulierte Geräte verwendet werden. Das Plugin kann (und wird üblicherweise) zusammen mit dem [[Expecco_GUI_Tests_Extension_Reference|GUI-Browser]] verwendet werden, der das Erstellen von Tests unterstützt. Zudem ist damit das Aufzeichnen von Testabläufen möglich.<br />
<br />
Zur Verbindung mit den Geräten wird [http://appium.io/ Appium] verwendet. Appium ist ein freies Open-Source-Framework zum Testen und Automatisieren von mobilen Anwendungen.<br />
<br />
Zur Einarbeitung in das Mobile Plugin empfehlen wir das [[#Tutorial|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.<br />
<br />
= Installation und Aufbau =<br />
Zur Verwendung des Mobile Testing Plugins müssen Sie expecco inkl. des Plugins Mobile Testing installiert haben und Sie benötigen die entsprechenden Lizenzen. expecco kommuniziert mit den Mobilgeräten über einen Appium-Server, der entweder auf demselben Rechner wie expecco läuft, oder auf einem zweiten Rechner. Dieser muss für expecco erreichbar sein.<br />
<br />
==Installationsübersicht==<br />
<br />
'''Rechner, auf dem expecco läuft:'''<br />
* Java JDK Version 8, 9, 10, 11 oder neuer <sup>1)</sup><br />
'''Rechner, an dem Android-Geräte angeschlossen sind:'''<br />
* Appium-Server'', diesen können Sie über das Mobile Testing Supplement installieren (s.u.), von dem wir regelmäßig einen neue Version zur Verfügung stellen''<br />
* Android SDK'', dieses erhalten Sie ebenfalls mit dem Mobile Testing Supplement''<br />
* Java JDK Version 8, 9, 10, 11 oder neuer <sup>1)</sup><br />
'''Rechner, an dem iOS-Geräte angeschlossen sind<sup>2)</sup>:'''<br />
* Appium-Server'', diesen können Sie über das Mobile Testing Supplement für Mac OS installieren (s.u.), von dem wir regelmäßig einen neue Version zur Verfügung stellen''<br />
* Xcode ''in einer Version, die die verwendete iOS-Version unterstützt, erhältlich über den Apple App Store''<br />
* Java JDK Version 8, 9, 10, 11 oder neuer <sup>1)</sup><br />
* Apple-Entwickler-Zertifikat mit zugehörigem privaten Schlüssel ''(zum Signieren des WebDriverAgents)''<br />
* Provisioning Profile mit den verwendeten Mobilgeräten<br />
<br />
<br />
Je nach Aufbau können die oben genannten Rechner auch das selbe Gerät sein. expecco kann sich sowohl über das Netzwerk mit einem entfernten Appium-Server und dort angeschlossenen Mobilgeräten verbinden, als auch lokal selbst einen Appium-Server starten und diesen mit lokalen Mobilgeräten verwenden. Einige Funktionen von expecco, die die Erstellung von Testfällen erleichtern, sind jedoch nur verfügbar, wenn die Mobilgeräte am selben Rechner angeschlossen sind, auf dem auch expecco läuft. Ein möglich Aufbau kann daher wie in folgender Abbildung aussehen:<br />
<br />
[[Datei:MobileTestingAufbau.png | 400px]]<br />
<br />
Im Folgenden wird die Installation von Appium und anderer nötiger Programme für Windows und Mac OS erklärt.<br />
<br />
<sup>1)</sup>: Zum Zeitpunkt der Erstellung dieses Dokuments wurden Versionen bis 11 auf Funktion verifiziert. Neuere Versionen sollten - sofern nicht grundlegende Änderungen von Oracle vorgenommen wurden, ebenfalls funktionieren.<br />
<br />
<sup>2)</sup>: Beachten Sie, dass aufgrund der Voraussetzungen (keine Anbindung an nicht-Apple Geräte verfügbar) iOS-Geräte nur von einem Mac aus angesteuert werden können. Sie benötigen also einen Mac als "Vermittler" (siehe auch unten: [[#Ich habe keinen Mac | "Ich habe keinen Mac"]])<br />
<br />
== Windows ==<br />
Am einfachsten installieren Sie alles mit unserem Mobile Testing Supplement <sup>1</sup>. In neueren Versionen ist allerdings aufgrund geänderter Lizenzbedingungen seitens Oracle kein JDK mehr enthalten, sodass sie dieses zusätzlich instalieren müssen.<br />
*'''expecco 20.1''': [https://download.exept.de/transfer/h-expecco-20.1.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.10.1.0]<br />
:Nur kleine Änderungen im Vergleich zur vorigen Version.<br />
*expecco 19.2: [http://download.exept.de/transfer/h-expecco-19.2.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.10.0.0]<br />
:Im Vergleich zur vorigen Version wurde Appium auf die Version 1.16.0-rc.1 aktualisiert und node 12 verwendet. <br />
*expecco 19.1: [http://download.exept.de/transfer/h-expecco-19.1.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.8.1.0]<br />
:Dieses installiert Appium in der Version 1.12.0 und enthält nun zusätzlich build-tools der Version 28.0.3 im android-sdk. Ansonsten ist es gleich wie die vorige Version.<br />
*expecco 18.2: [http://download.exept.de/transfer/h-expecco-18.2.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.7.3.0]<br />
:Dieses installiert Appium in der Version 1.8.1. Außerdem bietet das Supplement auch an, ''Android Debug Bridge'' und ''Google USB Driver'' ([https://gsmusbdrivers.com/download/adb-fastboot-drivers/ adb-setup-1.4.3]) zu installieren. Damit sind Treiber für ein breites Spektrum an Android-Geräten abgedeckt, sodass Sie nicht für jedes Gerät einen eigenen Treiber suchen und installieren müssen. Ein '''JDK ist (aufgrund geänderter Lizenzbedingungen seitens Oracle) nicht mehr enthalten''', dieses müssen Sie selbst herunterladen, z.B. von [https://www.oracle.com/technetwork/java/javase/downloads/index.html Oracle].<br />
*expecco 18.1: wie expecco 2.11<br />
*expecco 2.11: [http://download.exept.de/transfer/h-expecco-2.11.1/MobileTestingSupplement_1.6.0.2_Setup.exe Mobile Testing Supplement 1.6.0.2]<br />
:Dieses installiert ein Java JDK der Version 8, android-sdk und Appium in der Version 1.6.4. Außerdem bietet das Supplement auch einen universellen adb-Treiber ([http://download.clockworkmod.com/test/UniversalAdbDriverSetup.msi ClockworkMod]) an. Dieser vereint Treiber für ein breites Spektrum an Android-Geräten, sodass Sie nicht für jedes Gerät einen eigenen Treiber suchen und installieren müssen.<br />
*expecco 2.10: [http://download.exept.de/transfer/h-expecco-2.10.0/Mobile_Testing_Supplement_1.5.0.0_Setup.exe Mobile Testing Supplement 1.5.0.0]<br />
:Dieses installiert ein Java JDK der Version 8, android-sdk und Appium in der Version 1.4.16. Während der Installation wird die grafische Oberfläche von Appium gestartet, dieses Fenster können Sie sofort wieder schließen. Außerdem bietet das Supplement auch einen universellen adb-Treiber ([http://download.clockworkmod.com/test/UniversalAdbDriverSetup.msi ClockworkMod]) an. Dieser vereint Treiber für ein breites Spektrum an Android-Geräten, sodass Sie nicht für jedes Gerät einen eigenen Treiber suchen und installieren müssen.<br />
<br />
Wenn expecco Mobilgeräte verwenden soll, die an einem anderen Rechner angeschlossen sind, müssen Sie dort einen Appium-Server starten. Dies können Sie mit der Datei <code>appium_standalone.cmd</code> tun. Der Server wird dann mit dem Standard-Port 4723 gestartet. Falls Sie eine andere Portnummer verwenden wollen, starten Sie den Server mit<br />
<br />
appium_standalone.cmd -p <portnummer><br />
<br />
Der Server ist bereit, sobald die Zeile<br />
<blockquote>Appium REST http interface listener started on 0.0.0.0:4723</blockquote><br />
angezeigt wird, wobei Sie am Ende die verwendete Portnummer ablesen können.<br />
<br />
Beim ersten Starten von Appium – sowohl im Standalone als auch gestartet von expecco – kann es vorkommen, dass die Windows-Firewall den Node-Server blockiert. Lassen Sie den Zugriff zu, sonst kann Appium nicht gestartet werden.<br />
<br />
<sup>1</sup>) Sie können natürlich auch die Command Line Tools (adb, sdkmanager, avdmanager etc.) einer vorhandenen Android Studio Version verwenden, sowie Appium separat installieren.<br />
Da sich diese Tools regelmäßig ändern, und es in der Vergangenheit zu Inkompatibilitäten und Fehlern nach Releasewechseln kam, empfehlen wir zu Beginn, das mitgelieferte Paket zu verwenden. Dies ist möglicherweise nicht das aktuellste, wurde aber auf Lauffähigkeit getestet.<br />
<br />
Falls das Android Mobilgerät an einem entfernen Rechner angeschlossen ist,<br />
können Sie den aktuellen Bildschirminhalt z.B. mit dem [https://github.com/Genymobile/scrcpy scrcpy] tool live mitverfolgen.<br />
<br />
== Mac OS ==<br />
Hinweis: Wenn Sie nicht vorhaben, iOS-Geräte (iPhone, iPad, etc.) zu testen, können Sie das Folgende ignorieren. '''Der Apple-Rechner sowie das Mac-Setup werden für Android-Geräte nicht benötigt'''.<br />
<br />
=== Xcode ===<br />
Zur Automatisierung mit iOS-Geräten wird [https://developer.apple.com/xcode/ Xcode] benötigt. Sie erhalten dieses über den App Store. Dabei ist darauf zu achten, dass die Version zu den getesteten iOS-Versionen passt:<br />
{| class="wikitable"<br />
|-<br />
|'''iOS'''&nbsp;&nbsp; <br />
|'''Xcode'''<br />
|'''macOS'''<br />
|-<br />
|10.x<br />
|8.x<br />
|10.12 (Sierra)<br />
|-<br />
|11.x<br />
|9.x<br />
|10.13 (High Sierra)<br />
|-<br />
|12.x<br />
|10.x<br />
|10.14 (Mojave)<br />
|-<br />
|13.x<br />
|11.x<br />
|10.15 (Catalina)<br />
|}<br />
Ebenso müssen die Minor-Versionen passen, d.h. <br />
* für iOS 10.'''2''' mindestens Xcode 8.'''2''', <br />
* für iOS 10.'''3''' mindestens Xcode 8.'''3''', <br />
* usw. <br />
Wenn Sie also auf eine neuere iOS-Version wechseln, benötigen Sie in der Regel auch eine neuere Xcode-Version. Neuere Versionen von Xcode laufen möglicherweise nicht auf älteren Betriebssystemen, was wiederum eine Aktualisierung des Betriebssystems erforderlich machen kann. Falls Sie auch ältere iOS-Versionen testen wollen kann es sinnvoll sein, die entsprechenden Xcode-Versionen parallel zu installieren.<br />
<br />
Siehe auch [https://en.wikipedia.org/wiki/Xcode#Version_comparison_table Xcode-Versionen].<br />
<br />
=== Appium ===<br />
Appium können Sie über das Mobile Testing Supplement für Mac OS istallieren:<br />
* '''expecco 20.2''': [https://download.exept.de/transfer/h-expecco-20.2.0/Mobile_Testing_Supplement_for_Mac_OS.tar.bz2 Mobile Testing Supplement für Mac OS (1.2.2)]<br />
:Enthält Appium Version 1.18.3 und verwendet node 14.<br />
<br />
* expecco 20.1: [https://download.exept.de/transfer/h-expecco-20.1.0/Mobile_Testing_Supplement_for_Mac_OS.tar.bz2 Mobile Testing Supplement für Mac OS (1.2.0)]<br />
:Nur wenige Änderungen im Vergleich zur vorigen Version.<br />
<br />
* expecco 19.2: [http://download.exept.de/transfer/h-expecco-19.2.0/MobileTestingSupplement_for_MacOS.tar.bz2 Mobile Testing Supplement für Mac OS (1.1.98)]<br />
:Im Vergleich zur vorigen Version wurde Appium auf die Version 1.16.0-rc.1 aktualisiert und es wird node 12 verwendet. <br />
<br />
* expecco 19.1: [http://download.exept.de/transfer/h-expecco-19.1.0/Mobile_Testing_Supplement_for_Mac_OS_1.1.96.tar.bz2 Mobile Testing Supplement für Mac OS (1.1.96)]<br />
:Diese Version enthält Appium 1.12.0. <br />
<br />
* expecco 18.1: [http://download.exept.de/transfer/h-expecco-18.1.0/Mobile_Testing_Supplement_for_Mac_OS_1.1.94.tar.bz2 Mobile Testing Supplement für Mac OS (1.1.94)]<br />
:Diese Version enthält Appium 1.8.0.<br />
<br />
* expecco 2.11: [http://download.exept.de/transfer/h-expecco-2.11.1/Mobile_Testing_Supplement_for_Mac_OS_1.0.94.tar.bz2 Mobile Testing Supplement für Mac OS (1.0.94)]<br />
:Diese Version enthält Appium 1.6.4.<br />
<br />
* expecco 2.10: [http://download.exept.de/transfer/h-expecco-2.10.0/Mobile_Testing_Supplement_for_Mac_OS_1.0.tar.bz2 Mobile Testing Supplement für Mac OS]<br />
:Diese Version entält Appium 1.4.16.<br />
<br />
Nachdem Herunterladen des Supplements, können Sie es in ein Verzeichnis Ihrer Wahl (z. B. Ihr Home-Verzeichnis) verschieben und dort entpacken. Ein geeigneter Befehl in einer Shell könnte wie folgt aussehen, passen Sie dabei die Versionsnummer entsprechend an:<br />
<br />
tar -xvpf Mobile_Testing_Supplement_for_Mac_OS_1.1.98.tar.bz2<br />
<br />
Wenn Sie Ihre Standard-Xcode-Installation verwenden wollen, können Sie Appium direkt über die Datei im ''bin''-Verzeichnis mit der entsprechenden Versionsnummer starten:<br />
<br />
Mobile_Testing_Supplement/bin/start-appium-1.16.0-rc.1<br />
<br />
Falls Sie ein anderes Xcode als das als Standard konfigurierte verwenden wollen, müssen Sie Appium den entsprechenden Pfad über die Umgebungsvariable ''DEVELOPER_DIR'' angeben. <br />
Wenn Sie Xcode z. B. in ''/Applications/Xcode-11.3.app'' installiert haben, müssten Sie Appium so starten:<br />
<br />
DEVELOPER_DIR="/Applications/Xcode-11.3.app/Contents/Developer" Mobile_Testing_Supplement/bin/start-appium-1.16.0-rc.1<br />
<br />
Was als Standard-Xcode-Installation gesetzt ist, zeigt der Befehl:<br />
<br />
xcode-select -p<br />
<br />
Wenn Appium Ihre Xcode-Installation nicht findet, erscheint beim Verbinden eine Fehlermeldung in der Art:<br />
''<blockquote>org.openqa.selenium.SessionNotCreatedException - A new session could not be created. (Original error: Could not find path to Xcode, environment variable DEVELOPER_DIR set to: /Applications/Xcode.app but no Xcode found)</blockquote>''<br />
Starten Sie in diesem Fall Appium erneut, unter Angabe eines gültigen ''DEVELOPER_DIR''.<br />
<br />
=== Signierung ===<br />
Um eine Testverbindung mit einem Gerät aufbauen zu können, brauchen Sie einen Apple-Account. Zur Evaluierung können Sie einen kostenlosen Account verwenden. Dieser hat den Nachteil, dass erstellte Profile nur eine Woche gültig sind und danach neu erstellt werden müssen. Seien Sie auch vorsichtig, wenn Sie sich den Account teilen, da es vorkommen kann, dass Zertifikate widerrufen werden oder durch automatische Generierung ungültig werden. Als Folge können bereits signierte Apps nicht mehr verwendet werden.<br />
<br />
Schließen Sie zuerst das Gerät, das Sie verwenden möchten, über USB an den Mac an. Starten Sie Xcode und öffnen Sie ''Preferences''. Wechseln Sie zur Seite der Accounts und legen Sie einen Eintrag mit Ihrem Account an. Anschließend können Sie auf ''Manage Certificates...'' klicken, um die Zertifikate zu sehen, die zu diesem Account gehören. Zum Ausführen von Tests benötigen Sie ein iOS-Development-Zertifikat und den dazugehörigen privaten Schlüssel. Wenn Sie noch keines besitzen, erstellen Sie eines. Wenn Sie bereits eines haben, aber es nicht in Ihrem Schlüsselbund vorhanden ist (erkennbar an dem Hinweis "Not in Keychain"), können Sie es importieren. Öffnen Sie in jedem Fall die [https://support.apple.com/de-de/guide/keychain-access/welcome/mac Schlüsselbundverwaltung] auf dem Mac und wählen Sie den Schlüsselbund ''Anmeldung'' aus. Wenn im Schlüsselbund eines anderen Nutzers bereits ein entsprechendes Zertifikat angelegt ist, können Sie dieses dort als PKCS#12-Datei (Endung typischerweise .p12) exportieren. Um ein Zertifikat in Ihren Schlüsselbund zu importieren, wählen Sie im Menü ''Ablage'' die Option ''Objekte importieren''. Falls Sie nicht wissen, wo das Zertifikat gespeichert ist, können Sie es in Xcode auch widerrufen und in Ihrem Schlüsselbund neu anlegen. Machen Sie das jedoch nur, wenn Sie wissen, dass das alte Zertifikat nicht mehr in Verwendung ist, da es danach nicht mehr benutzt werden kann. Nun sollte der Schlüsselbund ein iOS-Development-Zertifikat enthalten. Wählen Sie im Rechtsklick-Menü den Punkt ''Informationen'' aus. Unter den Details des Zertifikats finden Sie die Team-ID, die hier als Organisationseinheit bezeichnet wird. Tragen Sie diese in den Einstellungen des Plugins im Feld ''Team-ID'' ein, siehe [[#Konfiguration_des_Plugins|Konfiguration des Plugins]].<br />
<br />
Kehren Sie zu Xcode zurück und wählen Sie im Menü ''File'' den Eintrag ''Open...'', um das WebDriverAgent-Projekt zu öffnen. Dieses befindet sich im Verzeichnis des Mobile Testing Supplements unter<br />
''<nowiki>Mobile_Testing_Supplement/lib/node_modules/appium-1.16.0-rc.1/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj</nowiki>''<br />
<br />
[[Datei:MobileTestingWebDriverAgentXcode.png]]<br />
<br />
Wählen Sie ''WebDriverAgentLib'' und die Seite ''Signing & Capabilities'' aus. Setzen Sie dort im Abschnitt ''Signing'' die Option ''Automatically manage signing'' und wählen Sie dann ein Team aus. Wechseln Sie nun zu ''WebDriverAgentRunner'' und tun Sie dort dasselbe.<br />
<!--(Das Folgende scheint nicht mehr aktuell zu sein.) Es sollten an dieser Stelle Fehler angezeigt werden, dass kein Provisioning Profile angelegt oder gefunden wurde. Wechseln Sie deshalb zur Seite ''Build Settings'' und suchen Sie hier im Abschnitt ''Packaging'' den Eintrag ''Product Bundle Identifier''. Ändern Sie diesen von com.facebook.WebDriverAgentRunner zu etwas, das von Xcode akzeptiert wird, indem Sie den Präfix ändern. Xcode kann nun ein passendes Provisioning Profile generieren und die Fehler auf der General-Seite sollten verschwinden. Danach können Sie Xcode beenden. --><br />
Durch das Setzen des Teams sollten die Fehler für den WebDriverAgentRunner verschwinden. Danach können Sie Xcode beenden.<br />
<br />
Wenn Sie sich nun von expecco eine Verbindung zu Ihrem Gerät aufbauen, wird der WebDriverAgent darauf installiert und gestartet, um anschließend zur zu testenden App zu wechseln. Auf dem Gerät muss jedoch noch der Ausführung des WebDriverAgents vertraut werden. Öffnen Sie dazu während des Verbindungsaufbaus auf dem Gerät in die Einstellungen und dort unter ''Allgemein'' den Eintrag ''Geräteverwaltung''. Dieser Eintrag ist nur sichtbar, wenn eine Entwickler-App auf dem Gerät installiert ist. Sie müssen daher möglicherweise warten, bis der WebDriverAgent installiert ist, bevor der Eintrag erscheint. Wählen Sie dort den Eintrag Ihres Apple-Accounts und vertrauen Sie ihm. Da der WebDriverAgent wieder deinstalliert wird, wenn der Start nicht funktioniert hat, müssen Sie dies während des Verbindungsaufbaus tun. Falls Ihnen das zu hektisch ist, können Sie auch folgenden Code ausführen:<br />
<br />
''<nowiki>xcodebuild -project Mobile_Testing_Supplement/lib/node_modules/appium-1.16.0-rc.1/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=<udid>' test</nowiki>''<br />
<br />
Damit wird der WebDriverAgent auf dem Gerät installiert ohne dass er wieder gelöscht wird. In der [https://support.apple.com/en-us/HT204460 Dokumentation von Apple] finden Sie nähere Informationen zum Installieren und Vertrauen solcher Apps.<br />
<br />
== Konfiguration des Plugins ==<br />
Bevor Sie loslegen, sollten Sie die Einstellungen des Mobile Testing Plugins überprüfen und ggf. anpassen.<br />
<br />
Öffnen Sie im Menü den Punkt "''Extras''" &#8594; "''Einstellungen''" und dort unter "''Erweiterungen''" den Eintrag "''Mobile Testing''" (s. Abb.). Standardmäßig werden diese Pfade automatisch gefunden (1). Um einen Pfad manuell anzupassen, deaktivieren Sie den entsprechenden Haken rechts davon. Sie erhalten in einer Drop-down-Liste einige Pfade zur Auswahl. Ist ein eingetragener Pfad falsch oder kann er nicht gefunden werden, wird das Feld rot markiert und es erscheint ein diesbezüglicher Hinweis. Stellen Sie sicher, dass alle Pfade richtig angegeben sind.<br />
<br />
[[Datei:MobileTestingEinstellungen.png | thumb | 400px | Konfiguration des Plugins]]<br />
<br />
*'''appium''': Geben Sie hier den Pfad zur ausführbaren Datei an mit der Appium in der Kommandozeile gestartet werden kann. Unter Windows wird diese Datei in der Regel "<code>appium.cmd</code>" heißen. Dieser Pfad wird benutzt, wenn expecco einen Appium-Server startet.<br />
*'''node''': Geben Sie hier den Pfad zur ausführbaren Datei an, die Node (auch "Node.js") startet. Dieser Pfad wird beim Starten eines Servers an Appium weitergegeben, damit Appium ihn unabhängig von der PATH-Variablen findet. Unter Windows heißt diese Datei in der Regel "<code>node.exe</code>".<br />
*'''JAVA_HOME''': Geben Sie hier den Pfad zu einem JDK an. Dieser Pfad wird an jeden Appium-Server weitergegeben. Lassen Sie das Feld frei, um den Wert aus der Umgebungsvariablen zu verwenden. Um einzustellen, welches Java von expecco verwendet werden soll, setzen Sie diesen Pfad in den Einstellungen für die Java Bridge.<br />
*'''ANDROID_HOME''': Geben Sie hier den Pfad zu einem SDK von Android an. Dieser Pfad wird an jeden Appium-Server weitergegeben. Lassen Sie das Feld frei, um den Wert aus der Umgebungsvariablen zu verwenden.<br />
*'''adb''': Hier steht der Pfad zum adb-Befehl. Unter Windows heißt die Datei adb.exe. Diese wird von expecco beispielsweise verwendet, um die Liste der angeschlossenen Geräte zu erhalten. Diesen Pfad sollten Sie automatisch wählen lassen, da dann der Befehl im ANDROID_HOME-Verzeichnis verwendet wird. Dieser wird auch von Appium verwendet. Falls expecco und Appium jedoch verschiedene Versionen von adb verwenden kann es zu Konflikten kommen.<br />
*'''android.bat''': Diese Datei wird nur benötigt, um damit den AVD und den SDK Manager zu starten. Automatisch wird hier die Datei im ANDROID_HOME-Verzeichnis gesucht.<br />
*'''aapt''': Geben Sie hier den Pfad zum aapt-Befehl an. Unter Windows heißt diese Datei ''aapt.exe''. expecco verwendet aapt nur im Verbindungseditor, um das Paket und die Activities einer apk-Datei zu lesen. Automatisch wird hier die Datei im ANDROID_HOME-Verzeichnis gesucht.<br />
<br />
[[Datei:MobileTestingJavaBridgeEinstellungen.png | thumb | 400px | Konfiguration des JDKs]]<br />
<br />
Ab expecco 2.11 gibt es das Feld ''Team-ID''. Wenn Sie iOS-Tests ausführen, tragen Sie hier die Team-ID Ihres Zertifikats ein. Diese wird für jede iOS-Verbindung verwendet, außer Sie setzen den Wert im Einzelfall in den Verbindungseinstellungen um. Wie Sie die Team-ID erhalten, lesen Sie im Abschnitt zur [[#Signierung|Signierung]] ber der Installation auf Mac OS. Mit expecco 2.10 können Sie die Team-ID nur für jede Verbindungseinstellung extra als Capability eintragen. Dazu müssen Sie jedoch die [[#Erweiterte_Ansicht|erweiterte Ansicht]] verwenden. Geben Sie hier die Capability ''xcodeOrgId'' an und setzen Sie als Wert die Team-ID des Zertifikats.<br />
<br />
Die Einstellung zur Serveradresse unten auf der Seite bezieht sich auf das Verhalten des Verbindungseditors. Dieser prüft am Ende, ob die Serveradresse auf ''/wd/hub'' endet, da dies die übliche Form ist. Falls nicht, wird in einem Dialog gefragt, wie darauf reagiert werden soll. Das festgelegte Verhalten kann hier eingesehen und verändert werden.<br />
<br />
Wechseln Sie ebenfalls zum Eintrag ''Java Bridge'' (s. Abb.). Hier muss der Pfad zu Ihrer Java-Installation angegeben werden, die von expecco benutzt wird. Tragen Sie hier ein JDK ein. Falls Sie unter Windows das aus dem Mobile Testing Supplement verwenden möchten, lautet der Pfad<br />
<nowiki>C:\Program Files (x86)\exept\Mobile Testing Supplement\jdk</nowiki><br />
Sie können auch die Systemeinstellungen verwenden.<br />
<br />
== Android-Gerät vorbereiten ==<br />
Wenn Sie ein Android-Gerät unter Windows anschließen benötigen Sie möglicherweise noch einen adb-Treiber für das Gerät. Einen passenden Treiber finden Sie üblicherweise auf der jeweiligen Webseite des Herstellers. Haben Sie den Universal-Treiber aus dem Mobile Testing Supplement installiert, sollte für die meisten Geräte bereits alles funktionieren. In einigen Fällen versucht auch Windows automatisch einen Treiber zu installieren, wenn Sie das Gerät zum ersten mal anschließen.<br />
<br><br />
===USB-Debugging Einschalten===<br />
'''Achtung:'''<br />
Bevor Sie ein Mobilgerät mit dem Appium-Plugin ansteuern können, müssen Sie für dieses Debugging erlauben!<br />
<br />
Für Android-Geräte finden Sie diese Option in den Einstellungen unter ''[https://www.droidwiki.org/wiki/Entwickleroptionen Entwickleroptionen]'' mit dem Namen ''[https://www.droidwiki.org/USB-Debugging USB-Debugging]''. Falls die Entwickleroptionen nicht angezeigt werden, können Sie diese freischalten, indem Sie unter "''Über das Telefon''" siebenmal auf "''Build-Nummer''" tippen.<br />
<br />
===Wach bleiben Aktivieren===<br />
Aktivieren Sie auch die Funktion ''Wach bleiben'', damit das Gerät nicht während der Testerstellung oder -ausführung den Bildschirm abschaltet.<br />
<br />
Aus Sicherheitsgründen muss USB-Debugging für jeden Computer einzeln zugelassen werden. Beim Verbinden des Geräts mit dem PC über USB müssen Sie dabei am Gerät der Verbindung zustimmen. Falls Sie dies für Ihren Computer noch nicht getan haben, aber auf dem Gerät kein entsprechender Dialog erscheint, kann es helfen, das Gerät aus- und wieder einzustecken. Das kann insbesondere dann passieren, wenn Sie den ADB-Treiber installiert haben während das Gerät bereits über USB angeschlossen war. Falls auch das nicht hilft, öffnen Sie die Benachrichtigungen, indem Sie sie vom oberen Bildschirmrand herunter ziehen. Dort finden Sie die USB-Verbindung und Sie können die Optionen dazu öffnen. Wählen Sie einen anderen Verbindungstypen aus; in der Regel sollten MTP oder PTP funktionieren.<br />
<br />
Sie können auch auf einem Emulator testen. Dieser muss nicht gesondert vorbereitet werden, da er bereits für USB-Debugging ausgelegt ist. Es ist sogar möglich, einen Emulator bei Testbeginn zu starten.<br />
<br />
Um zu überprüfen, ob ein Gerät, das Sie an Ihren Rechner angeschlossen haben, verwendet werden kann, öffnen Sie den [[#Verbindungseditor|Verbindungseditor]]. Das Gerät sollte dort angezeigt werden.<br />
<br />
=== Verbindung über WLAN ===<br />
Es ist auch möglich, Android-Geräte über WLAN zu verbinden. Dazu müssen Sie zunächst das Gerät über USB mit dem Rechner verbinden. Öffnen Sie dann die Eingabeaufforderung und geben Sie dir eint:<br />
<nowiki>adb tcpip 5555</nowiki><br />
Damit lauscht das Gerät auf eine TCP/IP-Verbindung an Port 5555. Sollten Sie mehrere Geräte angeschlossen oder Emulatoren laufen haben, müssen Sie genauer angeben, welches Gerät Sie meinen. Geben Sie in diesem Fall ein:<br />
<nowiki>adb devices -l</nowiki><br />
Sie erhalten eine Liste aller Geräte, wobei die erste Spalte deren Kennung ist. Schreiben Sie dann stattdessen<br />
<nowiki>adb -s <Gerätekennung> tcpip 5555</nowiki><br />
mit der Gerätekennung des gewünschten Geräts. Sie können die USB-Verbindung nun trennen. Jetzt müssen Sie die IP-Adresse Ihres Gerätes in Erfahrung bringen. Sie finden diese üblicherweise irgendwo in den Einstellungen des Geräts, beispielsweise beim Status oder in den WLAN-Einstellungen. Geben Sie dann ein:<br />
<nowiki>adb connect <IP-Adresse des Geräts></nowiki><br />
Damit sollte das Gerät nun über WLAN verbunden sein und kann genauso verwendet werden, wie mit USB-Verbindung. Sie können dies überprüfen, indem Sie wieder <tt>adb devices -l</tt> eingeben oder in expecco den Verbindungsdialog öffnen. In der Liste taucht das Gerät mit seiner IP-Adresse und dem Port auf. Bedenken Sie, dass die WLAN-Verbindung nicht mehr besteht, wenn der ADB-Server oder das Gerät neu gestartet werden.<br />
<br />
=== Verbindung zu einem Emulator ===<br />
Sie benötigen dazu den Emulator selbst, sowie mindestens ein AVD (Android Virtual Device). Hinweise zu Installation finden Sie in der [https://developer.android.com/studio/run/emulator Android Studio Dokumentation].<br />
<br />
Wenn Sie Android Studio bereits mit den Defaulteinstellungen installiert haben <sup>1)</sup>, sollte der Emulator bereits mitinstalliert sein. Falls nicht, wählen Sie in Android Studio "''Configure''" - "''SDK Manager''" - "''Android SDK''" - "''SDK Tools''" - ''Android Emulator''", sowie dort die "''Platform Tools''".<br />
Alternativ geht das auch über die Kommandzeile mit dem "sdkmanager" Kommando.<br />
<br />
Als nächstes benötigen Sie mindestens ein AVD; auch dies geht am einfachsten über den Dialog in Android Studio:<br />
wählen sie "''Configure''" - "''AVD Manager''" und folgen den Anweisungen (Deviceauswahl, Platform und Android Version). <br />
<br />
Auch wenn Sie den Emulator automatisieren benötigen sie Appium; installieren Sie dieses entweder mit dem Mobile Testing Supplement, oder direkt von der Appium homepage (https://github.com/appium/appium-desktop/releases).<br />
<br />
<sup>1)</sup>Android Studio selbst wird nicht von expecco benötigt; es bietet aber kompfortable Dialoge zum Installieren von Paketen und AVDs.<br />
<br />
== iOS-Gerät und App vorbereiten ==<br />
Das Ansteuern von iOS-Geräten ist nur über einen Mac möglich. Lesen Sie daher auch den Abschnitt zur [[#Mac_OS|Installation unter Mac OS]].<br />
<br />
Bevor Sie ein Mobilgerät mit dem Mobile Testing Plugin ansteuern können, müssen Sie für iOS-Geräte ab iOS 8 Debugging erlauben. Aktivieren Sie dazu die Option ''Enable UI Automation'' unter dem Menüpunkt ''Entwickler'' in den Einstellungen des Geräts. Falls Sie den Eintrag ''Entwickler'' in den Einstellungen nicht finden, gehen Sie wie folgt vor: Schließen Sie das Gerät über USB an den Mac an. Dabei müssen Sie ggf. am Gerät noch der Verbindung zustimmen. Starten Sie Xcode und wählen Sie dann in der Menüleiste am oberen Bildschirmrand im Menü ''Window'' den Eintrag ''Devices''. Es öffnet sich ein Fenster, in dem eine Liste der angeschlossenen Geräte angezeigt wird. Wählen Sie dort Ihr Gerät aus. Danach sollte der Eintrag ''Entwickler'' in den Einstellungen auf dem Gerät auftauchen. Dazu müssen Sie möglicherweise die Einstellungen beenden und neu starten.<br />
<br />
[[Datei:Alert.png | thumb | 270px | Beispiel für einen Alert unter iOS]]<br />
Ein Verbindungsaufbau zu dem Gerät ist nicht möglich solange es bestimmte Alerts zeigt. Ein solcher Alert kann z.&#x202f;B. erscheinen wenn FaceTime aktiviert ist, indem ein Hinweis auf anfallende SMS-Gebühren angezeigt wird (siehe Screenshot). Achten Sie darauf, das Gerät so zu konfigurieren, dass es im Leerlauf keine solchen Alerts zeigt.<br />
<br />
=== expecco 2.11 und später ===<br />
Sie können beliebige Apps testen, die auf dem verwendeten Gerät lauffähig oder bereits installiert sind. Wenn die App als Development-Build vorliegt, muss die UDID des Geräts in der App hinterlegt sein. In jedem Fall muss der WebDriverAgent für das Gerät signiert werden. Lesen Sie dazu den Abschnitt zur [[#Signierung|Signierung]] unter Mac OS.<br />
<br />
Falls Sie in einem Test den Home-Button verwenden wollen, müssen Sie auf dem Gerät AssistiveTouch aktivieren. Sie finden diese Option in den Einstellungen unter ''Allgemein'' > ''Bedienungshilfen'' > ''AssistiveTouch''. Platzieren Sie dann das Menü in der Mitte des oberen Bildschirmrands. Sie können das Drücken des Home-Buttons dann mit dem entsprechenden Menüeintrag im Recorder aufzeichnen oder direkt den Baustein ''Press Home Button'' benutzen.<br />
<br />
=== expecco 2.10 ===<br />
Die App, die Sie verwenden wollen, muss als Development-Build vorliegen. Außerdem muss die UDID des Geräts in der App hinterlegt sein.<br />
<br />
=== Development-Build signieren ===<br />
Ein Development-Build einer App ist nur für eine begrenzte Zahl von Geräten zugelassen und kann auf anderen Geräten nicht gestartet werden. Es ist aber möglich, das Zertifikat und die verwendbaren Geräte in einem Development-Build auszutauschen.<br />
<br />
* Evaluierung mit Demo-App von eXept:<br />
:Gerne stellen wir Ihnen eine Demo-App zur Verfügung, die als Development-Build vorliegt und die wir für Ihr Gerät signieren können. Senden Sie dazu bitte Ihrem eXept-Ansprechpartner die UDID Ihres Gerätes zu. Wie Sie die UDID Ihres Gerätes ermitteln können, ist im folgenden Abschnitt beschrieben.<br />
<br />
* Eigene App für Ihr Testgerät verwenden:<br />
:Wenn Sie von den App-Entwicklern einen Development-Build (IPA-Datei) erhalten, der für Ihr Testgerät zugelassen ist, können Sie diesen direkt verwenden. Dazu müssen Sie den Entwicklern die UDID Ihres Geräts mitteilen, damit sie diese eintragen können. '''Sie können die UDID eines Gerätes mithilfe von Xcode auslesen'''. Starten Sie dazu Xcode und wählen Sie in der Menüleiste am oberen Bildschirmrand im Menü ''Window'' den Eintrag ''Devices''. Es öffnet sich ein Fenster, in dem eine Liste der angeschlossenen Geräte angezeigt wird. Wählen Sie Ihr Gerät aus und suchen Sie in Eigenschaften den Eintrag ''Identifier''. Die UDID ist eine 40-stellige Hexadezimalzahl.<br />
<br />
* Extern entwickelte App für Ihr Testgerät umsignieren:<br />
:Es können auch Apps umsigniert werden, damit Sie auf anderen Geräten lauffähig sind. Dieser Vorgang ist jedoch kompliziert und setzt insbesondere einen Zugang zu einem Apple-Developer-Account voraus. Eine Dokumentation zur Vorgehensweise ist derzeit in Vorbereitung.<br />
<br />
:Für die Evaluierung unterstützen wir Sie gerne beim Umsignieren Ihrer App.<br />
<!--<br />
Melden Sie sich beim [https://developer.apple.com/ Apple-Webinterface] an. Navigieren Sie zu ''Certificates, IDs & Profiles''. Erzeugen Sie hier ggf. ein Developer-Zertifikat und ein Provisioning Profile für Ihr Gerät und laden Sie beide herunter. Sollten Sie noch keinen Developer Account haben, erstellen Sie hier einen: https://developer.apple.com/enroll/. Hierzu müssen Sie sich mit einer Apple-ID anmelden.<br />
<br />
# Team-ID herausfinden (''Membership'' -> ''Team ID'')<br />
# Unter ''Certificates, IDs & Profiles'' Development-Zertifikat auswählen (unter ''+'' anlegen, falls nicht vorhanden) und herunterladen.<br />
# Unter ''App ID'' Wildcard-App-ID erzeugen, falls nicht vorhanden. App-ID notieren (AppID = Prefix.ID)<br />
# Gerät hinzufügen, dazu UDID (bzw. ''Identifier'') des Geräts herausfinden (''Xcode'' -> ''Window'' (oben in Menüleiste) -> ''Devices'')<br />
# Provisionen Profile erstellen: ''iOS App Development'' -> ''AppID'' auswählen -> Zertifikat wählen -> Gerät auswählen -> Profilname anlegen -> Provisioning Profile herunterladen.<br />
# Das heruntergeladene Zertifikat importieren (''Downloads'' -> Zertifikat (.cer)<br />
# SHA1-Fingerabdruck kopieren. Dazu Rechtsklick auf Zertifikat -> ''Information'', anschließend bis zum Ende der Seite scrollen).<br />
# Entitlements.plist erstellen (''Terminal' öffnen -> Downloads/Mobile_Testing_Supplement/bin/gen-entitlements_plist 'Team-ID' 'App ID' Downloads/Mobile_Testing_Supplement/bin/re-sign-ipa <Pfad zum ipa (z.B. Downloads/expeccoMobileDemo.ipa)> \<br />
"<Zertifikat (SHA1-Fingerabdruck, z.B. 76 E8 4B E8 78 D5 D7 F9 2E 09 8B D7 E8 FB CE 30 0C F5 D0 EF)>" \<br />
<Pfad zum Provisionen Profile (z.B. /Users/exept_test/Downloads/dut.mobileprovision)> \<br />
<Pfad für das Ergebnis-ipa (z.B. Downloads/expeccoMobileDemo_re-signed.ipa)> \<br />
[Pfad zur entitlements.plist] (z.B. /Users/exept_test/entitlements.plist)<br />
<br />
Zum Umsignieren können Sie das entsprechende Skript aus dem Mobile Testing Supplement für Mac OS oder jedes beliebige andere Tool (z.B. isign) verwenden.<br />
--><br />
<br />
Weitere Informationen zur Verwendung von iOS-Geräten finden Sie auch in der [http://appium.io/slate/en/master/?java#appium-on-real-ios-devices Dokumentation von Appium].<br />
<br />
=== Native iOS-Apps ===<br />
Sie können auch Apps verwenden, die bereits nativ auf dem Gerät vorhanden sind. Dazu müssen Sie deren Bundle-ID kennen und diese dann in die Verbindungseinstellungen eintragen. Hier eine kleine Auswahl gängiger Apps:<br />
{| style="text-align:left"<br />
! App<br />
!<br />
! Bundle-ID<br />
|-<br />
| App Store<br />
| <br />
| com.apple.AppStore<br />
|-<br />
| Calculator<br />
| <br />
| com.apple.calculator<br />
|-<br />
| Calendar<br />
| <br />
| com.apple.mobilecal<br />
|-<br />
| Camera<br />
| <br />
| com.apple.camera<br />
|-<br />
| Contacts<br />
| <br />
| com.apple.MobileAddressBook<br />
|-<br />
| iTunes Store<br />
| <br />
| com.apple.MobileStore<br />
|-<br />
| Mail<br />
| <br />
| com.apple.mobilemail<br />
|-<br />
| Maps<br />
| <br />
| com.apple.Maps<br />
|-<br />
| Messages<br />
| <br />
| com.apple.MobileSMS<br />
|-<br />
| Phone<br />
| <br />
| com.apple.mobilephone<br />
|-<br />
| Photos<br />
| <br />
| com.apple.mobileslideshow<br />
|-<br />
| Settings<br />
| <br />
| com.apple.Preferences<br />
|}<br />
<br />
Weitere Bundle-IDs finden Sie [https://github.com/joeblau/apple-bundle-identifiers hier].<br />
<br />
= Beispiele =<br />
Bei den Demo-Testsuiten für expecco finden Sie auch Beispiele für Tests mit dem Mobile Testing Plugin. Wählen Sie dazu auf dem Startbildschirm die Option "''Beispiel aus Datei''" und öffnen Sie den Ordner "''mobile''".<br />
<br />
==<span id="TestsuiteMobileTestingDemo"><!-- Referenced by m01_MobileTestingDemo.ets --></span> ''m01_MobileTestingDemo.ets'' ==<br />
Die Testsuite enthält zwei einfache Testpläne: "''Simple CalculatorTest''" und "''Complex Calculator and Messaging Test''". Beide Tests verwenden einen Android-Emulator, den Sie vor Beginn starten müssen. Die Apps, die im Test verwendet werden, gehören zur Grundausstattung des Emulators und müssen daher nicht mehr installiert werden. Da sich die Apps unter jeder Android-Version unterscheiden können, ist es wichtig, dass Ihr Emulator unter Android 6.0 läuft. Außerdem muss die Sprache auf Englisch gestellt sein.<br />
<br />
; Simple CalculatorTest<br />
: Dieser Test verbindet sich mit dem Taschenrechner und gibt die Formel ''2+3'' ein. Das Ergebnis des Rechners wird mit dem erwarteten Wert ''5'' verglichen.<br />
<br />
; Complex Calculator and Messaging Test<br />
: Dieser Test verbindet sich mit dem Taschenrechner und öffnet anschließend den Nachrichtendienst. Dort wartet er auf eine einkommende Nachricht von der Nummer ''15555215556'', in der eine zu berechnende Formel gesendet wird. Die Nachricht wird zuvor über einen Socket beim Emulator erzeugt. Nach dem Eintreffen der Nachricht wird diese vom Test geöffnet und deren Inhalt gelesen. Danach wird wieder der Taschenrechner geöffnet, die erhaltene Formel eingegeben und das Ergebnis gelesen. Anschließend wechselt der Test wieder zum Nachrichtendienst und sendet das Ergebnis als Antwort.<br />
<br />
== ''m02_expeccoMobileDemo.ets'' und ''m03_expeccoMobileDemoIOS.ets'' ==<br />
Diese sind Bestandteil des Tutorials zum Mobile Testing Plugin. Der jeweils enthaltene Testfall ist unvollständig und wird im Zuge des Tutorials ergänzt. Lesen Sie dazu den Abschnitt [[#Tutorial|Tutorial]].<br />
<br />
= Tutorial =<br />
Dieses Tutorial beschreibt das grundsätzliche Vorgehen zur Erstellung von Tests mit dem Mobile Testing Plugin. Grundlage dafür ist ein mitgeliefertes Beispiel, bestehend aus einer einfachen App und einer expecco-Testsuite.<br />
<br />
Die App ''expecco Mobile Demo'' berechnet und überprüft verschiedene alltägliche Codes: die IBAN aus dem europäischen Zahlungsverkehr, die internationalen GTIN-13-Produktcodes, wie man sie bei Strichcodes im Einzelhandel findet, und die Seriennummern auf Euro-Banknoten.<br />
<br />
Die Testsuite enthält Testfälle für einzelne Funktionen der App. Dabei sind noch nicht alle Funktionen abgedeckt, sondern werden im Laufe des Tutorials ergänzt.<br />
<br />
Es gibt zwei Versionen dieses Tutorials:<br />
*'''[[#Erste_Schritte_mit_Android|Erste Schritte mit Android]]'''<br />
*'''[[#Erste_Schritte_mit_iOS|Erste Schritte mit iOS]]'''<br />
<br />
Das Vorgehen ist in beiden Versionen nahezu identisch, lediglich die Verbindungskonfigurationen werden unterschiedlich erzeugt. Die fertigen Tests unterscheiden sich dann im Wesentlichen in den Pfaden zur Adressierung der benutzten Elemente, da diese technologieabhängig sind.<br />
<br />
==<span id="FirstStepsAndroid"><!-- Referenced by m02_expeccoMobileDemo.ets --></span> Erste Schritte mit Android ==<br />
Es wird vorausgesetzt, dass Sie das Kapitel [[#Installation_und_Aufbau|Installation und Aufbau]] bereits gelesen und die nötigen Vorbereitungen für die Verwendung von Android-Geräten unter Windows abgeschlossen haben.<br />
<br />
=== Schritt 1: Demo ausführen ===<br />
Starten Sie expecco und öffnen Sie die Testsuite "''m02_expeccoMobileDemo.ets''" über die Schaltfläche "''Beispiel aus Datei''" (Abb. 1). Ab expecco 2.11 befindet sich diese im Unterordner "''mobile''". In dieser Testsuite befindet sich bereits ein vorgefertigter Testplan mit einigen Testfällen für diese App.<br />
<br />
[[Datei:MobileTestingBeispielÖffnen.png | frame | left | Abb. 1: Beispiel-Testsuite öffnen]]<br />
<br clear="all"><br />
In der Testsuite ist das Paket der Demo-App als Anhang enthalten ("''expeccoMobileDemo-debug.apk''"). Mithilfe des bereitgestellten Bausteins "''Export Demo App''" können Sie die Datei an einen beliebigen Ort auf Ihrem Rechner exportieren. Wählen Sie dazu den Baustein aus (1) und klicken Sie auf den grünen Play-Knopf (2) um den Baustein auszuführen (Abb. 2). Der Baustein öffnet einen Dateidialog, in dem Sie angeben, wo das Paket gespeichert werden soll.<br />
<br />
[[Datei:MobileTestingExportApp.png | frame | left | Abb. 2: App exportieren]]<br />
<br clear="all"><br />
Bevor wir uns mit dem weiteren Inhalt der Testsuite beschäftigen, konfigurieren Sie zuerst die Verbindung und welches Gerät Sie benutzen wollen. Schließen Sie dazu ein Gerät über USB an Ihren Rechner an oder starten Sie einen Emulator.<br />
<br />
[[Datei:MobileTestingVerbinden.png | frame | left | Abb. 3: Verbindungseditor öffnen]]<br />
<br clear="all"><br />
Öffnen Sie nun den GUI-Browser (1) und wählen Sie unter "''Verbinden''" (2) den Eintrag "''Mobile Testing''" (3) (Abb. 3), um den Verbindungsdialog zu öffnen.<br />
<br />
Sie sehen eine Liste aller angeschlossenen Android-Geräte (1) (Abb. 3). Sollte Ihr Gerät nicht in der Liste auftauchen, stellen Sie sicher, dass es eingeschaltet und über USB verbunden ist. Lesen Sie ansonsten den Abschnitt [[#Android-Ger.C3.A4t_vorbereiten|Android-Gerät vorbereiten]]<br />
<br />
[[Datei:MobileTestingGerätAuswählen.png | frame | left | Abb. 4: Gerät im Verbindungsdialog auswählen]]<br />
<br clear="all"><br />
Haben Sie Ihr Gerät in der Liste gefunden, wählen Sie es aus und klicken Sie auf "''Weiter''" (2).<br />
<br />
Als nächstes geben Sie an, welche App Sie verwenden wollen (Abb. 5). Dabei können Sie wählen, ob Sie eine App starten möchten, die bereits auf dem Gerät installiert ist ("''App auf dem Gerät''") oder ob eine App installiert und gestartet werden soll ("''App installieren''"). Für den Fall, dass Sie eine bereits installierte App benutzen wollen, erhalten Sie eine Liste aller auf dem Gerät installierten Pakete (1), die in Systempakete und Fremdpakete (2) unterteilt sind, sowie deren Activities (3). Diese können Sie dann einfach in den jeweiligen Feldern auswählen.<br />
<br />
[[Datei:MobileTestingAppAuswählen.png | frame | left | Abb. 5: Auf dem Gerät installierte App angeben]]<br />
<br clear="all"><br />
Für dieses Tutorial soll die App installiert werden, die Sie eben aus der Testsuite exportiert haben. Wählen Sie also "''App installieren''" aus und tragen Sie bei App (1) den entsprechenden Pfad ein (Abb. 6). Sie können den Knopf links benutzen (2), um einen Dateidialog zu öffnen, mit dem Sie zu der Datei navigieren können, um sie einzugeben. Das Paket (3) und die Activity (4) der App werden automatisch eingetragen. Sollte die App mehrere Activities besitzen, können Sie die gewünschte auswählen. Klicken Sie nun auf "''Weiter''" (5).<br />
<br />
[[Datei:MobileTestingAppInstallieren.png | frame | left | Abb. 6: App angeben, die auf dem Gerät installiert werden soll]]<br />
<br clear="all"><br />
Auf der letzten Seite sehen Sie eine Übersicht aller bisherigen Angaben (1) (Abb. 7). Darunter können Sie einen Namen für die Verbindung angeben, unter dem sie im GUI-Browser angezeigt wird (2). Außerdem lässt sich eine Verbindung über diesen Namen identifizieren und in Bausteinen verwenden; der Name muss daher eindeutig sein. Falls Sie keinen Namen angeben, wird generisch einer erzeugt. Geben Sie als Namen "''expeccoMobileDemo''" ein. Im Feld darunter ist die Adresse zum Appium-Server einzutragen (3). Appium ist die Schnittstelle, über die die angeschlossenen Geräte gesteuert werden. Für dieses Tutorial wird die Verwaltung der Instanzen des Appium-Servers von expecco übernommen. Tragen Sie dafür ist die lokale Standard-Adresse "''<nowiki>http://localhost:4723/wd/hub</nowiki>''" ein. Diese ist immer der unterste Eintrag der Vorschlagsliste. Außerdem ist die Option "''Bei Bedarf starten''" aktiviert (4). expecco überprüft dann, ob an der Adresse bereits ein Appium-Server läuft und startet und beendet ihn bei Bedarf automatisch. Wenn der Port ''4723'' bereits belegt ist oder wenn Sie einmal mehrere Verbindungen parallel betreiben wollen, verwenden Sie an dieser Stelle entsprechend einen anderen Port. Es ist dabei üblich die ungeraden Portnummern oberhalb von ''4723'' zu verwenden, also ''4725'', ''4727'' usw. Natürlich können Sie auch entfernte Server verwenden, das automatische Starten und Beenden eines Servers kann expecco aber nur lokal für Sie übernehmen.<br />
<br />
[[Datei:MobileTestingServerkonfiguration.png | frame | left | Abb. 7: Verbindungsnamen und Appium-Server konfigurieren]]<br />
<br clear="all"><br />
Klicken Sie nun auf "''Speichern''" (5) um die Einstellungen für die Testausführung zu speichern. Einstellungen können als Anhang einer Testsuite oder in eine externe Datei gespeichert werden (Abb. 8). Falls Sie mehrere Projekte gleichzeitig offen haben, können Sie in der Liste das Projekt auswählen, in dem der Anhang angelegt werden soll. Klicken Sie auf "''Speichern''" im Bereich "''Einstellungen im Anhang speichern''" und geben Sie als Name "''expeccoMobileDemo''" an. Klicken Sie nun auf ''Server starten und verbinden'' (6) um mit der angegebenen Konfiguration eine Verbindung herzustellen.<br />
<br />
[[Datei:MobileTestingEinstellungenSpeichern.png | frame | left | Abb. 8: Einstellungen speichern]]<br />
<br clear="all"><br />
Der Verbindungsaufbau kann eine Weile dauern. Warten Sie bis die Verbindung aufgebaut ist und im GUI-Browser angezeigt wird. Sie sehen, dass die App auf dem Gerät gestartet wird. Nun wissen Sie, dass die Konfiguration funktioniert. Die gespeicherten Einstellungen sollen nun für den Test verwendet werden, der dann die gleiche Verbindung aufbaut. Wählen Sie die Verbindung im GUI-Browser aus, machen Sie einen Rechtsklick und wählen Sie im Kontextmenü "''Verbindung abbauen''", damit es zu keinem Konflikt kommt. Wechseln Sie dann zurück zum Reiter der Testsuite.<br />
<br />
In der Testsuite wurden die Einstellungen als Anhang "''expeccoMobileDemo''" angelegt (Abb 9). Wählen Sie den Baustein ''Connect'' (1) aus und wechseln Sie rechts zur Ansicht "''Netzwerk''" (2). Ziehen Sie per Drag-and-drop die Einstellungen in das Netzwerk des Bausteins (3). Verbinden Sie den Ausgangspin ''pathName'' mit dem Eingangspin ''stringOrFilename[1]'' des Bausteins "''Connect from File''" (4). Mit "''Übernehmen''" (5) bestätigen Sie die Änderungen. Dieser Baustein wird zu Beginn des Tests die Verbindung zur App herstellen.<br />
<br />
[[Datei:MobileTestingConnectblock.png | frame | left | Abb. 9: Verbindungsbaustein editieren]]<br />
<br clear="all"><br />
Wechseln Sie nun zum Testplan "''Demo-Test''" (1) (Abb. 10). Dieser Testplan enthält bereits einige fertige Testfälle. Vor und nach der Ausführung (2) ist außerdem jeweils ein Baustein eingetragen: Der eben bearbeitete Baustein "''Connect''" für den Aufbau und der Baustein "''Disconnect''" für den Verbindungsabbau. Durch das Eintragen der beiden Bausteine an dieser Stelle geschieht der Verbindungsabbau insbesondere auch dann, wenn der Test vorzeitig abgebrochen wird, z. B. weil einer der Testfälle fehlschlägt.<br />
<br />
[[Datei:MobileTestingTestplan.png | frame | left | Abb. 10: Testplanausführung]]<br />
<br clear="all"><br />
Jetzt können Sie den Testplan "''Demo-Test''" starten, indem Sie auf den grünen Play-Knopf (3) klicken. Der Testplan sollte ohne Fehler durchlaufen.<br />
<br />
=== Schritt 2: Einen Baustein mit dem Recorder erstellen ===<br />
Mit Hilfe des integrierten Recorders lassen sich einfach Ausführungssequenzen aufnehmen und in einem AKtionsbaustein speichern. Dafür muss eine Verbindung zu einem Testgerät bestehen, mit dessen Hilfe der Test erstellt wird.<br />
<br />
Um eine Verbindung aufzubauen, wechseln Sie zurück zum GUI-Browser. In diesem ist noch die Verbindung eingetragen, die Sie zuvor angelegt haben. Da für die Verbindung im Testlauf derselbe Name verwendet wurde, wurden die Einstellungen damit überschrieben (In unserem Fall waren die Einstellungen ohnehin identisch). Die Verbindung ist zur Zeit nicht aktiv, da sie am Ende der Ausführung abgebaut wurde. Die Einstellungen sind dort aber noch eingetragen. Um die Verbindung mit dieser Konfiguration wieder aufzubauen, wählen Sie sie aus, gefolgt von einem Rechtsklick und ''Verbinden''.<br />
<br />
Warten Sie, bis die Verbindung aufgebaut ist (1) und drücken Sie dann den Aufnahme-Knopf (2), um eine Aufzeichnung zu starten (Abb. 11).<br />
<br />
[[Datei:MobileTestingRecorderStarten.png | frame | left | Abb. 11: Recorder starten]]<br />
<br clear="all"><br />
Es öffnet sich ein Fenster mit dem Mobile Testing Recorder (Abb. 12). Dieser zeigt einen Screenshot des verbundenen Geräts. Über diese Anzeige können Sie das Gerät fernsteuern. Dabei wird jede Aktion, die Sie ausführen, im Hintergrund aufgezeichnet.<br />
<br />
In der oberen Menüleiste können Sie das Werkzeug auswählen (1), mit dem Sie eine Aktion eingeben möchten. Als Voreinstellung ist das Werkzeug "''Auto''" ausgewählt. Sie können damit bestimmte Aktionen aufzeichnen, indem Sie mit dem Mauszeiger entsprechende Gesten auf der Anzeige ausführen. Wenn Sie zum Beispiel mit der linken Maustaste lange klicken, entspricht das einem langen Antippen des Elements an dieser Stelle. Anstatt die gewünschte Aktion mit der entsprechenden Geste zu bestimmen, können Sie diese alternativ auch manuell auswählen.<br />
<br />
Es soll nun ein neuer Test für das Erkennen korrekter GTIN-13-Codes aufgenommen werden. Klicken Sie zunächst in der Anzeige kurz auf den Button "''GTIN-13 (EAN-13)''" (2) der App um einen entsprechenden Klick auf dem Gerät auszulösen. Während der Ausführung dieser Aktion wird der Rahmen des Recorders kurzzeitig rot. Falls der Recorder danach nicht die aktuelle Ansicht der App darstellen sollte, klicken Sie im Recorder auf das Aktualisierungssymbol (3).<br />
<br />
[[Datei:MobileTestingRecorder1.png | frame | left | Abb. 12: Über Recorder zur GTIN-13-Activity wechseln]]<br />
<br clear="all"><br />
Anschließend soll im Eingabefeld der neuen Seite eine korrekte GTIN-13 eingegeben werden. Führen Sie dazu einen Rechtsklick auf dem Eingabefeld (1) aus und wählen Sie im Kontextmenü die Aktion "''Text setzen''" (2) (Abb. 13). Geben Sie in den sich daraufhin öffnenden Dialog eine beliebige gültige Artikelnummer im GTIN-13-Format ein, bspw. "''4006381333986''" (3). Dieser Text wird nun in der App gesetzt.<br />
<br />
[[Datei:MobileTestingRecorder2.png | frame | left | Abb. 13: GTIN-13-Code über Recorder eingeben]]<br />
<br clear="all"><br />
Klicken Sie nun auf "''Verify''" (1) (Abb. 14). In der App erscheint nun als Ergebnis "''OK''" (2). Der Test soll feststellen, ob tatsächlich dieses Ergebnis angezeigt wird. Nach einem Rechtsklick darauf können Sie im Kontextmenü die Aktion "''Attribut zusichern''" (3) auswählen. Wählen Sie im Dialog, der sich daraufhin öffnet, die Eigenschaft "''text''" (4) aus und bestätigen Sie mit "''OK''" (5). Dieses Mal wird keine Aktion auf dem Gerät ausgelöst, sondern nur ein Baustein aufgezeichnet, der fehlschlägt, sollte das Ergebnis vom erwarteten Wert "''OK''" abweichen.<br />
<br />
[[Datei:MobileTestingRecorder3.png | frame | left | Abb. 14: Antwort der App über Recorder auslesen]]<br />
<br clear="all"><br />
Schließen Sie nun den Recorder. Im ''Arbeitsbereich'' des GUI-Browsers sehen Sie, dass für jede der aufgenommenen Aktionen ein Baustein angelegt wurde (Abb. 15). Sie können nun testen, ob sich das Aufgenommene wieder abspielen lässt. Dazu müssen Sie zunächst die App auf Ihrem Gerät in den Anfangszustand zurückbringen, indem Sie auf dem Gerät die Schaltfläche "''HOME''" oben rechts benutzen. Klicken Sie dann in expecco auf den grünen Play-Knopf (1). Wird alles grün, war die Ausführung erfolgreich. Erstellen Sie nun daraus einen neuen Baustein in der Testsuite, indem Sie auf das Bausteinsymbol (2) in der rechten oberen Ecke klicken. Geben Sie ihm den Namen "''GTIN_Verify_OK''" (3) und bestätigen Sie (4).<br />
<br />
[[Datei:MobileTestingArbeitsbereich.png | frame | left | Abb. 15: Neuen Baustein aus Arbeitsbereich exportieren]]<br />
<br clear="all"><br />
Bauen Sie nun die Verbindung ab, indem Sie die Verbindung auswählen, rechtsklicken und im Kontextmenü "''Verbindung abbauen''" auswählen.<br />
<br />
Wechseln Sie zurück zum Reiter der Testsuite. Dort wurde der neue Baustein angelegt. Wählen Sie wieder den Testplan "''Demo-Test''" aus und fügen Sie den aufgenommenen Testfall "''GTIN_Verify_OK''" per Drag-and-drop am Ende des Testplans hinzu. Übernehmen Sie die Änderung und starten Sie erneut. Der Testplan sollte wieder ohne Fehler durchlaufen.<br />
<br />
=== Schritt 3: XPath anpassen mithilfe des GUI-Browsers ===<br />
Ihr neuer Baustein funktioniert auf anderen Geräten möglicherweise nicht. Die verwendeten Elemente werden über einen XPath adressiert und dieser kann auf anderen Geräten nicht stimmen. Lesen Sie dazu den Abschnitt [[#XPath_anpassen_mithilfe_des_GUI-Browsers|XPath anpassen mithilfe des GUI-Browsers]]. Falls Ihnen ein weiteres Gerät zur Verfügung steht, können Sie nun versuchen, die Pfade in Ihren erstellten Bausteinen zu verallgemeinern. Sie können diesen Schritt aber auch überspringen.<br />
<br />
Wenn es Ihnen schwerfällt, verkürzte Pfade zu finden, orientieren Sie sich dabei an den Pfaden der bereits vorhandenen Bausteine. Starten Sie den Test erneut. Sollte der Test jetzt fehlschlagen, überprüfen Sie die Pfade noch einmal im GUI-Browser.<br />
Um den Test nun auf einem zweiten Gerät auszuführen, öffnen Sie im Menü "''Erweiterungen''" > "''Mobile Testing''" > "''Verbindungseinstellungen erstellen''". Sie erhalten einen Dialog ähnlich zum Verbindungsdialog. Allerdings können Sie hier nur Einstellungen erstellen und speichern aber keine Verbindung herstellen. Sie haben jedoch die Möglichkeit, einzelne Aspekte der Einstellungen zu speichern wie bspw. nur das Gerät. Wählen Sie das neue Gerät aus und klicken Sie länger auf das Symbol zum Speichern im Anhang bis sich das verzögerte Menü öffnet (Abb. 16). Wählen Sie hier "''Geräte-Einstellungen speichern''". Benennen Sie den Anhang am besten nach dem Gerät. Danach können Sie den Dialog wieder schließen.<br />
<br />
[[Datei:MobileTestingGerätSpeichern.png | frame | left | Abb. 16: Einstellungen für ein Gerät speichern]]<br />
<br clear="all"><br />
Wählen Sie den Baustein "''Connect''" aus und ziehen Sie die Einstellungen für das neue Gerät in dessen Netzwerk. Verbinden Sie nun dessen Ausgangspin ''pathName'' mit dem Eingangspin ''stringOrFilename[2]'' des Bausteins "''Connect from File''". Der Baustein Connect from File liest die Angaben an den Eingangspins von oben nach unten ein, mehrfache Eigenschaften werden dabei ersetzt. In diesem Fall werden also die Einstellungen zum verwendeten Gerät ersetzt, während die übrigen Einstellungen gleich bleiben. Wenn Sie die Pfade geschickt gewählt haben, wird der Test nun auch auf dem anderen Gerät erfolgreich ablaufen.<br />
<br />
=== Schritt 4: Noch einen Baustein erstellen ===<br />
Falls sich gleiche Abläufe im Test wiederholen, können Sie dafür bereits erstellte Bausteine wiederverwenden oder abwandeln. Der in Schritt 2 erstellte Baustein prüft die Erkennung korrekter GTIN-13-Codes. Es fehlt noch ein Test, der umgekehrt das Erkennen eines falschen GTIN-13-Codes prüft. Die Struktur der beiden Tests ist identisch, sie unterscheiden sich lediglich in ihren Parametern. Kopieren Sie daher den Baustein "''GTIN_Verify_OK''" und benennen Sie die Kopie in "''GTIN_Verify_NOT_OK''" um. Ändern Sie die Eingabe der GTIN-13 in einen falschen Code zum Beispiel durch Ändern der letzten Ziffer ("''4006381333987''") und setzen Sie den Überprüfungswert der Ausgabe auf "''NOT OK''" (Abb. 17).<br />
<br />
[[Datei:MobileTestingGTIN_Verify_NOT_OK.png | frame | left | Abb. 17: Baustein editieren]]<br />
<br clear="all"><br />
Fügen Sie diesen neuen Test ebenfalls zum Testplan Demo-Test hinzu und setzen Sie ihn ans Ende. Führen Sie den Testplan aus, aber vergessen Sie nicht, vorher die Verbindung im GUI-Browser abzubauen.<br />
<br />
Der neue Test wird fehlschlagen, weil Ihr aufgenommener Baustein nicht wieder zur Startseite der App zurückkehrt, die Tests aber jeweils von dort aus starten. In den anderen Bausteinen ist dies bereits berücksichtigt; sie führen abschließend immer den Baustein "''Back to main menu''" aus. Sie sehen das, indem Sie einen der anderen Bausteine, z. B. "''GTIN_Calculate''", auswählen und auf seine Schema-Ansicht wechseln. Dort steht der Baustein "''Back to main menu''" im Feld "''Nach Ausführung''" (Abb. 18). Wie beim entsprechenden Feld beim Testplan wird auch dieser Baustein immer am Ende ausgeführt, unabhängig davon, ob der Test erfolgreich verläuft oder abbricht. Ergänzen Sie diesen Eintrag nun in Ihren Bausteinen "''GTIN_Verify_OK''" und "''GTIN_Verify_NOT_OK''". Wählen Sie dazu den Baustein aus und ziehen Sie in der Schema-Ansicht den Baustein ''Back to main menu'' einfach auf das Eingabefeld "''Nach Ausführung''". Nun können Sie den Testplan starten und alle Tests sollten wieder problemlos ausgeführt werden.<br />
<br />
[[Datei:AppiumDemo Nach Ausführung.png | frame | left | Abb. 18: Nach-Ausführungs-Baustein setzen]]<br />
<br clear="all"><br />
<br />
=== Schritt 5: Test vervollständigen ===<br />
Für die Activity IBAN sind bereits alle Antwortmöglichkeiten der App mit Testfällen abgedeckt. In der GTIN-13-Activity werden ein korrekter und ein fehlerhafter Code getestet und eine Prüfziffer berechnet, das Verhalten der App bei Eingaben falscher Länge wird aber bisher nicht getestet (Bei Verify "''Input must be exactly 13 digits''" und "''…12 digits''". bei Calculate). Die Activity zum Prüfen der Seriennummern von Eurobanknoten wird noch gar nicht getestet. Wie bei der IBAN können hier drei Fälle auftreten: eine korrekte Seriennummer wurde eingegeben (Antwort: "''OK''"), eine falsche Seriennummer wurde eingegeben (Antwort: "''NOT OK''") oder die Angabe entspricht nicht dem Format (Antwort: "''A serial number consists of 12 characters with the first one or two being capital letters (A-Z).''"). Sie können die Testabdeckung jetzt noch erweitern, indem Sie entsprechende Testfälle erstellen. Die Bausteine dafür können Sie wie in Schritt 2 mit dem Recorder erstellen und die XPaths bei Bedarf verallgemeinern. Wenn Sie mit dem grundsätzlichen Umgang mit expecco vertraut sind, können Sie Bausteine natürlich auch ohne Recorder erstellen, indem Sie sie manuell aus vorhandenen Bausteinen der Bibliothek zusammensetzen. Sie können auch beide Vorgehensweisen nach Belieben kombinieren.<br />
<br />
Beachten Sie, dass die hier vorgestellten Testfälle jeweils nur einzelne Eingaben prüfen. Wenn Sie Testfälle für Ihre eigenen Apps schreiben, wollen Sie vermutlich engmaschiger testen, indem Sie noch weitere unterschiedliche Werte eingeben, die insbesondere auch Randfälle enthalten.<br />
<br />
==<span id="FirstStepsIOS"><!-- Referenced by m03_expeccoMobileDemoIOS.ets --></span> Erste Schritte mit iOS ==<br />
Es wird vorausgesetzt, dass Sie das Kapitel [[#Installation_und_Aufbau|Installation und Aufbau]] bereits gelesen und die nötigen Vorbereitungen für die Verwendung von iOS-Geräten unter Mac OS abgeschlossen haben. Schließen Sie das Gerät, das Sie verwenden wollen, an den Mac an. Laden Sie die iOS-Version der [http://download.exept.de/transfer/h-expecco-2.11.0-pre/expeccoMobileDemo.ipa expeccoMobileDemo-App] auf den Mac herunter. Da es sich bei der App um einen Debug-Build handelt, müssen Sie sie noch für Ihr Gerät signieren (siehe [[#iOS-Ger.C3.A4t_und_App_vorbereiten|iOS-Gerät und App vorbereiten]]). Starten Sie nun einen Appium-Server auf dem Mac.<br />
<br />
=== Schritt 1: Demo ausführen (iOS) ===<br />
Starten Sie expecco und öffnen Sie die Testsuite "''m03_expeccoMobileDemoIOS.ets''" über die Schaltfläche "''Beispiel aus Datei''" (Abb. 1). Ab expecco 2.11 befindet sich diese im Unterordner "''mobile''". Ansonsten laden Sie die Testsuite [http://download.exept.de/transfer/h-expecco-2.10.0/m03_expeccoMobileDemoIOS.ets m03_expeccoMobileDemoIOS.ets] auf den Rechner, auf dem sich Ihre expecco-Installation befindet, und öffnen diese. In dieser Testsuite befindet sich bereits ein vorgefertigter Testplan mit einigen Testfällen für diese App.<br />
<br />
[[Datei:MobileTestingIOSBeispielÖffnen.png | frame | left | Abb. 1: Beispiel-Testsuite öffnen]]<br />
<br clear="all"><br />
Bevor wir uns mit dem weiteren Inhalt der Testsuite beschäftigen, konfigurieren Sie zuerst die Verbindung und welches Gerät Sie benutzen wollen. Öffnen Sie nun den GUI-Browser (1) und wählen Sie unter "''Verbinden''" (2) den Eintrag "''Mobile Testing''" (3) (Abb. 2), um den Verbindungsdialog zu öffnen.<br />
[[Datei:MobileTestingVerbinden.png | frame | left | Abb. 2: Verbindungseditor öffnen]]<br />
<br clear="all"><br />
<br />
Hier können Sie ein iOS-Gerät nur von Hand eintragen. Wählen Sie dazu "''iOS-Gerät eingeben''" (Abb. 3). Den Namen und die iOS-Version des Geräts können Sie dessen Eigenschaften entnehmen. Um die Gerätekennung des Geräts zu erfahren, öffnen Sie auf dem Mac in Xcode das Fenster Devices (Command-Shift-2). Dort werden alle angeschlossenen Geräte sowie die zur Verfügung stehenden Simulatoren angezeigt. Hier sehen Sie auch die Gerätekennung (udid) Ihres Geräts und welche Apps installiert wurden. Nachdem Sie das Gerät im Verbindungseditor eingegeben haben, wählen Sie es in der Liste aus und klicken Sie dann auf Weiter.<br />
<br />
[[Datei:MobileTestingIOSGerät.png | frame | left | Abb. 3: Hinzufügen eines iOS-Geräts]]<br />
<br clear="all"><br />
<br />
Als nächstes geben Sie an, welche App Sie verwenden wollen. Dabei können Sie wählen, ob Sie eine App starten möchten, die bereits auf dem Gerät installiert ist ("''App auf dem Gerät''") oder ob eine App installiert und gestartet werden soll ("''App installieren''"). Für den Fall, dass Sie eine bereits installierte App benutzen wollen, müssen Sie deren Bundle-ID angeben. Diese erfahren Sie ebenfalls im Devices-Fenster von Xcode. Für die Demo-App lautet sie beispielsweise "''de.exept.expeccoMobileDemo''".<br />
<br />
Für dieses Tutorial soll die Demo-App erst installiert werden. Wählen Sie also "''App installieren''" aus und tragen Sie bei App den Pfad zu der Datei auf dem Mac ein (Abb. 4). Wenn Sie expecco 2.11 verwenden, können Sie auf dieser Seite auch die Team-ID angeben, die für iOS-Verbindungen angibt, welches Zertifiat verwendet werden soll. Falls Sie bereits in den [[#Konfiguration_des_Plugins|Plugin-Einstellungen]] eine ID angegeben haben, wird diese verwendet. Sie wird hier grau dargestellt, solange Sie keinen anderen Wert angeben. Klicken Sie nun auf "''Weiter''".<br />
<br />
[[Datei:MobileTestingIOSAppInstallieren.png | frame | left | Abb. 4: App angeben, die auf dem Gerät installiert werden soll]]<br />
<br clear="all"><br />
<br />
Auf der letzten Seite sehen Sie eine Übersicht aller bisherigen Angaben (1) (Abb. 5). Unterhalb der Capabilityliste können Sie einen Namen für die Verbindung angeben, unter dem sie im GUI-Browser angezeigt wird (2). Außerdem lässt sich eine Verbindung über diesen Namen identifizieren und in Bausteinen verwenden; der Name muss daher eindeutig sein. Falls Sie keinen Namen angeben, wird generisch einer erzeugt. Geben Sie als Namen "''expeccoMobileDemo''" ein. Im Feld darunter ist die Adresse zum Appium-Server einzutragen (3). Wenn Sie den Appium-Server mit Standardeinstellungen gestartet haben, müssen Sie dazu nur in der Standardadresse (unterster Eintrag der Vorschlagsliste) "''localhost''" durch die IP-Adresse des Macs ersetzen (im Bild "''172.23.1.49''"). Um sicher zu gehen, auf welchem Port der Appium-Server lauscht, sehen Sie in dessen Ausgabe. Dort finden am Anfang die Zeile<br />
<nowiki>info: Appium REST http interface listener started on 0.0.0.0:4723</nowiki><br />
Steht hier am Ende nicht der Standardport ''4723'' ändern Sie diese Angabe entsprechend ebenfalls in der Konfiguration.<br />
<br />
Wenn die Option "''Bei Bedarf starten''" (4) aktiviert ist, überprüft expecco, ob an der Adresse bereits ein Appium-Server läuft, und startet und beendet ihn bei Bedarf automatisch. Das ist allerdings nur für lokale Serveradressen möglich, schalten Sie diese Option daher ab.<br />
<br />
[[Datei:MobileTestingServerkonfigurationIOS.png | frame | left | Abb. 5: Verbindungsnamen und Appium-Server konfigurieren]]<br />
<br clear="all"><br />
<br />
Klicken Sie nun auf "''Speichern''" (5) um die Einstellungen für die Testausführung zu speichern. Einstellungen können als Anhang einer Testsuite oder in eine externe Datei gespeichert werden (Abb. 6). Falls Sie mehrere Projekte gleichzeitig offen haben, können Sie in der Liste das Projekt auswählen, in dem der Anhang angelegt werden soll. Klicken Sie auf "''Speichern''" im Bereich "''Einstellungen im Anhang speichern''" und geben Sie als Name "''expeccoMobileDemo''" an. Klicken Sie nun auf "''Verbinden''" (6) um mit der angegebenen Konfiguration eine Verbindung herzustellen.<br />
<br />
[[Datei:MobileTestingEinstellungenSpeichern.png | frame | left | Abb. 6: Einstellungen speichern]]<br />
<br clear="all"><br />
<br />
Der Verbindungsaufbau kann eine Weile dauern. Wenn Sie die Server-Adresse korrekt angegeben haben, sollten Sie in der Ausgabe des Appium-Servers den Verbindungsversuch erkennen. Auf Ihrem iOS-Gerät sollte dabei die App gestartet werden. Passiert nichts auf dem Gerät, kann es daran liegen, dass entweder das Gerät oder die App nicht gefunden wird. Versucht Appium hingegen, die App zu starten und dies schlägt fehl, ist wahrscheinlich die App falsch signiert. Deinstallieren Sie in diesem Fall die App, damit sie mit einer neuen Signatur wieder installiert werden kann.<br />
<br />
Warten Sie bis die Verbindung aufgebaut ist und im GUI-Browser angezeigt wird. Nun wissen Sie, dass die Konfiguration funktioniert. Die gespeicherten Einstellungen sollen nun für den Test verwendet werden, der dann die gleiche Verbindung aufbaut. Wählen Sie die Verbindung im GUI-Browser aus, machen Sie einen Rechtsklick und wählen Sie im Kontextmenü "''Verbindung abbauen''", damit es zu keinem Konflikt kommt. Wechseln Sie dann zurück zum Reiter der Testsuite.<br />
<br />
In der Testsuite wurden die Einstellungen als Anhang "''expeccoMobileDemo''" angelegt (Abb 7). Wählen Sie den Baustein ''Connect'' (1) aus und wechseln Sie rechts zur Ansicht "''Netzwerk''" (2). Ziehen Sie per Drag-and-drop die Einstellungen in das Netzwerk des Bausteins (3). Verbinden Sie den Ausgangspin ''pathName'' mit dem Eingangspin ''stringOrFilename[1]'' des Bausteins "''Connect from File''" (4). Mit "''Übernehmen''" (5) bestätigen Sie die Änderungen. Dieser Baustein wird zu Beginn des Tests die Verbindung zur App herstellen.<br />
<br />
[[Datei:MobileTestingConnectblock.png | frame | left | Abb. 7: Verbindungsbaustein editieren]]<br />
<br clear="all"><br />
<br />
Wechseln Sie nun zum Testplan "''Demo-Test''" (1) (Abb. 8). Dieser Testplan enthält bereits einige fertige Testfälle. Vor und nach der Ausführung (2) ist außerdem jeweils ein Baustein eingetragen: Der eben bearbeitete Baustein "''Connect''" für den Aufbau und der Baustein "''Disconnect''" für den Verbindungsabbau. Durch das Eintragen der beiden Bausteine an dieser Stelle geschieht der Verbindungsabbau insbesondere auch dann, wenn der Test vorzeitig abgebrochen wird, z. B. weil einer der Testfälle fehlschlägt.<br />
<br />
[[Datei:MobileTestingTestplan.png | frame | left | Abb. 8: Testplanausführung]]<br />
<br clear="all"><br />
Jetzt können Sie den Testplan "''Demo-Test''" starten, indem Sie auf den grünen Play-Knopf (3) klicken. Der Testplan sollte ohne Fehler durchlaufen.<br />
<br />
=== Schritt 2: Einen Baustein mit dem Recorder erstellen (iOS) ===<br />
Mit Hilfe des integrierten Recorders lassen sich einfach Ausführungssequenzen aufnehmen und in einem Baustein speichern. Dafür muss eine Verbindung zu einem Testgerät bestehen, mit dessen Hilfe der Test erstellt wird.<br />
<br />
Um eine Verbindung aufzubauen, wechseln Sie zurück zum GUI-Browser. In diesem ist noch die Verbindung eingetragen, die Sie zuvor angelegt haben. Da für die Verbindung im Testlauf derselbe Name verwendet wurde, wurden die Einstellungen damit überschrieben (In unserem Fall waren die Einstellungen ohnehin identisch). Die Verbindung ist zur Zeit nicht aktiv, da sie am Ende der Ausführung abgebaut wurde. Die Einstellungen sind dort aber noch eingetragen. Um die Verbindung mit dieser Konfiguration wieder aufzubauen, wählen Sie sie aus, gefolgt von einem Rechtsklick und "''Verbinden''".<br />
<br />
Warten Sie, bis die Verbindung aufgebaut ist (1) und drücken Sie dann den Aufnahme-Knopf (2), um eine Aufzeichnung zu starten (Abb. 9).<br />
<br />
[[Datei:MobileTestingRecorderStarten.png | frame | left | Abb. 9: Recorder starten]]<br />
<br clear="all"><br />
Es öffnet sich ein Fenster mit dem Mobile Testing Recorder (Abb. 10). Dieser zeigt einen Screenshot des verbundenen Geräts. Über diese Anzeige können Sie das Gerät fernsteuern. Dabei wird jede Aktion, die Sie ausführen, im Hintergrund aufgezeichnet.<br />
<br />
In der oberen Menüleiste können Sie das Werkzeug auswählen (1), mit dem Sie eine Aktion eingeben möchten. Als Voreinstellung ist das Werkzeug "''Auto''" ausgewählt. Sie können damit bestimmte Aktionen aufzeichnen, indem Sie mit dem Mauszeiger entsprechende Gesten auf der Anzeige ausführen. Wenn Sie zum Beispiel mit der linken Maustaste lange klicken, entspricht das einem langen Antippen des Elements an dieser Stelle. Anstatt die gewünschte Aktion mit der entsprechenden Geste zu bestimmen, können Sie diese alternativ auch manuell auswählen.<br />
<br />
Es soll nun ein neuer Test für das Erkennen korrekter GTIN-13-Codes aufgenommen werden. Klicken Sie zunächst in der Anzeige kurz auf den Button "''GTIN-13 (EAN-13)''" (2) der App um einen entsprechenden Klick auf dem Gerät auszulösen. Während der Ausführung dieser Aktion wird der Rahmen des Recorders kurzzeitig rot. Falls der Recorder danach nicht die aktuelle Ansicht der App darstellen sollte, klicken Sie im Recorder auf das Aktualisierungssymbol (3).<br />
<br />
[[Datei:MobileTestingRecorder1iOS.png | frame | left | Abb. 10: Über Recorder zur GTIN-13-Activity wechseln]]<br />
<br clear="all"><br />
Anschließend soll im Eingabefeld der neuen Seite eine korrekte GTIN-13 eingegeben werden. Führen Sie dazu einen Rechtsklick auf dem Eingabefeld (1) aus und wählen Sie im Kontextmenü die Aktion "''Text setzen''" (2) (Abb. 11). Geben Sie in den sich daraufhin öffnenden Dialog eine beliebige gültige Artikelnummer im GTIN-13-Format ein, bspw. "''4006381333986''" (3). Dieser Text wird nun in der App gesetzt.<br />
<br />
[[Datei:MobileTestingRecorder2iOS.png | frame | left | Abb. 11: GTIN-13-Code über Recorder eingeben]]<br />
<br clear="all"><br />
Klicken Sie nun auf "''Verify''" (1) (Abb. 12). In der App erscheint nun als Ergebnis "''OK''" (2). Der Test soll feststellen, ob tatsächlich dieses Ergebnis angezeigt wird. Nach einem Rechtsklick darauf können Sie im Kontextmenü die Aktion "''Attribut zusichern''" (3) auswählen. Wählen Sie im Dialog, der sich daraufhin öffnet, die Eigenschaft ''value'' (4) aus und bestätigen Sie mit "''OK''" (5). Dieses Mal wird keine Aktion auf dem Gerät ausgelöst, sondern nur ein Baustein aufgezeichnet, der fehlschlägt, sollte das Ergebnis vom erwarteten Wert "''OK''" abweichen.<br />
<br />
[[Datei:MobileTestingRecorder3iOS.png | frame | left | Abb. 12: Antwort der App über Recorder auslesen]]<br />
<br clear="all"><br />
Schließen Sie nun den Recorder. Im ''Arbeitsbereich'' des GUI-Browsers sehen Sie, dass für jede der aufgenommenen Aktionen ein Baustein angelegt wurde (Abb. 13). Sie können nun testen, ob sich das Aufgenommene wieder abspielen lässt. Dazu müssen Sie zunächst die App auf Ihrem Gerät in den Anfangszustand zurückbringen, indem Sie auf dem Gerät die Schaltfläche "''Home''" oben links benutzen. Klicken Sie dann in expecco auf den grünen Play-Knopf (1). Wird alles grün, war die Ausführung erfolgreich. Erstellen Sie nun daraus einen neuen Baustein in der Testsuite, indem Sie auf das Bausteinsymbol (2) in der rechten oberen Ecke klicken. Geben Sie ihm den Namen "''GTIN_Verify_OK''" (3) und bestätigen Sie (4).<br />
<br />
[[Datei:MobileTestingArbeitsbereich.png | frame | left | Abb. 13: Neuen Baustein aus Arbeitsbereich exportieren]]<br />
<br clear="all"><br />
Bauen Sie nun die Verbindung ab, indem Sie die Verbindung auswählen, rechtsklicken und im Kontextmenü ''Verbindung abbauen'' auswählen.<br />
<br />
Wechseln Sie zurück zum Reiter der Testsuite. Dort wurde der neue Baustein angelegt. Wählen Sie wieder den Testplan "''Demo-Test''" aus und fügen Sie den aufgenommenen Testfall "''GTIN_Verify_OK''" per Drag-and-drop am Ende des Testplans hinzu. Übernehmen Sie die Änderung und starten Sie erneut. Der Testplan sollte wieder ohne Fehler durchlaufen.<br />
<br />
=== Schritt 3: XPath anpassen mithilfe des GUI-Browsers (iOS) ===<br />
Ihr neuer Baustein funktioniert auf anderen Geräten möglicherweise nicht. Die verwendeten Elemente werden über einen XPath adressiert und dieser kann auf anderen Geräten nicht stimmen. Lesen Sie dazu den Abschnitt [[#XPath_anpassen_mithilfe_des_GUI-Browsers|XPath anpassen mithilfe des GUI-Browsers]]. Falls Ihnen ein weiteres Gerät zur Verfügung steht, können Sie nun versuchen, die Pfade in Ihren erstellten Bausteinen zu verallgemeinern. Sie können diesen Schritt aber auch überspringen.<br />
<br />
Wenn es Ihnen schwerfällt, verkürzte Pfade zu finden, orientieren Sie sich dabei an den Pfaden der bereits vorhandenen Bausteine. Starten Sie den Test erneut. Sollte der Test jetzt fehlschlagen, überprüfen Sie die Pfade noch einmal im GUI-Browser.<br />
Um den Test nun auf einem zweiten Gerät auszuführen, öffnen Sie im Menü "''Erweiterungen''" > "''Mobile Testing''" > "''Verbindungseinstellungen erstellen''". Sie erhalten einen Dialog ähnlich zum Verbindungsdialog. Allerdings können Sie hier nur Einstellungen erstellen und speichern aber keine Verbindung herstellen. Sie haben jedoch die Möglichkeit, einzelne Aspekte der Einstellungen zu speichern wie bspw. nur das Gerät. Geben Sie das neue Gerät ein und wählen Sie es aus. Klicken Sie länger auf das Symbol zum Speichern im Anhang bis sich das verzögerte Menü öffnet und wählen Sie hier "''Geräte-Einstellungen speichern''" (Abb. 14). Benennen Sie den Anhang am besten nach dem Gerät. Danach können Sie den Dialog wieder schließen.<br />
<br />
[[Datei:MobileTestingGerätSpeichern.png | frame | left | Abb. 14: Einstellungen für ein Gerät speichern]]<br />
<br clear="all"><br />
Wählen Sie den Baustein "''Connect''" aus und ziehen Sie die Einstellungen für das neue Gerät in dessen Netzwerk. Verbinden Sie nun dessen Ausgangspin ''pathName'' mit dem Eingangspin ''stringOrFilename[2]'' des Bausteins "''Connect from File''". Der Baustein Connect from File liest die Angaben an den Eingangspins von oben nach unten ein, mehrfache Eigenschaften werden dabei ersetzt. In diesem Fall werden also die Einstellungen zum verwendeten Gerät ersetzt, während die übrigen Einstellungen gleich bleiben. Wenn Sie die Pfade geschickt gewählt haben, wird der Test nun auch auf dem anderen Gerät erfolgreich ablaufen.<br />
<br />
=== Schritt 4: Noch einen Baustein erstellen (iOS) ===<br />
Falls sich gleiche Abläufe im Test wiederholen, können Sie dafür bereits erstellte Bausteine wieder-verwenden oder abwandeln. Der in Schritt 2 erstellte Baustein prüft die Erkennung korrekter GTIN-13-Codes. Es fehlt noch ein Test, der umgekehrt das Erkennen eines falschen GTIN-13-Codes prüft. Die Struktur der beiden Tests ist identisch, sie unterscheiden sich lediglich in ihren Parametern. Kopieren Sie daher den Baustein "''GTIN_Verify_OK''" und benennen Sie die Kopie in "''GTIN_Verify_NOT_OK''" um. Ändern Sie die Eingabe der GTIN-13 in einen falschen Code zum Beispiel durch Ändern der letzten Ziffer ("''4006381333987''") und setzen Sie den Überprüfungswert der Ausgabe auf "''NOT OK''" (Abb. 15).<br />
<br />
[[Datei:MobileTestingGTIN_Verify_NOT_OK_iOS.png | frame | left | Abb. 15: Baustein editieren]]<br />
<br clear="all"><br />
Fügen Sie diesen neuen Test ebenfalls zum Testplan Demo-Test hinzu und setzen Sie ihn ans Ende. Führen Sie den Testplan aus, aber vergessen Sie nicht, vorher die Verbindung im GUI-Browser abzubauen.<br />
<br />
Der neue Test wird fehlschlagen, weil Ihr aufgenommener Baustein nicht wieder zur Startseite der App zurückkehrt, die Tests aber jeweils von dort aus starten. In den anderen Bausteinen ist dies bereits berücksichtigt; sie führen abschließend immer den Baustein "''Back to main menu''" aus. Sie sehen das, indem Sie einen der anderen Bausteine, z. B. "''GTIN_Calculate''", auswählen und auf seine Schema-Ansicht wechseln. Dort steht der Baustein "''Back to main menu''" im Feld "''Nach Ausführung''" (Abb. 16). Wie beim entsprechenden Feld beim Testplan wird auch dieser Baustein immer am Ende ausgeführt, unabhängig davon, ob der Test erfolgreich verläuft oder abbricht. Ergänzen Sie diesen Eintrag nun in Ihren Bausteinen "''GTIN_Verify_OK''" und "''GTIN_Verify_NOT_OK''". Wählen Sie dazu den Baustein aus und ziehen Sie in der Schema-Ansicht den Baustein "''Back to main menu''" auf das Eingabefeld "''Nach Ausführung''". Nun können Sie den Testplan starten und alle Tests sollten wieder problemlos ausgeführt werden.<br />
<br />
[[Datei:AppiumDemo Nach Ausführung.png | frame | left | Abb. 16: Nach-Ausführungs-Baustein setzen]]<br />
<br clear="all"><br />
<br />
=== Schritt 5: Test vervollständigen (iOS) ===<br />
Für die Activity IBAN sind bereits alle Antwortmöglichkeiten der App mit Testfällen abgedeckt. In der GTIN-13-Activity werden ein korrekter und ein fehlerhafter Code getestet und eine Prüfziffer berechnet, das Verhalten der App bei Eingaben falscher Länge wird aber bisher nicht getestet (Bei Verify "''Input must be exactly 13 digits''" und "''…12 digits''". bei Calculate). Die Activity zum Prüfen der Seriennummern von Eurobanknoten wird noch gar nicht getestet. Wie bei der IBAN können hier drei Fälle auftreten: eine korrekte Seriennummer wurde eingegeben (Antwort: "''OK''"), eine falsche Seriennummer wurde eingegeben (Antwort: "''NOT OK''") oder die Angabe entspricht nicht dem Format (Antwort: "''A serial number consists of 12 characters with the first one or two being capital letters (A-Z).''"). Sie können die Testabdeckung jetzt noch erweitern, indem Sie entsprechende Testfälle erstellen. Die Bausteine dafür können Sie wie in Schritt 2 mit dem Recorder erstellen und die XPaths bei Bedarf verallgemeinern. Wenn Sie mit dem grundsätzlichen Umgang mit expecco vertraut sind, können Sie Bausteine natürlich auch ohne Recorder erstellen, indem Sie sie manuell aus vorhandenen Bausteinen der Bibliothek zusammensetzen. Sie können auch beide Vorgehensweisen nach Belieben kombinieren.<br />
<br />
Beachten Sie, dass die hier vorgestellten Testfälle jeweils nur einzelne Eingaben prüfen. Wenn Sie Testfälle für Ihre eigenen Apps schreiben, wollen Sie vermutlich engmaschiger testen, indem Sie noch weitere unterschiedliche Werte eingeben, die insbesondere auch Randfälle enthalten.<br />
<br />
= Dialoge des Mobile Testing Plugins =<br />
== Verbindungseditor ==<br />
Mithilfe des Verbindungseditors können Sie schnell Verbindungen definieren, ändern oder aufbauen. Je nach Aufgabe weist der Dialog kleine Unterschiede auf und wird unterschiedlich geöffnet:<br />
*Um eine Verbindung aufzubauen, klicken Sie im GUI-Browser auf "''Verbinden'"' klicken und wählen dann "''Mobile Testing''".<br />
*Um eine bestehende Verbindung im GUI-Browser zu ändern oder zu kopieren, wählen Sie diese aus, machen einen Rechtsklick und wählen im Kontextmenü "''Verbindung bearbeiten''" oder "''Verbindung kopieren''" aus.<br />
*Wollen Sie Verbindungseinstellungen nicht für den GUI-Browser sondern zur Verwendung in einem Test erstellen, wählen Sie im Menü des Mobile Testing Plugins den Punkt "''Verbindungseinstellungen erstellen...''". Darüber können nur die Einstellungen für eine Verbindung erstellt werden, ohne dass eine Verbindung tatsächlich angelegt wird.<br />
<br />
Einige der Schaltflächen sind nur beim Erstellen von Verbindungseinstellungen sichtbar:<br />
[[Datei:MobileTestingVerbindungseditorMenu.png]]<br />
#"''Einstellungen löschen''": Setzt alle Einträge zurück. (Nur beim Erstellen von Einstellungen sichtbar.)<br />
#"''Einstellungen aus Datei laden''": Erlaubt das Öffnen einer gespeicherten Einstellungsdatei (*.csf). Deren Einstellungen werden in den Dialog übernommen. Bereits getätigte Eingaben ohne Konflikt bleiben dabei erhalten.<br />
#"''Einstellungen aus Anhang laden''": Erlaubt das Öffnen eines Anhangs mit Verbindungseinstellungen aus einem geöffneten Projekt. Diese Einstellungen werden in den Dialog übernommen. Bereits getätigte Eingaben ohne Konflikt bleiben dabei erhalten.<br />
#"''Einstellungen in Datei speichern''" sowie<br />
#"''Einstellungen in Anhang speichern''": Hier können Sie die eingetragenen Einstellungen in eine Datei (*.csf) speichern oder als Anhang in einem geöffneten Projekt anlegen. Beide Optionen besitzen ein verzögertes Menü, in dem Sie auswählen können, nur einen bestimmten Teil der Einstellungen zu speichern. (Nur beim Erstellen von Einstellungen sichtbar.)<br />
#"''Erweiterte Ansicht''": Damit können Sie in die erweiterte Ansicht wechseln, um zusätzliche Einstellungen vorzunehmen. Lesen Sie dazu mehr am Ende des Kapitels. (Nur beim Erstellen von Einstellungen sichtbar.)<br />
#"''Hilfe''": An der rechten Seite wird ein Hilfetext zum jeweiligen Schritt ein- oder ausgeblendet.<br />
<br />
<br />
Der Dialog ist in drei Schritte unterteilt. Im ersten Schritt wählen Sie das Gerät, das Sie verwenden möchten, im zweiten Schritt wählen Sie aus, welche App verwendet werden soll und im letzten Schritt erfolgen die Einstellungen zum Appium-Server.<br />
<br />
===<span id="AppiumConnectionEditorStep1"><!-- Referenced by AppiumConnectionEditor in Mobile Testing Plugin --></span>Schritt 1: Gerät auswählen===<br />
Im oberen Teil erhalten Sie eine Liste aller angeschlossenen Appium-Geräte, die erkannt werden. Mit der Checkbox darunter können Sie die Geräte ausblenden, die zwar erkannt werden, aber nicht bereit sind. Falls Sie ein Gerät eintragen wollen, das nicht angeschlossen ist, können Sie dies mit dem entsprechenden Knopf "''Android-Gerät eingeben''" bzw. "''iOS-Gerät eingeben''" anlegen. Dazu müssen Sie jedoch die benötigten Eigenschaften Ihres Geräts kennen. Das Gerät wird dann in einer zweiten Geräteliste angelegt und kann dort ausgewählt werden. Wenn keine Liste mit angeschlossenen Elementen angezeigt werden kann, werden stattdessen verschiedene Meldungen angezeigt:<br />
*Keine Geräte gefunden<br />
*:expecco konnte kein Android-Geräte finden.<br />
*:Um eine Verbindung zu einem Gerät automatisch zu konfigurieren, stellen Sie sicher, dass es<br />
*:*angeschlossen ist<br />
*:*eingeschaltet ist<br />
*:*einen passenden adb-Treiber installiert hat<br />
*:*für Debugging freigeschaltet ist (siehe unten).<br />
*Keine verfügbaren Geräte gefunden<br />
*:expecco konnte keine verfügbaren Android-Geräte finden. Es wurden aber nicht verfügbare gefunden, z.B. mit dem Status "unauthorized".<br />
*:Um eine Verbindung zu einem Gerät automatisch zu konfigurieren, stellen Sie sicher, dass es<br />
*:*angeschlossen ist<br />
*:*eingeschaltet ist<br />
*:*einen passenden adb-Treiber installiert hat<br />
*:*für Debugging freigeschaltet ist (siehe unten).<br />
*:Um nicht verfügbare Geräte anzuzeigen, aktivieren Sie unten diese Option.<br />
*Verbindung verloren<br />
*:expecco hat die Verbindung zum adb-Server verloren. Versuchen Sie die Verbindung wieder herzustellen, indem Sie auf den Button klicken.<br />
*Verbindung fehlgeschlagen<br />
*:expecco konnte sich nicht mit dem adb-Server verbinden. Möglicherweise läuft er nicht oder der angegebene Pfad stimmt nicht.<br />
*:Überprüfen Sie die adb-Konfiguration in den Einstellungen und versuchen Sie den adb-Server zu starten und eine Verbindung herzustellen indem Sie auf den Knopf klicken.<br />
*Verbinden ...<br />
*:expecco verbindet sich mit dem adb-Server. Dies kann einige Sekunden dauern.<br />
*adb-Server starten ...<br />
*:expecco startet den adb-Server. Dies kann einige Sekunden dauern.<br />
<br />
<!--Bei "''Automatisierung durch''" können Sie angeben, welche Automation-Engine verwendet werden soll. Lassen Sie die Einstellung auf "''(Default)''" wird die entsprechende Capability gar nicht gesetzt. Ansonsten stehen Appium, Selendroid und ab expecco 2.11 XCUITest zur Verfügung. In der Regel wird Selendroid nur für Android-Geräte vor Version 4.1 gebraucht.-->Mit "''Weiter''" gelangen Sie zum nächsten Schritt. Wenn Sie Einstellungen für den GUI-Browser eingeben, ist das erst möglich, wenn ein Gerät ausgewählt wurde.<br />
<br />
<span id="UnlockingDeveloperOptions">Anmerkung zum Freischalten</span>: In jüngeren Android Versionen werden die Entwickleroptionen zunächst nicht mehr in den Einstellungen angeboten. Falls ihr Android Gerät in den Einstellungen keinen Eintrag zu "''Entwickleroptionen''" zeigt, wählen Sie zunächst den Eintrag "''Telefoninfo''", dann "''SoftwareVersionsInfo''" und klicken darin mehrfach auf den Eintrag "''BuildVersion''".<br />
<br />
===<span id="AppiumConnectionEditorStep2"><!-- Referenced by AppiumConnectionEditor in Mobile Testing Plugin --></span>Schritt 2: App auswählen===<br />
Hier können Sie Angaben zur App machen, die getestet werden soll. Dabei können Sie entscheiden, ob Sie eine App verwenden wollen, die bereits auf dem Gerät installiert ist, oder ob für den Test eine App installiert werden soll. Wählen Sie oben den entsprechenden Reiter aus. Je nachdem, ob Sie im vorigen Schritt ein Android- oder ein iOS-Gerät ausgewählt haben, ändert sich die erforderte Eingabe.<br />
<br />
*'''Android'''<br />
**''App auf dem Gerät''<br />
**:Wenn Sie im ersten Schritt ein angeschlossenes Gerät ausgewählt haben, werden die Pakete aller installierten Apps automatisch abgerufen und Sie können die Auswahl aus den Drop-down-Listen treffen. Die installierten Apps sind in Fremdpakete und Systempakete unterteilt; wählen Sie die entsprechende Paketliste aus. Diese Auswahl gehört nicht zu den Einstellungen, sondern stellt nur die entsprechende Paketliste zur Verfügung. Sie können den Filter benutzen, um die Liste weiter einzuschränken und dann das gewünschte Paket auswählen. Die Activities des ausgwählten Pakets werden ebenfalls automatisch abgerufen und als Drop-down-Liste zur Verfügung gestellt. Wählen Sie die Activity aus, die gestartet werden soll. In der Regel wird automatisch eine Activity aus der Liste eingetragen. Falls Sie kein verbundenes Gerät verwenden, müssen Sie die Eingabe des Pakets und der Activity von Hand vornehmen.<br />
**''App installieren''<br />
**:Geben Sie bei "''App''" den Pfad zu einer App an. Der Pfad muss für den Appium-Server gültig sein, der verwendet wird. Sie können auch eine URL angeben. Benutzen Sie einen lokalen Appium-Server, können Sie den rechten Butten benutzen, um zu der Installationsdatei der App zu navigieren und diesen Pfad einzutragen. Wenn möglich werden dabei auch das entsprechende Paket und die Activity in den Feldern darunter eingetragen. Diese Angabe ist aber nicht notwendig.<br />
<br />
*'''iOS'''<br />
**''App auf dem Gerät''<br />
**:Geben Sie die Bundle-ID einer installierten App an. Sie können die IDs der installierten Apps bspw. mithilfe von Xcode erfahren. Starten Sie dazu Xcode und wählen Sie in der Menüleiste am oberen Bildschirmrand im Menü "''Window''" den Eintrag "''Devices''". Es öffnet sich ein Fenster, in dem eine Liste der angeschlossenen Geräte angezeigt wird. Wenn Sie Ihr Gerät auswählen, sehen Sie in der Übersicht eine Auflistung der von Ihnen installierten Apps.<br />
**''App installieren''<br />
**:Geben Sie bei "''App''" den Pfad zu einer App an. Der Pfad muss für den Appium-Server gültig sein, der verwendet wird. Sie können auch eine URL angeben. Zu den Vorraussetzungen an Apps für reale Geräte lesen Sie bitte den Abschnitt [[#iOS-Ger.C3.A4t_und_App_vorbereiten|iOS-Geräte und App vorbereiten]].<br />
<br />
Im unteren Teil können Sie festlegen, ob die App beim Verbindungsabbau zurückgesetzt bzw. deinstalliert werden soll, und ob sie initial zurückgesetzt werden soll. Auch hier wird die entsprechende Capability gar nicht gesetzt, wenn Sie "''(Default)''" auswählen. Mit "''Weiter''" gelangen Sie zum nächsten Schritt.<br />
<br />
===<span id="AppiumConnectionEditorStep3"><!-- Referenced by AppiumConnectionEditor in Mobile Testing Plugin --></span>Schritt 3: Servereinstellungen===<br />
Im letzten Schritt befindet sich zunächst im oberen Teil eine Liste aller Capabilities, die sich aus Ihren Angaben der vorigen Schritte ergeben. Wenn Sie sich mit Appium auskennen und noch zusätzliche Capabilities setzen möchten, die der Verbindungseditor nicht abdeckt, können Sie durch Klicken auf "''Bearbeiten''" in die erweiterte Ansicht gelangen. Lesen Sie dazu den Abschnitt weiter unten.<br />
<br />
Wenn Sie Einstellungen für den GUI-Browser eingeben, können Sie den ''Verbindungsnamen'' eintragen, mit dem die Verbindung angezeigt wird. Dies ist auch der Name unter dem Bausteine diese Verbindung verwenden können, wenn sie aufgebaut ist. Wenn Sie das Feld frei lassen, wird ein Name generiert. Um die Adresse für den Appium-Server anzugeben, erhalten Sie die lokale Standard-Adresse und bereits verwendete Adressen zur Auswahl. Wenn Sie den Haken für "''Bei Bedarf starten''" setzen, versucht expecco beim Verbinden einen Appium-Server an der angegebenen Adresse zu starten, wenn dort noch keiner läuft. Dieser Server wird dann beim Beenden der Verbindung ebenfalls heruntergefahren. Dies funktioniert nur für lokale Adressen. Achten Sie darauf, nur Portnummern zu verwenden, die auch frei sind. Verwenden Sie am besten nur ungerade Portnummern ab dem Standardport 4723. Beim Verbindungsaufbau wird ebenfalls die folgende Portnummer verwendet, wodurch es sonst zu Konflikten kommen könnte.<br />
<br />
Je nachdem, wie Sie den Dialog geöffnet haben, gibt es nun verschiedene Schaltflächen um ihn abzuschließen. In jedem Fall haben Sie die Option zu speichern. Dabei öffnet sich ein Dialog, indem Sie entweder ein geöffnet Projekt auswählen können, um die Einstellungen dort als Anhang zu speichern, oder auswählen es in einer Datei zu speichern, die Sie anschließend angeben können. Durch das Speichern wird der Dialog nicht beendet, wodurch Sie anschließend noch eine andere Option auswählen könnten.<br />
<br />
Wenn Sie den Editor zum Verbindungsaufbau geöffnet haben, können Sie abschließend auf "''Verbinden''" oder "''Server starten und verbinden''" klicken, je nachdem, ob der Haken für den Serverstart gesetzt ist. Für das Ändern oder Kopieren einer Verbindung im GUI-Brower heißt diese Option "''Übernehmen''", da in diesem Fall nur der Verbindungseintrag geändert bzw. neu angelegt wird, der Verbindungsaufbau aber nicht gestartet wird. Das können Sie bei Bedarf anschließend über das Kontextmenü tun. Falls Sie Capabilities einer bestehenden Verbindung geändert haben, fordert Sie anschließend ein Dialog auf zu entscheiden, ob diese Änderungen direkt übernommen werden sollen, indem die Verbindung abgebaut und mit den neuen Verbindungen aufgebaut wird, oder nicht. In diesem Fall werden die Änderungen erst wirksam, nachdem Sie die Verbindung neu aufbauen.<br />
<br />
Zur Verwendung des Verbindungseditors lesen Sie auch den entsprechenden Abschnitt im jeweiligen Tutorial in Schritt 1 (Android: [[#Schritt_1:_Demo_ausf.C3.BChren|Demo ausführen]], iOS: [[#Schritt_1:_Demo_ausf.C3.BChren_.28iOS.29|Demo ausführen (iOS)]]).<br />
<br />
===Erweiterte Ansicht===<br />
Die erweiterte Ansicht des Verbindungseditors erhalten Sie entweder durch Klicken auf "''Bearbeiten''" im dritten Schritt oder jederzeit über den entsprechenden Menüeintrag, wenn Sie den Editor über das Plugin-Menü gestartet haben. In dieser Ansicht erhalten Sie eine Liste aller eingestellten Appium-Capabilities. Zu dieser können Sie weitere hinzufügen, Einträge ändern oder entfernen. Um eine Capability hinzuzufügen, wählen Sie diese aus der Drop-down-Liste des Eingabefelds aus. In dieser befinden sich alle bekannten Capabilities sortiert in die Kategorien ''Common'', ''Android'' und ''iOS''. Haben Sie eine Capability ausgewählt, wird ein kurzer Informationstext dazu angezeigt. Sie können in das Feld auch von Hand eine Capability eingeben. Klicken Sie dann auf "''Hinzufügen''", um die Capabilitiy in die Liste einzutragen. Dort können Sie in der rechten Spalte den Wert setzen. Um einen Entrag zu löschen, wählen Sie diesen aus und klicken Sie auf "''Entfernen''". Mit "''Zurück''" verlassen Sie die erweiterte Ansicht.<br />
<br />
[[Datei:MobileTestingErweiterteAnsicht.png]]<br />
<br />
== Laufende Appium-Server ==<br />
Im Menü des Mobile Testing Plugins finden Sie den Eintrag "''Appium-Server...''". Mit diesem öffnen Sie ein Fenster mit einer Übersicht aller Appium-Server, die von expecco gestartet wurden und auf welchem Port diese laufen. Durch Klicken auf das Icon in der Spalte "''Log anzeigen''" können Sie das Logfile des entsprechenden Servers anschauen. Dieses wird beim Beenden des Servers wieder gelöscht. Mit den icons in der Spalte "''Beenden''" kann der entsprechenden Server beendet werden. Allerdings wird dies verhindert, wenn expecco über diesen Server noch eine offene Verbindung hat.<br />
<br />
Außerdem können Sie hier auch Server starten. Verwenden Sie die Eingabefelder zur Konfiguration der Serveradresse. Sie können die Felder auch frei lassen, um die Standardwerte zu verwenden. Bitte beachten Sie, dass Server nur lokal gestartet werden können und der gewählte Port nicht belegt sein darf. Typischerweise werden die ungeraden Portnummern ab 4723 verwendet. Die folgende Portnummer wird beim Verbinden mit einem Gerät ebenfalls benötigt, wodurch es mit den geraden Nummern zu Konflikten kommen könnte.<br />
<br />
[[Datei:MobileTestingAppiumServer.png]]<br />
<br />
Im Menü des Mobile Testing Plugins finden Sie auch den Eintrag "''Alle Verbindungen und Server beenden''". Dies ist für den Fall gedacht, dass Verbindungen oder Server auf andere Weise nicht beendet werden können. Beenden Sie Verbindungen wenn möglich immer im GUI-Browser oder durch Ausführen eines entsprechenden Bausteins. Server, die Sie in der Server-Übersicht gestartet haben, beenden Sie dort; Server, die mit einer Verbindung gestartet wurden, werden automatisch mit dieser beendet.<br />
<br />
Beachten Sie, dass in der Übersicht nur Server aufgelistet sind, die von expecco gestartet und verwaltet werden. Mögliche andere Appium-Server, die auf andere Art gestartet wurden, werden nicht erkannt.<br />
<br />
== Recorder ==<br />
Besteht im GUI-Browser eine Verbindung zu einem Gerät, kann der integrierte Recorder verwendet werden, um mit diesem Gerät einen Testabschnitt aufzunehmen. Sie starten den Recorder, indem Sie im GUI-Browser die entsprechende Verbindung auswählen und dann auf den Aufnahme-Knopf klicken. Für den Recorder öffnet sich ein neues Fenster. Die aufgezeichneten Aktionen werden im Arbeitsbereich des GUI-Browsers angelegt. Daher ist es möglich, das Aufgenommene parallel zu editieren.<br />
<br />
[[Datei:MobileTestingRecorder.png|caption|]]<br />
<br />
;Komponenten des Recorderfensters<br />
#'''Aktualisieren''': Holt das aktuelle Bild und den aktuellen Elementbaum vom Gerät. Dies wird nötig, wenn das Gerät zur Ausführung einer Aktion länger braucht oder sich etwas ohne das Anstoßen durch den Recorder ändert.<br />
#'''Follow-Mouse''': Das Element unter dem Mauszeiger wird im GUI-Browser ausgewählt.<br />
#'''Element-Highlighting''': Das Element unter dem Mauszeiger wird rot umrandet.<br />
#'''Elemente einzeichnen''': Die Rahmen aller Elemente der Ansicht werden angezeigt.<br />
#'''Werkzeuge''': Auswahl, mit welchem Werkzeug aufgenommen werden soll. Die gewählte Aktion wird bei einem Klick auf die Anzeige ausgelöst. Dabei stehen folgende Aktionen zur Verfügung:<br />
#*Aktionen auf Elemente:<br />
#**Klicken: Kurzer Klick auf das Element, über dem der Cursor steht. Zur genaueren Bestimmung, welches Element verwendet wird, benutzen Sie die Funktion Follow-Mouse oder Element-Highlighting.<br />
#**Element antippen: Ähnlich zum Klicken, nur dass zusätzlich die Dauer des Klicks aufgezeichnet wird. Dadurch sind auch längere Klicks möglich.<br />
#**Text setzen: Ermöglicht das Setzen eines Textes in Eingabefelder.<br />
#**Text löschen: Löscht den Text eines Eingabefelds.<br />
#*Aktionen auf das Gerät:<br />
#**Antippen: Löst einen Klick auf die Bildschirmposition aus, bei dem auch die Dauer berücksichtigt wird.<br />
#**Wischen: Wischen in einer geraden Linie vom Punkt des Drückens des Mausknopfes bis zum Loslassen. Die Dauer wird ebenfalls aufgezeichnet.<br />
#:Beachten Sie bei diesen Aktionen, dass das Ergebnis sich auf verschiedenen Geräten unterscheiden kann, bspw. bei verschiedenen Bildschirmauflösungen.<br />
#*Erstellen von Testablauf-Bausteinen<br />
#**Attribut prüfen: Vergleicht den Wert eines festgelegten Attributs des Elements mit einem vorgegebenen Wert. Das Ergebnis triggert den entsprechenden Ausgang.<br />
#**Attribut zusichern: Vergleicht den Wert eines festgelegten Attributs des Elements mit einem vorgegebenen Wert. Bei Ungleichheit schlägt der Test fehl.<br />
#*Auto<br />
#:Ist das Auto-Werkzeug ausgewählt, können alle Aktionen durch spezifische Eingabeweise benutzt werden: ''Klicken'', ''Element antippen'' und ''Wischen'' funktionieren weiterhin durch Klicken, wobei sie anhand der Dauer und der Bewegung des Cursors unterschieden werden. Um ein ''Antippen'' auszulösen, halten Sie beim Klicken Strg gedrückt. Die übrigen Aktionen erhalten Sie durch einen Rechtsklick auf das Element in einem Kontextmenü.<br />
#'''Softkeys''': Nur unter Android. Simuliert das Drücken der Knöpfe Zurück, Home, Fensterliste und Power.<br />
#'''Home-Button''': Nur unter iOS ab expecco 2.11. Ermöglicht das Drücken des Home-Buttons. Vor expecco 19.2 funktioniert es nur, wenn AssistiveTouch aktiviert ist und sich das Menü in der Mitte des oberen Bildschirmrands befindet. Ab expecco 19.2 verwendet die Funktion kein AssistiveTouch mehr.<br />
#'''Anzeige''': Zeigt einen Screenshot des Geräts. Aktionen werden mit der Maus je nach Werkzeug ausgelöst. Wenn eine neue Aktion eingegeben werden kann, hat das Fenster einen grünen Rahmen, sonst ist er rot.<br />
#'''Fenster an Bild anpassen''': Ändert die Größe des Fensters so, dass der Screenshot vollständig angezeigt werden kann.<br />
#'''Bild an Fenster anpassen''': Skaliert den Screenshot auf eine Größe, mit der er die volle Größe des Fensters ausnutzt.<br />
#'''Ausrichtung anpassen''': Korrigiert das Bild, falls dieses auf dem Kopf stehen sollte. Über den Pfeil rechts daneben kann das Bild auch um 90° gedreht werden, falls dies einmal nötig sein sollte. Die Ausrichtung des Bildes ist für die Funktion des Recorders unerheblich, dieser arbeitet ausschließlich auf den erhaltenen Elementen.<br />
#'''Skalierung''': Ändert die Skalierung des Screenshots.<br />
#'''Kontrollleuchte''': Zeigt den Zustand des Recorders an<br />
#:''grün'': Der Recorder ist bereit<br />
#:''rot'': Der Recorder ist blockiert, weil die Anzeige und die Elementliste aktualisiert werden<br />
#:''grau'': Der Recorder kann nicht mehr verwendet werden, da die Verbindung zum Gerät verloren gegangen ist<br />
<br />
;Verwendung<br />
Mit jedem Klick im Fenster wird eine Aktion ausgelöst und im Arbeitsbereich des GUI-Browsers aufgezeichnet. Dort können Sie das Aufgenommene abspielen, editieren oder daraus einen neuen Baustein erstellen.<br />
Aktionen zum Auslösen von Sofkeys finden Sie direkt in der Menüleiste (s.o.). Um Aktionen auf Elemente aufzuzeichen, ändern Sie entweder die Auswahl des Werkzeugs in der Menüleiste (s.o.) und klicken dann auf das Element oder wählen Sie die entsprechende Aktion aus dem Kontextmenü durch einen Rechtsklick auf das entsprechende Element aus. Für Texteingabe ist es zudem möglich, den Cursor über dem Element zu platzieren und den Text einzugeben. Dabei öffnet sich der Eingabedialog für diese Aktion.<br />
Zur Verwendung des Recorders lesen Sie auch Schritt 2 im Tutorial ([[#Schritt_2:_Einen_Baustein_mit_dem_Recorder_erstellen|Android]] bzw. [[#Schritt_2:_Einen_Baustein_mit_dem_Recorder_erstellen_2|iOS]]).<br />
<br />
== AVD Manager und SDK Manager ==<br />
AVD Manager und SDK Manager sind beides Anwendungen von Android. Im Menü des Mobile Testing Plugins bietet expecco die Möglichkeit, diese zu starten. Ansonsten finden Sie diese Programme bei Ihrer Android-Installation. Mit dem AVD Manager können Sie AVDs, also Konfigurationen für Emulatoren, erstellen, bearbeiten und starten. Mit dem SDK Manager erhalten Sie einen Überblick über Ihre Android-Installation und können diese bei Bedarf erweitern.<br />
<br />
= Hybrid-Apps und WebViews =<br />
<br />
'''!!! Wichtiger Hinweis - Wenn Sie Probleme haben, auf den Webview zu wechseln, geben Sie bitte unter den Android Einstellungen - Apps -Standard Apps "Chrome" als "Browser-App" an !!!<br />
'''<br />
<br />
Hybrid-Apps enthalten neben den Plattform-nativen Elementen weitere Elemente, die in einen WebView eingebunden sind. Diese Elemente können ebenfalls bedient werden, allerdings muss zuvor in den entsprechenden Kontext gewechselt werden. Mit dem Baustein "''Get Current Context''" erhalten Sie den aktuellen Kontext. Zu Beginn ist dies "''NATIVE_APP''", also der Kontext der nativen Elemente. Mit dem Baustein "''Get Context Handles''" bekommen Sie eine Collection aller vorhandenen Kontexte. Gibt es einen WebView-Kontext, so heißt dieser "''WEBVIEW_1''" oder "''WEBVIEW_<package>''" mit dem Paket des WebViews. Es kann auch mehrere WebView-Kontexte geben. Zu jedem WebView-Kontext gibt es im nativen Kontext ein entsprechendes WebView-Element. Mit dem Baustein "''Switch to Context''" können Sie in einen solchen Kontext wechseln und haben fortan nur Zugriff auf die Elemente in diesem Kontext.<br />
<br />
Im GUI-Browser werden zum einen oben im Baum die vorhandenen Kontexte angezeigt, zum anderen wird der Baum eines Kontexts unterhalb des entsprechenden WebView-Elements eingefügt.<br />
<br />
= XPath anpassen mithilfe des GUI-Browsers =<br />
Bausteine, die auf einem Gerät fehlerfrei funktionieren, tun dies auf anderen Geräten möglicherweise nicht. Auch können kleine Änderungen der App dazu führen, dass ein Baustein nicht mehr den gewünschten Effekt hat. Man sollte einen Baustein daher so robust formulieren, dass er für eine Vielzahl von Geräten verwendet werden kann und kleine Anpassungen an der App verkraftet. Dazu muss man das grundlegende Funktionsprinzip der Adressierung verstehen. Dies wird im Folgenden am Beispiel der App aus dem Tutorial erläutert.<br />
<br />
Die Ansicht der App setzt sich aus einzelnen Elementen zusammen. Dazu gehören die Schaltflächen "''GTIN-13 (EAN-13)''" und "''Verify''", das Eingabefeld der Zahl "''4006381333986''" und das Ergebnisfeld, in dem OK erscheint, wie auch alle anderen auf der Anzeige sichtbaren Dinge. Diese sichtbaren Elemente sind in unsichtbare Strukturelemente eingebettet. Alle Elemente zusammen sind in einer zusammenhängenden Hierarchie, dem Elementbaum, organisiert.<br />
<br />
[[Datei:MobileTestingGUIBrowser.png | frame | left | Abb. 1: Funktionen des GUI-Browsers]]<br />
<br clear="all"><br />
Sie können sich diesen Baum im GUI-Browser ansehen. Wechseln Sie dazu in den GUI-Browser (Abb. 1) und starten Sie eine beliebige Verbindung. Sobald die Verbindung aufgebaut ist, können Sie den gesamten Baum aufklappen (1) (Klick bei gedrückter Strg-Taste). Er enthält alle Elemente der aktuellen Seite der App.<br />
<br />
Ein Baustein, der nun ein bestimmtes Element verwendet, muss dieses eindeutig angeben, indem er dessen Position im Elementbaum mit einem Pfad im XPath-Format beschreibt. Dieses Format ist ein verbreiteter Web-Standard für XML-Dokumente und -Datenbanken, eignet sich aber genauso für Pfade im Elementbaum.<br />
<br />
Wenn Sie ein Element im Baum auswählen, wird unten der von expecco automatisch generierte XPath (2) für das Element angezeigt, der auch beim Aufzeichnen verwendet wird. Oberhalb davon in der Mitte des Fensters befindet sich eine Liste der Eigenschaften (3) des ausgewählten Elements. Man nennt diese Eigenschaften auch Attribute. Sie beschreiben das Element näher wie beispielsweise seinen Typ, seinen Text oder andere Informationen zu seinem Zustand. Links unten können Sie zur besseren Orientierung im Baum die ''Vorschau'' (4) aktivieren, um sich den Bildausschnitt des Elements anzeigen zu lassen.<br />
<br />
Der Elementbaum für gleiche Ansicht einer App kann sich je nach Gerät unterscheiden. Es sind diese Unterschiede, die verhindern, eine Aufnahme von einem Gerät unverändert auch auf allen anderen Geräten abzuspielen: Ein XPath, der im einen Elementbaum ein bestimmtes Element identifiziert, beschreibt nicht unbedingt das gleiche Element im Elementbaum auf einem anderen Gerät. Es kann stattdessen passieren, dass der XPath auf kein Element, auf ein falsches Element oder auf mehrere Elemente passt. Dann schlägt der Test fehl oder er verhält sich unerwartet.<br />
<br />
Man könnte natürlich für jedes Gerät einen eigenen Testfall schreiben. Das brächte aber unverhältnismäßigen Aufwand bei Testerstellung und -wartung mit sich. Das Problem lässt sich auch anders lösen, da ein jeweiliges Element nicht nur durch genau einen XPath beschrieben wird. Vielmehr erlaubt der Standard mithilfe verschiedener Merkmale unterschiedliche Beschreibungen für ein und dasselbe Element zu formulieren. Das Ziel ist daher, einen Pfad zu finden, der auf allen für den Test verwendeten Geräten funktioniert und überall eindeutig zum richtigen Element führt.<br />
<br />
Im Beispiel besteht die Verbindung zur Android-App aus dem Tutorial und der Eintrag des "''GTIN-13''"-Buttons ist ausgewählt (5). Dessen automatisch generierter XPath (2) kann beispielsweise so aussehen:<br />
<br />
<blockquote>//hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[@resource id='android:id/content']/android.widget.RelativeLayout/android.widget.Button[@resource-id='de.exept.expeccomobiledemo:id/gtin_13']</blockquote><br />
<br />
Er ist offensichtlich lang und unübersichtlich. Der sehr viel kürzere Pfad<br />
<br />
<blockquote>//*[@text='GTIN-13 (EAN-13)']</blockquote><br />
<br />
führt zum selben Element.<br />
<br />
Für die iOS-App lautet der automatisch generierte XPath für diesen Button beispielsweise<br />
<br />
<blockquote>//AppiumAUT/XCUIElementTypeApplication/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeButton[2]</blockquote><br />
bzw.<br />
<blockquote>//AppiumAUT/UIAApplication/UIAWindow[1]/UIAButton[2]</blockquote><br />
<br />
und kann kürzer als<br />
<br />
<blockquote>//*[@name='GTIN-13 (EAN-13)']</blockquote><br />
<br />
geschrieben werden.<br />
<br />
Sie können den Pfad entsprechend im GUI-Browser ändern und durch "''Pfad überprüfen''" (6) feststellen, ob er weiterhin auf das ausgewählte Element zeigt, was expecco mit "''Verify Path: OK''" (7) bestätigen sollte. Der erste, sehr viel längere Pfad, beschreibt den gesamten Weg vom obersten Element des Baumes bis hin zum gesuchten Button. Der zweite Pfad hingegen wählt mit "*" zunächst sämtliche Elemente des Baumes und schränkt die Auswahl dann auf genau die Elemente ein, die ein ''text''- bzw. ''name''-Attribut mit dem Wert "''GTIN-13 (EAN-13)''" besitzen, in unserem Fall also genau der eine Button, den wir suchen.<br />
<br />
Im folgenden werden Android-ähnliche Pfade zur Veranschaulichung verwendet. Die Elemente in iOS-Apps heißen zwar anders, wodurch andere Pfade entstehen; das Prinzip ist jedoch das gleiche.<br />
<br />
[[Datei:MobileTestingBaum1.png | frame | Abb. 2: Elementbaum einer fiktiven App]]<br />
<br />
Sie können solche Pfade mit Hilfe weniger Regeln selbst formulieren. Sehen Sie sich den einfachen Baum einer fiktiven Android-App in Abb. 2 an: Die Einrückungen innerhalb des Baumes geben die Hierarchie der Elemente wieder. Ein Element ist ein ''Kind'' eines anderen Elementes, wenn jenes andere Element das nächsthöhere Element mit einem um eins geringeren Einzug ist. Jenes Element ist das ''Elternelement'' des Kindes. Sind mehrere untereinander stehende Elemente gleich eingerückt, so sind sie also alle Kinder desselben Elternelements.<br />
<br />
Ein Pfad durch alle Ebenen der Hierarchie zum TextView-Element ist nun:<br />
<br />
<blockquote>//hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.TextView</blockquote><br />
<br />
Die Elemente sind mit Schrägstrichen voneinander getrennt. Es fällt auf, dass der Name des ersten Elements nicht mit dem im Baum übereinstimmt. Das oberste Element in der Hierarchie heißt immer "''hierarchy''" (für iOS wäre es "''AppiumAUT''"), expecco zeigt im Baum stattdessen den Namen der Verbindung an, damit man mehrere Verbindungen voneinander unterscheiden kann. Die weiteren Elemente tragen jeweils das Präfix "''android.widget.''", das im Baum zur besseren Übersicht nicht angezeigt wird. Bei IOS gibt es kein Präfix, das durch einen Punkt abgetrennt wäre, expecco 2.11 blendet aber entsprechend "''XCUIElementType''" am Anfang aus. Mit jedem Schrägstrich führt der Pfad über eine Eltern-Kind-Beziehung in eine tiefere Hierarchie-Ebene, d. h. "''FrameLayout''" ist ein Kindelement von "''hierarchy''", "''LinearLayout''" ist ein Kind von "''FrameLayout''" usw. Die in eckigen Klammern geschriebenen Wörter dienen nur als Orientierungshilfe im Baum. Sie gehören nicht zum Typ.<br />
<br />
Ein Pfad muss nicht beim Element "''hierarchy''" beginnen. Man kann den Pfad beginnend mit einem beliebigen Element des Baumes bilden. Man kann also verkürzt auch<br />
<br />
<blockquote>//android.widget.TextView</blockquote><br />
<br />
schreiben. Der Pfad führt zum selben "''TextView''"-Element, da es nur ein Element dieses Typs gibt. Anders verhält es sich bei dem Pfad<br />
<br />
<blockquote>//android.widget.Button.</blockquote><br />
<br />
Da es zwei Elemente vom Typ "''Button''" gibt, passt dieser Pfad auf zwei Elemente, nämlich den Button, der mit "''An''" markiert ist, und den ''Button'', der mit "''Aus''" markiert ist. Es würde an dieser Stelle aber auch nicht helfen den langen Pfad von ''hierarchy'' aus beginnend anzugeben. Um einen mehrdeutigen Pfad weiter zu differenzieren, kann man explizit ein Element aus einer Menge wählen, indem man den numerischen Index in eckigen Klammern dahinter schreibt. Der Pfad aus dem obigen Beispiel lässt sich damit so anpassen, dass er eindeutig auf den ''Button'' mit der Markierung "''Aus''" weist:<br />
<br />
<blockquote>//android.widget.Button[1].</blockquote><br />
<br />
Ihnen fällt sicher auf, dass der Index eine 1 ist obwohl das zweite Element gemeint ist. Das kommt daher, dass die Zählung bei 0 beginnt. Der Button mit der Markierung "An" hat also die Nummer 0 und der ''Button'' mit der Markierung "''Aus''" hat die Nummer 1.<br />
<br />
Dieser Ansatz, einen expliziten Index zu verwenden, hat zwei Nachteile: Zum einen lässt sich an dem Pfad nur schwer ablesen welches Element gemeint ist, zum andern ist der Pfad sehr empfindlich schon gegenüber kleinsten Änderungen, wie zum Beispiel dem Vertauschen der beiden ''Button''-Elemente oder dem Einfügen eines weiteren ''Button''-Elements in der App.<br />
<br />
Es wäre daher wünschenswert, das gemeinte Element über eine ihm charakteristische Eigenschaft wie einen Attributwert, zu adressieren. Für Android-Apps eignet sich hierfür häufig das Attribut "''resource-id''". Im Idealfall muss bei der Entwicklung der App darauf geachtet werden, dass jedes Element eine eindeutige Id erhält. Die ''resource-id'' hat den großen Vorteil, dass sie unabhängig vom Text des Elements oder der Spracheinstellung des Geräts ist. Für iOS-Apps kann entsprechend das Attribut "''name''" verwendet werden, wenn es von der App sinnvoll gesetzt wird. Der XPath-Standard erlaubt solche Auswahlbedingungen zu einem Element anzugeben. Angenommen, der ''Button'' mit der Markierung "''Aus''" hat die Eigenschaft ''resource-id'' mit dem Wert ''off'' und der ''Button'' mit der Markierung "''An''" hat als ''resource-id'' den Wert ''on'', dann kann man als eindeutigen Pfad für den "Aus"-''Button''<br />
<br />
<blockquote>//android.widget.Button[@resource-id='off']</blockquote><br />
<br />
formulieren. Wie an dem Beispiel zu sehen werden solche Bedingungen wie ein Index in eckigen Klammern an den Elementtyp angehängt. Der Name eines Attributes wird mit einem "@" eingeleitet und der Wert mit einem "=" in Anführungszeichen angehängt. Ist der Attributwert global eindeutig, kann man den vorausgehenden Pfad sogar durch den globalen Platzhalter * ersetzen, der auf jedes Element passt. Das obige Beispiel mit dem GTIN-13-''Button'' war ein solcher Fall.<br />
<br />
[[Datei:MobileTestingBaum2.png | frame | Abb. 3: Elementbaum einer fiktiven App mit Erweiterungen]]<br />
<br />
Abb. 3 zeigt eine Erweiterung des Beispiels aus Abb. 2. Die App hat nun ein weiteres, nahezu identisches ''LinearLayout'' bekommen. Die ''Buttons'' sind in ihren Attributen jeweils ununterscheidbar. Deshalb funktioniert der vorige Ansatz nicht, einen eindeutigen Pfad nur mithilfe eines Attributwerts zu formulieren. Offensichtlich unterscheiden sich aber ihre benachbarten ''TextViews''. Es ist möglich die jeweilige ''TextView'' in den Pfad mit aufzunehmen, um einen ''Button'' dennoch eindeutig zu adressieren. Ein Pfad zum ''Button'' mit der Markierung "''An''" unterhalb der ''TextView'' mit der Markierung "''Druckschalter''" kann dabei wie folgt aussehen:<br />
<br />
<blockquote>//android.widget.TextView[@resource-id='push']/../android.widget.Button[@resource-id='on']</blockquote><br />
<br />
Der erste Teil beschreibt den Pfad zu der ''TextView'' mit der Markierung "''Druckschalter''" und der ''resource-id'' mit dem Wert ''push''. Danach folgt ein Schrägstrich gefolgt von zwei Punkten. Die zwei Punkte sind eine spezielle Elementbezeichnung, die nicht ein Kindelement benennt, sondern zum Elternelement wechselt, in diesem Fall also das ''LinearLayout'', in dem die ''TextView'' eingebettet ist. Im Kontext dieses ''LinearLayout'' ist der restliche Pfad, nämlich der ''Button'' mit der ''resource-id'' mit dem Wert ''on'', eindeutig.<br />
<br />
Der XPath-Standard bietet noch sehr viel mehr Ausdrucksmittel. Mit der hier knapp vorgestellten Auswahl ist es aber bereits möglich für die meisten praktischen Testfälle gute Pfade zu formulieren. Eine vollständige Einführung in XPath ginge über den Umfang dieser Einführung weit hinaus. Sie finden zahlreiche weiterführende Dokumentationen im Web und in Büchern.<br />
<br />
Eine universelle Strategie zum Erstellen guter XPaths gibt es nicht, da sie von den Testanforderungen abhängt. In der Regel ist es sinnvoll, den XPath kurz und dennoch eindeutig zu halten. Häufig lassen sich Elemente über Eigenschaften identifizieren wie beispielsweise ihren Text. Will man aber gerade den Text eines Elements auslesen, kann dieser natürlich nicht im Pfad verwendet werden, da er vorher nicht bekannt ist. Ebenso wird der Text variieren, wenn die App mit verschiedenen Sprachen gestartet wird.<br />
<br />
Jeder Baustein, der auf einem Element arbeitet, hat einen Eingangspin für den XPath. Im GUI-Browser finden Sie in der Mitte oben eine Liste von Bausteinen mit Aktionen, die Sie auf das ausgewählte Element anwenden können. Suchen Sie den Baustein ''Click'' (8) im Ordner Elements und wählen Sie ihn aus (Abb. 1). Er wird im rechten Teil unter "''Test''" eingefügt, der Pin für den XPath ist mit dem automatisch generierten Pfad des Elements vorbelegt (9). Sie können den Baustein hier auch ausführen. Die Ansicht wechselt dann auf "''Lauf''". Ändert sich durch die Aktion der Zustand Ihrer App, müssen Sie den Baum anschließend aktualisieren (10).<br />
<br />
Wenn Sie in der unteren Liste eine Eigenschaft auswählen, wechselt die Anzeige der Bausteine zu "''Eigenschaften''", wo Sie die eigenschaftsbezogenen Bausteine finden. Wie bei den Aktionen können Sie auch hier einen Baustein auswählen, der dann rechts in Test mit dem Pfad des Elements und der ausgewählten Eigenschaft eingetragen wird, sodass Sie ihn direkt ausführen können.<br />
<br />
== Weitere Locator-Strategien ==<br />
Appium bietet neben XPath noch weitere Strategien zur Adressierung von Elementen an. Einige davon stehen Ihnen '''ab Version 20.1''' ebenfalls mit expecco zur Verfügung. Diese sind nicht ganz so mächtig wie XPath, dafür aber häufig schneller bei der Auflösung auf dem Gerät. Insbesondere bei der Verwendung mit iPhones, wo die Hierarchie bei jeder XPath-Auflösung erst aufgebaut werden muss, bieten alternative Strategien einen Vorteil für die Laufzeit.<br />
<br />
XPath ist weiterhin der Standard, das heißt alle Locator ohne besondere Angabe werden als XPath interpretiert. Um eine der anderen Strategien zu verwenden, schreiben Sie diese mit einem Gleichzeichen vor den gewünschten Locator. Diese Technik können Sie sowohl an den Blöcken verwenden, als auch im GUI-Browser testen.<br />
<br />
{|<br />
|-<br />
| style="vertical-align:top" | AccessibilityId || style="padding-bottom:0.5em" | Verwendet den Wert des Elements, der dazu dient, die App barrierefrei zu machen. Für iOS ist das das Attribut '''Accessibility-id''', für Android das Attribut '''content-descr'''. ''Beispiel: accessibilityId=Löschen''<br />
|-<br />
| style="vertical-align:top" | className || style="padding-bottom:0.5em" | Verwendet den Namen der Klasse des Elements. ''Beispiel: className=android.widget.FrameLayout''<br />
|-<br />
| style="vertical-align:top" | id || style="padding-bottom:0.5em" | Verwendet die Kennung des Elements. Für iOS ist das das Attribut '''name''', für Android das Attribut '''resource-id'''. ''Beispiel: id=android:id/text1''<br />
|-<br />
| style="vertical-align:top" | iOSClassChain<sup>1</sup> || style="padding-bottom:0.5em" | Verwendet die Hierarchie der Elemente ähnlich wie bei XPath. Eine Erklärung zum Aufbau finden Sie [https://github.com/facebookarchive/WebDriverAgent/wiki/Class-Chain-Queries-Construction-Rules hier]. ''Beispiel: iOSClassChain=XCUIElementTypeWindow/XCUIElementTypeButton[`label == "Ok"`]''<br />
|-<br />
| style="vertical-align:top; padding-right:1em" | iOSNsPredicateString<sup>1</sup> || style="padding-bottom:0.5em" | Verwendet einfache Kriterien, wie Attribute, die auch kombiniert werden können. ''Beispiel: iOSNsPredicateString=type == 'XCUIElementTypeButton' AND name == 'Weiter'''<br />
|-<br />
| style="vertical-align:top" | name<sup>1</sup> || style="padding-bottom:0.5em" | Verwendet den Namen des Elements. ''Beispiel: name=Bestätigen''<br />
|-<br />
|}<br />
<br />
:<sup>1</sup> ''nur für iOS''<br />
<br />
Um eine direkte Beschleunigung mit iOS zu erzielen, ohne dass Sie Ihre bisherigen Pfade anpassen müssen, wandelt expecco zudem Pfade, die nur aus einem Element mit Klasse und name-Attribut bestehen, zur Laufzeit automatisch in einen entsprechenden Locator der Strategie iOSNsPredicateString um. Wenn Sie einen Pfad explizit als XPath markieren, wird diese Anpassung nicht vorgenommen.<br />
<br />
=<span id="troubleshooting"><!-- Referenced by error dialog on connection error --></span>Probleme und Lösungen=<br />
==Locator sind Versionsabhängig oder variabel ==<br />
Dann sollten Sie die Locator (xPath) entweder in einer Variablen<br />
halten oder ein Locator-Mapping in einem Screenplay Anhang definieren. Es ist auch möglich, lediglich Teile des Locators (z.B. Lochtor-Pfad eines Elternelements oder Attributwert) in einer Variable zu halten und im Freezevalue des Locator-Pins mit "$(varName)"einzufügen.<br />
==Unsichtbare UI-Elemente==<br />
Beachten Sie, dass im [[#Recorder|Recorder]] auch Elemente berücksichtigt werden, die Sie auf dem Bildschirm nicht sehen. Schalten Sie daher das Element-Highlighting an oder nutzen Sie die Follow-Mouse-Funktion und den Elementbaum im GUI-Browser, um festzustellen, ob das richtige Element verwendet wird.<br />
==iOS: Kabel nicht zertifiziert==<br />
In manchen Fällen erscheint beim Verbinden eines iOS-Geräts über USB der Hinweis, das verwendete Kabel sei nicht zertifiziert. In diesem Fall hilft es nur, das entsprechende Kabel auszutauschen.<br />
==iOS: Alerts beim Verbinsungsaufbau==<br />
Stellen Sie sicher, dass beim Verbindungsaufbau mit einem iOS-Gerät keine Alerts geöffnet sind. Der Aufbau schlägt sonst fehl, da die App nicht in den Vordergrund kommen kann. Siehe auch [[#iOS-Ger.C3.A4t_und_App_vorbereiten|iOS-Gerät und App vorbereiten]].<br />
==iOS: .ipa installieren nicht möglich==<br />
Beachten Sie, dass auf iOS-Simulatoren keine ''.ipa''-Dateien sondern nur ''.app''-Dateien installiert werden können.<br />
==Android: Gerät nicht im Verbindungsdialog==<br />
Wenn ein über USB angeschlossenes Android-Gerät nicht im Verbindungsdialog auftaucht, versuchen Sie, den USB-Verbindungstyp zu ändern. In der Regel sollten MTP oder PTP funktionieren. Prüfen Sie nochmal, ob "USB Debugging" in den Entwicklereinstellungen des Geräts aktiviert ist (diese Einstellungen sind bei manchen Geräten zunächst unsichtbar, und müssen durch einen Trick zugänglich gemacht werden). Siehe auch [[#Android-Ger.C3.A4t_vorbereiten|Android-Gerät vorbereiten]].<br />
<br />
==Android: Softkeys==<br />
Bei Android-Geräten, die Softkeys automatisch ein- und ausblenden, kann es vorkommen, dass der Recorder im unteren Bereich Elemente abschneidet, die durch die Softkeys verdeckt würden, auch wenn sie zu diesem Zeitpunkt gar nicht angezeigt werden. In diesem Fall hift es, die Softkeys so einzustellen, dass sie permanent angezeigt werden.<br />
<br />
==Keine Aktion bei Klick==<br />
Der Baustein zum Klicken auf ein Element ist erfolgreich, aber auf dem Gerät wurde keine Aktion ausgeführt.<br />
:Dies kann vorkommen, wenn das Element von einem anderen Element verdeckt ist und ein Klick auf das Element deshalb nicht möglich ist. In diesem Fall wird von Appium kein Fehler geworfen, sondern es passiert einfach nichts. Wenn Sie dennoch einen Klick an der Position des Elements machen möchten, auch wenn es verdeckt ist, benutzen Sie stattdessen den Baustein ''Tap'' und übergeben Sie diesem die Position des Elements (''Get Location''). Wenn Sie stattdessen vor einem Klick prüfen möchten, ob das Element zu diesem Zeitpunkt verdeckt ist, versuchen Sie, ob Ihnen die Eigenschaften ''Is Displayed'' oder ''Is Enabled'' weiterhelfen.<br />
<br />
==Kein Update nach Aktion==<br />
Über den Recorder wurde eine Aktion ausgeführt, für die auch ein Baustein aufgezeichnet wurde, der Recorder zeigt aber immer noch das alte Bild.<br />
:Der Recorder zeigt kein Livebild des Geräts, sondern immer nur eine Momentaufnahme. Nachdem eine Aktion ausgeführt wurde, aktualisiert sich der Recorder automatisch. Es kann aber vorkommen, dass das Bild schon aktualisiert wurde, bevor die Auswirkungen der Aktion auf dem Gerät vollständig abgeschlossen sind. In diesem Fall sollten Sie den Recorder von Hand aktualisieren über das Symbol mit den blauen Pfeilen, siehe Beschreibung zum [[#Recorder|Recorder]].<br />
<br />
=="clickable" Attribut falsch==<br />
Ein Element hat im "''clickable''" Attribut/Property den Wert "''false''", ist aber dennoch anklickbar.<br />
:Das "''clickable''" Attribute muss explizit vom App-Programmierer gesetzt werden, und hat tatsächlich keine Relevanz für das tatsächliche Verhalten der App. Sie sollten dieses Attribut i.A. in Ihren Tests nicht beachten.<br>Leider existieren viele Apps, bei denen der Programmierer hier "lazy" war.<br />
<br />
==Verbindungsaufbau schlägt fehl==<br />
Schlägt der Verbindungsaufbau mit dem Appium-Server fehl, erhalten Sie in expecco eine Fehlermeldung ähnlicher der unten abgebildeten.<br />
<br />
[[Datei:MobileTestingVerbindungsfehler.png]]<br />
<br />
Hier sehen Sie die Art des aufgetretenen Fehlers. Klicken Sie auf "''Details''" um nähere Informationen zu erhalten. Mögliche Fehler sind:<br />
*''org.openqa.selenium.remote.UnreachableBrowserException''<br />
:Der angegebene Server läuft nicht oder ist nicht erreichbar. Überprüfen Sie die Serveradresse.<br />
*''org.openqa.selenium.WebDriverException''<br />
:Lesen Sie in den Details in der ersten Zeile die Meldung hinter ''Original Error'':<br />
:*''Unknown device or simulator UDID''<br />
::Entweder ist das Gerät nicht richtig angeschlossen oder die udid stimmt nicht.<br />
:*''Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65''<br />
::Dieser Fehler kann verschiedene Ursachen haben. Entweder konnte tatsächlich der WebDriverAgent nicht gebaut werden, weil die Signierungseinstellungen falsch sind oder das passende Provisioning Profile fehlt. Lesen Sie dazu den Abschnitt zur [[#Signierung|Signierung]]. Es kann auch sein, dass der WebDriverAgent auf dem Gerät nicht gestartet werden kann, weil sich beispielsweise ein Alert im Vordergrund befindet oder Sie dem Entwickler nicht vertraut haben.<br />
:*''Could not install app: 'Command 'ios-deploy [...] exited with code 253'''<br />
::Die angegebene App kann nicht auf dem iOS-Gerät installiert werden, weil es nicht im Provisioning Profile der App eingetragen ist.<br />
:*''Bad app: [...] App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name.'''<br />
::Der Pfad zur App ist falsch. Stellen Sie sicher, dass sich die Datei unter dem angegebenen Pfad auf dem Mac befindet.<br />
:*''packageAndLaunchActivityFromManifest failed.''<br />
::Die angegebene ''apk''-Datei ist vermutlich kaputt.<br />
:*''Could not find app apk at [...]''<br />
::Der Pfad zur App ist falsch. Stellen Sie sicher, dass sich die ''apk''-Datei am angegebenen Pfad befindet.<br />
<br />
<br />
Falls der Fehler nicht durch eine der oben gelisteten Ursachen bedingt ist, kann es sein, dass die auf dem Gerät befindlichen Automation-Anwendungen nicht mehr richtig funktionieren. Hier hilft es, diese vom Mobilgerät zu deinstallieren. Beim nächsten Verbindungsaufbau werden sie dann automatisch neu installiert.<br />
<br />
*Für iOS-Geräte ist das der WebDriverAgent, den Sie einfach vom Home-Screen deinstallieren können. Dies behebt in der Regel Probleme durch den Wechsel des verwendeten Macs oder der Xcode-Version.<br />
<br />
*Für Android-Geräte ist es der UIAutomator2; hier tritt auf einigen Geräten sporadisch ein Problem auf, die Ursache dafür ist uns z.Z. noch nicht bekannt. Zur Deinstallation navigieren Sie auf dem Gerät zu "''Einstellungen''" > "''Anwendungen''"<sup>*</sup> und suchen in der Liste nach folgenden Einträgen:<br />
Appium Settings<br />
io.appium.uiautomator2.server<br />
io.appium.uiautomator2.server.test<br />
:Klicken Sie auf die jeweilige Anwendung und dann auf "''Deinstallieren''".<br />
<sup>*</sup>''Der entsprechende Eintrag heißt auf manchen Geräten möglicherweise etwas anders.''<br />
<br />
<br />
Falls dies nicht hilft, kann eventuell die Ausgabe des Appium-Servers weiterhelfen. Für einen von expecco gestarteten Server finden Sie das Log in der Liste der [[#Laufende_Appium-Server|laufenden Appium-Server]].<br />
<br />
==Ich habe keinen Mac==<br />
Vielleicht hilft Ihnen diese Webseite weiter: [https://www.howtogeek.com/289594/how-to-install-macos-sierra-in-virtualbox-on-windows-10 https://www.howtogeek.com/289594/how-to-install-macos-sierra-in-virtualbox-on-windows-10]</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Mobile_Testing_Plugin&diff=24500Mobile Testing Plugin2021-10-28T14:34:41Z<p>Mb: /* Hybrid-Apps und WebViews */</p>
<hr />
<div>= Einleitung =<br />
Mit dem ''Mobile Testing Plugin'' können Anwendungen auf Android- und iOS-Geräten getestet werden. Dabei ist es egal, ob reale mobile Endgeräte oder emulierte Geräte verwendet werden. Das Plugin kann (und wird üblicherweise) zusammen mit dem [[Expecco_GUI_Tests_Extension_Reference|GUI-Browser]] verwendet werden, der das Erstellen von Tests unterstützt. Zudem ist damit das Aufzeichnen von Testabläufen möglich.<br />
<br />
Zur Verbindung mit den Geräten wird [http://appium.io/ Appium] verwendet. Appium ist ein freies Open-Source-Framework zum Testen und Automatisieren von mobilen Anwendungen.<br />
<br />
Zur Einarbeitung in das Mobile Plugin empfehlen wir das [[#Tutorial|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.<br />
<br />
= Installation und Aufbau =<br />
Zur Verwendung des Mobile Testing Plugins müssen Sie expecco inkl. des Plugins Mobile Testing installiert haben und Sie benötigen die entsprechenden Lizenzen. expecco kommuniziert mit den Mobilgeräten über einen Appium-Server, der entweder auf demselben Rechner wie expecco läuft, oder auf einem zweiten Rechner. Dieser muss für expecco erreichbar sein.<br />
<br />
==Installationsübersicht==<br />
<br />
'''Rechner, auf dem expecco läuft:'''<br />
* Java JDK Version 8, 9, 10, 11 oder neuer <sup>1)</sup><br />
'''Rechner, an dem Android-Geräte angeschlossen sind:'''<br />
* Appium-Server'', diesen können Sie über das Mobile Testing Supplement installieren (s.u.), von dem wir regelmäßig einen neue Version zur Verfügung stellen''<br />
* Android SDK'', dieses erhalten Sie ebenfalls mit dem Mobile Testing Supplement''<br />
* Java JDK Version 8, 9, 10, 11 oder neuer <sup>1)</sup><br />
'''Rechner, an dem iOS-Geräte angeschlossen sind<sup>2)</sup>:'''<br />
* Appium-Server'', diesen können Sie über das Mobile Testing Supplement für Mac OS installieren (s.u.), von dem wir regelmäßig einen neue Version zur Verfügung stellen''<br />
* Xcode ''in einer Version, die die verwendete iOS-Version unterstützt, erhältlich über den Apple App Store''<br />
* Java JDK Version 8, 9, 10, 11 oder neuer <sup>1)</sup><br />
* Apple-Entwickler-Zertifikat mit zugehörigem privaten Schlüssel ''(zum Signieren des WebDriverAgents)''<br />
* Provisioning Profile mit den verwendeten Mobilgeräten<br />
<br />
<br />
Je nach Aufbau können die oben genannten Rechner auch das selbe Gerät sein. expecco kann sich sowohl über das Netzwerk mit einem entfernten Appium-Server und dort angeschlossenen Mobilgeräten verbinden, als auch lokal selbst einen Appium-Server starten und diesen mit lokalen Mobilgeräten verwenden. Einige Funktionen von expecco, die die Erstellung von Testfällen erleichtern, sind jedoch nur verfügbar, wenn die Mobilgeräte am selben Rechner angeschlossen sind, auf dem auch expecco läuft. Ein möglich Aufbau kann daher wie in folgender Abbildung aussehen:<br />
<br />
[[Datei:MobileTestingAufbau.png | 400px]]<br />
<br />
Im Folgenden wird die Installation von Appium und anderer nötiger Programme für Windows und Mac OS erklärt.<br />
<br />
<sup>1)</sup>: Zum Zeitpunkt der Erstellung dieses Dokuments wurden Versionen bis 11 auf Funktion verifiziert. Neuere Versionen sollten - sofern nicht grundlegende Änderungen von Oracle vorgenommen wurden, ebenfalls funktionieren.<br />
<br />
<sup>2)</sup>: Beachten Sie, dass aufgrund der Voraussetzungen (keine Anbindung an nicht-Apple Geräte verfügbar) iOS-Geräte nur von einem Mac aus angesteuert werden können. Sie benötigen also einen Mac als "Vermittler" (siehe auch unten: [[#Ich habe keinen Mac | "Ich habe keinen Mac"]])<br />
<br />
== Windows ==<br />
Am einfachsten installieren Sie alles mit unserem Mobile Testing Supplement <sup>1</sup>. In neueren Versionen ist allerdings aufgrund geänderter Lizenzbedingungen seitens Oracle kein JDK mehr enthalten, sodass sie dieses zusätzlich instalieren müssen.<br />
*'''expecco 20.1''': [https://download.exept.de/transfer/h-expecco-20.1.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.10.1.0]<br />
:Nur kleine Änderungen im Vergleich zur vorigen Version.<br />
*expecco 19.2: [http://download.exept.de/transfer/h-expecco-19.2.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.10.0.0]<br />
:Im Vergleich zur vorigen Version wurde Appium auf die Version 1.16.0-rc.1 aktualisiert und node 12 verwendet. <br />
*expecco 19.1: [http://download.exept.de/transfer/h-expecco-19.1.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.8.1.0]<br />
:Dieses installiert Appium in der Version 1.12.0 und enthält nun zusätzlich build-tools der Version 28.0.3 im android-sdk. Ansonsten ist es gleich wie die vorige Version.<br />
*expecco 18.2: [http://download.exept.de/transfer/h-expecco-18.2.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.7.3.0]<br />
:Dieses installiert Appium in der Version 1.8.1. Außerdem bietet das Supplement auch an, ''Android Debug Bridge'' und ''Google USB Driver'' ([https://gsmusbdrivers.com/download/adb-fastboot-drivers/ adb-setup-1.4.3]) zu installieren. Damit sind Treiber für ein breites Spektrum an Android-Geräten abgedeckt, sodass Sie nicht für jedes Gerät einen eigenen Treiber suchen und installieren müssen. Ein '''JDK ist (aufgrund geänderter Lizenzbedingungen seitens Oracle) nicht mehr enthalten''', dieses müssen Sie selbst herunterladen, z.B. von [https://www.oracle.com/technetwork/java/javase/downloads/index.html Oracle].<br />
*expecco 18.1: wie expecco 2.11<br />
*expecco 2.11: [http://download.exept.de/transfer/h-expecco-2.11.1/MobileTestingSupplement_1.6.0.2_Setup.exe Mobile Testing Supplement 1.6.0.2]<br />
:Dieses installiert ein Java JDK der Version 8, android-sdk und Appium in der Version 1.6.4. Außerdem bietet das Supplement auch einen universellen adb-Treiber ([http://download.clockworkmod.com/test/UniversalAdbDriverSetup.msi ClockworkMod]) an. Dieser vereint Treiber für ein breites Spektrum an Android-Geräten, sodass Sie nicht für jedes Gerät einen eigenen Treiber suchen und installieren müssen.<br />
*expecco 2.10: [http://download.exept.de/transfer/h-expecco-2.10.0/Mobile_Testing_Supplement_1.5.0.0_Setup.exe Mobile Testing Supplement 1.5.0.0]<br />
:Dieses installiert ein Java JDK der Version 8, android-sdk und Appium in der Version 1.4.16. Während der Installation wird die grafische Oberfläche von Appium gestartet, dieses Fenster können Sie sofort wieder schließen. Außerdem bietet das Supplement auch einen universellen adb-Treiber ([http://download.clockworkmod.com/test/UniversalAdbDriverSetup.msi ClockworkMod]) an. Dieser vereint Treiber für ein breites Spektrum an Android-Geräten, sodass Sie nicht für jedes Gerät einen eigenen Treiber suchen und installieren müssen.<br />
<br />
Wenn expecco Mobilgeräte verwenden soll, die an einem anderen Rechner angeschlossen sind, müssen Sie dort einen Appium-Server starten. Dies können Sie mit der Datei <code>appium_standalone.cmd</code> tun. Der Server wird dann mit dem Standard-Port 4723 gestartet. Falls Sie eine andere Portnummer verwenden wollen, starten Sie den Server mit<br />
<br />
appium_standalone.cmd -p <portnummer><br />
<br />
Der Server ist bereit, sobald die Zeile<br />
<blockquote>Appium REST http interface listener started on 0.0.0.0:4723</blockquote><br />
angezeigt wird, wobei Sie am Ende die verwendete Portnummer ablesen können.<br />
<br />
Beim ersten Starten von Appium – sowohl im Standalone als auch gestartet von expecco – kann es vorkommen, dass die Windows-Firewall den Node-Server blockiert. Lassen Sie den Zugriff zu, sonst kann Appium nicht gestartet werden.<br />
<br />
<sup>1</sup>) Sie können natürlich auch die Command Line Tools (adb, sdkmanager, avdmanager etc.) einer vorhandenen Android Studio Version verwenden, sowie Appium separat installieren.<br />
Da sich diese Tools regelmäßig ändern, und es in der Vergangenheit zu Inkompatibilitäten und Fehlern nach Releasewechseln kam, empfehlen wir zu Beginn, das mitgelieferte Paket zu verwenden. Dies ist möglicherweise nicht das aktuellste, wurde aber auf Lauffähigkeit getestet.<br />
<br />
Falls das Android Mobilgerät an einem entfernen Rechner angeschlossen ist,<br />
können Sie den aktuellen Bildschirminhalt z.B. mit dem [https://github.com/Genymobile/scrcpy scrcpy] tool live mitverfolgen.<br />
<br />
== Mac OS ==<br />
Hinweis: Wenn Sie nicht vorhaben, iOS-Geräte (iPhone, iPad, etc.) zu testen, können Sie das Folgende ignorieren. '''Der Apple-Rechner sowie das Mac-Setup werden für Android-Geräte nicht benötigt'''.<br />
<br />
=== Xcode ===<br />
Zur Automatisierung mit iOS-Geräten wird [https://developer.apple.com/xcode/ Xcode] benötigt. Sie erhalten dieses über den App Store. Dabei ist darauf zu achten, dass die Version zu den getesteten iOS-Versionen passt:<br />
{| class="wikitable"<br />
|-<br />
|'''iOS'''&nbsp;&nbsp; <br />
|'''Xcode'''<br />
|'''macOS'''<br />
|-<br />
|10.x<br />
|8.x<br />
|10.12 (Sierra)<br />
|-<br />
|11.x<br />
|9.x<br />
|10.13 (High Sierra)<br />
|-<br />
|12.x<br />
|10.x<br />
|10.14 (Mojave)<br />
|-<br />
|13.x<br />
|11.x<br />
|10.15 (Catalina)<br />
|}<br />
Ebenso müssen die Minor-Versionen passen, d.h. <br />
* für iOS 10.'''2''' mindestens Xcode 8.'''2''', <br />
* für iOS 10.'''3''' mindestens Xcode 8.'''3''', <br />
* usw. <br />
Wenn Sie also auf eine neuere iOS-Version wechseln, benötigen Sie in der Regel auch eine neuere Xcode-Version. Neuere Versionen von Xcode laufen möglicherweise nicht auf älteren Betriebssystemen, was wiederum eine Aktualisierung des Betriebssystems erforderlich machen kann. Falls Sie auch ältere iOS-Versionen testen wollen kann es sinnvoll sein, die entsprechenden Xcode-Versionen parallel zu installieren.<br />
<br />
Siehe auch [https://en.wikipedia.org/wiki/Xcode#Version_comparison_table Xcode-Versionen].<br />
<br />
=== Appium ===<br />
Appium können Sie über das Mobile Testing Supplement für Mac OS istallieren:<br />
* '''expecco 20.2''': [https://download.exept.de/transfer/h-expecco-20.2.0/Mobile_Testing_Supplement_for_Mac_OS.tar.bz2 Mobile Testing Supplement für Mac OS (1.2.2)]<br />
:Enthält Appium Version 1.18.3 und verwendet node 14.<br />
<br />
* expecco 20.1: [https://download.exept.de/transfer/h-expecco-20.1.0/Mobile_Testing_Supplement_for_Mac_OS.tar.bz2 Mobile Testing Supplement für Mac OS (1.2.0)]<br />
:Nur wenige Änderungen im Vergleich zur vorigen Version.<br />
<br />
* expecco 19.2: [http://download.exept.de/transfer/h-expecco-19.2.0/MobileTestingSupplement_for_MacOS.tar.bz2 Mobile Testing Supplement für Mac OS (1.1.98)]<br />
:Im Vergleich zur vorigen Version wurde Appium auf die Version 1.16.0-rc.1 aktualisiert und es wird node 12 verwendet. <br />
<br />
* expecco 19.1: [http://download.exept.de/transfer/h-expecco-19.1.0/Mobile_Testing_Supplement_for_Mac_OS_1.1.96.tar.bz2 Mobile Testing Supplement für Mac OS (1.1.96)]<br />
:Diese Version enthält Appium 1.12.0. <br />
<br />
* expecco 18.1: [http://download.exept.de/transfer/h-expecco-18.1.0/Mobile_Testing_Supplement_for_Mac_OS_1.1.94.tar.bz2 Mobile Testing Supplement für Mac OS (1.1.94)]<br />
:Diese Version enthält Appium 1.8.0.<br />
<br />
* expecco 2.11: [http://download.exept.de/transfer/h-expecco-2.11.1/Mobile_Testing_Supplement_for_Mac_OS_1.0.94.tar.bz2 Mobile Testing Supplement für Mac OS (1.0.94)]<br />
:Diese Version enthält Appium 1.6.4.<br />
<br />
* expecco 2.10: [http://download.exept.de/transfer/h-expecco-2.10.0/Mobile_Testing_Supplement_for_Mac_OS_1.0.tar.bz2 Mobile Testing Supplement für Mac OS]<br />
:Diese Version entält Appium 1.4.16.<br />
<br />
Nachdem Herunterladen des Supplements, können Sie es in ein Verzeichnis Ihrer Wahl (z. B. Ihr Home-Verzeichnis) verschieben und dort entpacken. Ein geeigneter Befehl in einer Shell könnte wie folgt aussehen, passen Sie dabei die Versionsnummer entsprechend an:<br />
<br />
tar -xvpf Mobile_Testing_Supplement_for_Mac_OS_1.1.98.tar.bz2<br />
<br />
Wenn Sie Ihre Standard-Xcode-Installation verwenden wollen, können Sie Appium direkt über die Datei im ''bin''-Verzeichnis mit der entsprechenden Versionsnummer starten:<br />
<br />
Mobile_Testing_Supplement/bin/start-appium-1.16.0-rc.1<br />
<br />
Falls Sie ein anderes Xcode als das als Standard konfigurierte verwenden wollen, müssen Sie Appium den entsprechenden Pfad über die Umgebungsvariable ''DEVELOPER_DIR'' angeben. <br />
Wenn Sie Xcode z. B. in ''/Applications/Xcode-11.3.app'' installiert haben, müssten Sie Appium so starten:<br />
<br />
DEVELOPER_DIR="/Applications/Xcode-11.3.app/Contents/Developer" Mobile_Testing_Supplement/bin/start-appium-1.16.0-rc.1<br />
<br />
Was als Standard-Xcode-Installation gesetzt ist, zeigt der Befehl:<br />
<br />
xcode-select -p<br />
<br />
Wenn Appium Ihre Xcode-Installation nicht findet, erscheint beim Verbinden eine Fehlermeldung in der Art:<br />
''<blockquote>org.openqa.selenium.SessionNotCreatedException - A new session could not be created. (Original error: Could not find path to Xcode, environment variable DEVELOPER_DIR set to: /Applications/Xcode.app but no Xcode found)</blockquote>''<br />
Starten Sie in diesem Fall Appium erneut, unter Angabe eines gültigen ''DEVELOPER_DIR''.<br />
<br />
=== Signierung ===<br />
Um eine Testverbindung mit einem Gerät aufbauen zu können, brauchen Sie einen Apple-Account. Zur Evaluierung können Sie einen kostenlosen Account verwenden. Dieser hat den Nachteil, dass erstellte Profile nur eine Woche gültig sind und danach neu erstellt werden müssen. Seien Sie auch vorsichtig, wenn Sie sich den Account teilen, da es vorkommen kann, dass Zertifikate widerrufen werden oder durch automatische Generierung ungültig werden. Als Folge können bereits signierte Apps nicht mehr verwendet werden.<br />
<br />
Schließen Sie zuerst das Gerät, das Sie verwenden möchten, über USB an den Mac an. Starten Sie Xcode und öffnen Sie ''Preferences''. Wechseln Sie zur Seite der Accounts und legen Sie einen Eintrag mit Ihrem Account an. Anschließend können Sie auf ''Manage Certificates...'' klicken, um die Zertifikate zu sehen, die zu diesem Account gehören. Zum Ausführen von Tests benötigen Sie ein iOS-Development-Zertifikat und den dazugehörigen privaten Schlüssel. Wenn Sie noch keines besitzen, erstellen Sie eines. Wenn Sie bereits eines haben, aber es nicht in Ihrem Schlüsselbund vorhanden ist (erkennbar an dem Hinweis "Not in Keychain"), können Sie es importieren. Öffnen Sie in jedem Fall die [https://support.apple.com/de-de/guide/keychain-access/welcome/mac Schlüsselbundverwaltung] auf dem Mac und wählen Sie den Schlüsselbund ''Anmeldung'' aus. Wenn im Schlüsselbund eines anderen Nutzers bereits ein entsprechendes Zertifikat angelegt ist, können Sie dieses dort als PKCS#12-Datei (Endung typischerweise .p12) exportieren. Um ein Zertifikat in Ihren Schlüsselbund zu importieren, wählen Sie im Menü ''Ablage'' die Option ''Objekte importieren''. Falls Sie nicht wissen, wo das Zertifikat gespeichert ist, können Sie es in Xcode auch widerrufen und in Ihrem Schlüsselbund neu anlegen. Machen Sie das jedoch nur, wenn Sie wissen, dass das alte Zertifikat nicht mehr in Verwendung ist, da es danach nicht mehr benutzt werden kann. Nun sollte der Schlüsselbund ein iOS-Development-Zertifikat enthalten. Wählen Sie im Rechtsklick-Menü den Punkt ''Informationen'' aus. Unter den Details des Zertifikats finden Sie die Team-ID, die hier als Organisationseinheit bezeichnet wird. Tragen Sie diese in den Einstellungen des Plugins im Feld ''Team-ID'' ein, siehe [[#Konfiguration_des_Plugins|Konfiguration des Plugins]].<br />
<br />
Kehren Sie zu Xcode zurück und wählen Sie im Menü ''File'' den Eintrag ''Open...'', um das WebDriverAgent-Projekt zu öffnen. Dieses befindet sich im Verzeichnis des Mobile Testing Supplements unter<br />
''<nowiki>Mobile_Testing_Supplement/lib/node_modules/appium-1.16.0-rc.1/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj</nowiki>''<br />
<br />
[[Datei:MobileTestingWebDriverAgentXcode.png]]<br />
<br />
Wählen Sie ''WebDriverAgentLib'' und die Seite ''Signing & Capabilities'' aus. Setzen Sie dort im Abschnitt ''Signing'' die Option ''Automatically manage signing'' und wählen Sie dann ein Team aus. Wechseln Sie nun zu ''WebDriverAgentRunner'' und tun Sie dort dasselbe.<br />
<!--(Das Folgende scheint nicht mehr aktuell zu sein.) Es sollten an dieser Stelle Fehler angezeigt werden, dass kein Provisioning Profile angelegt oder gefunden wurde. Wechseln Sie deshalb zur Seite ''Build Settings'' und suchen Sie hier im Abschnitt ''Packaging'' den Eintrag ''Product Bundle Identifier''. Ändern Sie diesen von com.facebook.WebDriverAgentRunner zu etwas, das von Xcode akzeptiert wird, indem Sie den Präfix ändern. Xcode kann nun ein passendes Provisioning Profile generieren und die Fehler auf der General-Seite sollten verschwinden. Danach können Sie Xcode beenden. --><br />
Durch das Setzen des Teams sollten die Fehler für den WebDriverAgentRunner verschwinden. Danach können Sie Xcode beenden.<br />
<br />
Wenn Sie sich nun von expecco eine Verbindung zu Ihrem Gerät aufbauen, wird der WebDriverAgent darauf installiert und gestartet, um anschließend zur zu testenden App zu wechseln. Auf dem Gerät muss jedoch noch der Ausführung des WebDriverAgents vertraut werden. Öffnen Sie dazu während des Verbindungsaufbaus auf dem Gerät in die Einstellungen und dort unter ''Allgemein'' den Eintrag ''Geräteverwaltung''. Dieser Eintrag ist nur sichtbar, wenn eine Entwickler-App auf dem Gerät installiert ist. Sie müssen daher möglicherweise warten, bis der WebDriverAgent installiert ist, bevor der Eintrag erscheint. Wählen Sie dort den Eintrag Ihres Apple-Accounts und vertrauen Sie ihm. Da der WebDriverAgent wieder deinstalliert wird, wenn der Start nicht funktioniert hat, müssen Sie dies während des Verbindungsaufbaus tun. Falls Ihnen das zu hektisch ist, können Sie auch folgenden Code ausführen:<br />
<br />
''<nowiki>xcodebuild -project Mobile_Testing_Supplement/lib/node_modules/appium-1.16.0-rc.1/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=<udid>' test</nowiki>''<br />
<br />
Damit wird der WebDriverAgent auf dem Gerät installiert ohne dass er wieder gelöscht wird. In der [https://support.apple.com/en-us/HT204460 Dokumentation von Apple] finden Sie nähere Informationen zum Installieren und Vertrauen solcher Apps.<br />
<br />
== Konfiguration des Plugins ==<br />
Bevor Sie loslegen, sollten Sie die Einstellungen des Mobile Testing Plugins überprüfen und ggf. anpassen.<br />
<br />
Öffnen Sie im Menü den Punkt "''Extras''" &#8594; "''Einstellungen''" und dort unter "''Erweiterungen''" den Eintrag "''Mobile Testing''" (s. Abb.). Standardmäßig werden diese Pfade automatisch gefunden (1). Um einen Pfad manuell anzupassen, deaktivieren Sie den entsprechenden Haken rechts davon. Sie erhalten in einer Drop-down-Liste einige Pfade zur Auswahl. Ist ein eingetragener Pfad falsch oder kann er nicht gefunden werden, wird das Feld rot markiert und es erscheint ein diesbezüglicher Hinweis. Stellen Sie sicher, dass alle Pfade richtig angegeben sind.<br />
<br />
[[Datei:MobileTestingEinstellungen.png | thumb | 400px | Konfiguration des Plugins]]<br />
<br />
*'''appium''': Geben Sie hier den Pfad zur ausführbaren Datei an mit der Appium in der Kommandozeile gestartet werden kann. Unter Windows wird diese Datei in der Regel "<code>appium.cmd</code>" heißen. Dieser Pfad wird benutzt, wenn expecco einen Appium-Server startet.<br />
*'''node''': Geben Sie hier den Pfad zur ausführbaren Datei an, die Node (auch "Node.js") startet. Dieser Pfad wird beim Starten eines Servers an Appium weitergegeben, damit Appium ihn unabhängig von der PATH-Variablen findet. Unter Windows heißt diese Datei in der Regel "<code>node.exe</code>".<br />
*'''JAVA_HOME''': Geben Sie hier den Pfad zu einem JDK an. Dieser Pfad wird an jeden Appium-Server weitergegeben. Lassen Sie das Feld frei, um den Wert aus der Umgebungsvariablen zu verwenden. Um einzustellen, welches Java von expecco verwendet werden soll, setzen Sie diesen Pfad in den Einstellungen für die Java Bridge.<br />
*'''ANDROID_HOME''': Geben Sie hier den Pfad zu einem SDK von Android an. Dieser Pfad wird an jeden Appium-Server weitergegeben. Lassen Sie das Feld frei, um den Wert aus der Umgebungsvariablen zu verwenden.<br />
*'''adb''': Hier steht der Pfad zum adb-Befehl. Unter Windows heißt die Datei adb.exe. Diese wird von expecco beispielsweise verwendet, um die Liste der angeschlossenen Geräte zu erhalten. Diesen Pfad sollten Sie automatisch wählen lassen, da dann der Befehl im ANDROID_HOME-Verzeichnis verwendet wird. Dieser wird auch von Appium verwendet. Falls expecco und Appium jedoch verschiedene Versionen von adb verwenden kann es zu Konflikten kommen.<br />
*'''android.bat''': Diese Datei wird nur benötigt, um damit den AVD und den SDK Manager zu starten. Automatisch wird hier die Datei im ANDROID_HOME-Verzeichnis gesucht.<br />
*'''aapt''': Geben Sie hier den Pfad zum aapt-Befehl an. Unter Windows heißt diese Datei ''aapt.exe''. expecco verwendet aapt nur im Verbindungseditor, um das Paket und die Activities einer apk-Datei zu lesen. Automatisch wird hier die Datei im ANDROID_HOME-Verzeichnis gesucht.<br />
<br />
[[Datei:MobileTestingJavaBridgeEinstellungen.png | thumb | 400px | Konfiguration des JDKs]]<br />
<br />
Ab expecco 2.11 gibt es das Feld ''Team-ID''. Wenn Sie iOS-Tests ausführen, tragen Sie hier die Team-ID Ihres Zertifikats ein. Diese wird für jede iOS-Verbindung verwendet, außer Sie setzen den Wert im Einzelfall in den Verbindungseinstellungen um. Wie Sie die Team-ID erhalten, lesen Sie im Abschnitt zur [[#Signierung|Signierung]] ber der Installation auf Mac OS. Mit expecco 2.10 können Sie die Team-ID nur für jede Verbindungseinstellung extra als Capability eintragen. Dazu müssen Sie jedoch die [[#Erweiterte_Ansicht|erweiterte Ansicht]] verwenden. Geben Sie hier die Capability ''xcodeOrgId'' an und setzen Sie als Wert die Team-ID des Zertifikats.<br />
<br />
Die Einstellung zur Serveradresse unten auf der Seite bezieht sich auf das Verhalten des Verbindungseditors. Dieser prüft am Ende, ob die Serveradresse auf ''/wd/hub'' endet, da dies die übliche Form ist. Falls nicht, wird in einem Dialog gefragt, wie darauf reagiert werden soll. Das festgelegte Verhalten kann hier eingesehen und verändert werden.<br />
<br />
Wechseln Sie ebenfalls zum Eintrag ''Java Bridge'' (s. Abb.). Hier muss der Pfad zu Ihrer Java-Installation angegeben werden, die von expecco benutzt wird. Tragen Sie hier ein JDK ein. Falls Sie unter Windows das aus dem Mobile Testing Supplement verwenden möchten, lautet der Pfad<br />
<nowiki>C:\Program Files (x86)\exept\Mobile Testing Supplement\jdk</nowiki><br />
Sie können auch die Systemeinstellungen verwenden.<br />
<br />
== Android-Gerät vorbereiten ==<br />
Wenn Sie ein Android-Gerät unter Windows anschließen benötigen Sie möglicherweise noch einen adb-Treiber für das Gerät. Einen passenden Treiber finden Sie üblicherweise auf der jeweiligen Webseite des Herstellers. Haben Sie den Universal-Treiber aus dem Mobile Testing Supplement installiert, sollte für die meisten Geräte bereits alles funktionieren. In einigen Fällen versucht auch Windows automatisch einen Treiber zu installieren, wenn Sie das Gerät zum ersten mal anschließen.<br />
<br><br />
===USB-Debugging Einschalten===<br />
'''Achtung:'''<br />
Bevor Sie ein Mobilgerät mit dem Appium-Plugin ansteuern können, müssen Sie für dieses Debugging erlauben!<br />
<br />
Für Android-Geräte finden Sie diese Option in den Einstellungen unter ''[https://www.droidwiki.org/wiki/Entwickleroptionen Entwickleroptionen]'' mit dem Namen ''[https://www.droidwiki.org/USB-Debugging USB-Debugging]''. Falls die Entwickleroptionen nicht angezeigt werden, können Sie diese freischalten, indem Sie unter "''Über das Telefon''" siebenmal auf "''Build-Nummer''" tippen.<br />
<br />
===Wach bleiben Aktivieren===<br />
Aktivieren Sie auch die Funktion ''Wach bleiben'', damit das Gerät nicht während der Testerstellung oder -ausführung den Bildschirm abschaltet.<br />
<br />
Aus Sicherheitsgründen muss USB-Debugging für jeden Computer einzeln zugelassen werden. Beim Verbinden des Geräts mit dem PC über USB müssen Sie dabei am Gerät der Verbindung zustimmen. Falls Sie dies für Ihren Computer noch nicht getan haben, aber auf dem Gerät kein entsprechender Dialog erscheint, kann es helfen, das Gerät aus- und wieder einzustecken. Das kann insbesondere dann passieren, wenn Sie den ADB-Treiber installiert haben während das Gerät bereits über USB angeschlossen war. Falls auch das nicht hilft, öffnen Sie die Benachrichtigungen, indem Sie sie vom oberen Bildschirmrand herunter ziehen. Dort finden Sie die USB-Verbindung und Sie können die Optionen dazu öffnen. Wählen Sie einen anderen Verbindungstypen aus; in der Regel sollten MTP oder PTP funktionieren.<br />
<br />
Sie können auch auf einem Emulator testen. Dieser muss nicht gesondert vorbereitet werden, da er bereits für USB-Debugging ausgelegt ist. Es ist sogar möglich, einen Emulator bei Testbeginn zu starten.<br />
<br />
Um zu überprüfen, ob ein Gerät, das Sie an Ihren Rechner angeschlossen haben, verwendet werden kann, öffnen Sie den [[#Verbindungseditor|Verbindungseditor]]. Das Gerät sollte dort angezeigt werden.<br />
<br />
=== Verbindung über WLAN ===<br />
Es ist auch möglich, Android-Geräte über WLAN zu verbinden. Dazu müssen Sie zunächst das Gerät über USB mit dem Rechner verbinden. Öffnen Sie dann die Eingabeaufforderung und geben Sie dir eint:<br />
<nowiki>adb tcpip 5555</nowiki><br />
Damit lauscht das Gerät auf eine TCP/IP-Verbindung an Port 5555. Sollten Sie mehrere Geräte angeschlossen oder Emulatoren laufen haben, müssen Sie genauer angeben, welches Gerät Sie meinen. Geben Sie in diesem Fall ein:<br />
<nowiki>adb devices -l</nowiki><br />
Sie erhalten eine Liste aller Geräte, wobei die erste Spalte deren Kennung ist. Schreiben Sie dann stattdessen<br />
<nowiki>adb -s <Gerätekennung> tcpip 5555</nowiki><br />
mit der Gerätekennung des gewünschten Geräts. Sie können die USB-Verbindung nun trennen. Jetzt müssen Sie die IP-Adresse Ihres Gerätes in Erfahrung bringen. Sie finden diese üblicherweise irgendwo in den Einstellungen des Geräts, beispielsweise beim Status oder in den WLAN-Einstellungen. Geben Sie dann ein:<br />
<nowiki>adb connect <IP-Adresse des Geräts></nowiki><br />
Damit sollte das Gerät nun über WLAN verbunden sein und kann genauso verwendet werden, wie mit USB-Verbindung. Sie können dies überprüfen, indem Sie wieder <tt>adb devices -l</tt> eingeben oder in expecco den Verbindungsdialog öffnen. In der Liste taucht das Gerät mit seiner IP-Adresse und dem Port auf. Bedenken Sie, dass die WLAN-Verbindung nicht mehr besteht, wenn der ADB-Server oder das Gerät neu gestartet werden.<br />
<br />
=== Verbindung zu einem Emulator ===<br />
Sie benötigen dazu den Emulator selbst, sowie mindestens ein AVD (Android Virtual Device). Hinweise zu Installation finden Sie in der [https://developer.android.com/studio/run/emulator Android Studio Dokumentation].<br />
<br />
Wenn Sie Android Studio bereits mit den Defaulteinstellungen installiert haben <sup>1)</sup>, sollte der Emulator bereits mitinstalliert sein. Falls nicht, wählen Sie in Android Studio "''Configure''" - "''SDK Manager''" - "''Android SDK''" - "''SDK Tools''" - ''Android Emulator''", sowie dort die "''Platform Tools''".<br />
Alternativ geht das auch über die Kommandzeile mit dem "sdkmanager" Kommando.<br />
<br />
Als nächstes benötigen Sie mindestens ein AVD; auch dies geht am einfachsten über den Dialog in Android Studio:<br />
wählen sie "''Configure''" - "''AVD Manager''" und folgen den Anweisungen (Deviceauswahl, Platform und Android Version). <br />
<br />
Auch wenn Sie den Emulator automatisieren benötigen sie Appium; installieren Sie dieses entweder mit dem Mobile Testing Supplement, oder direkt von der Appium homepage (https://github.com/appium/appium-desktop/releases).<br />
<br />
<sup>1)</sup>Android Studio selbst wird nicht von expecco benötigt; es bietet aber kompfortable Dialoge zum Installieren von Paketen und AVDs.<br />
<br />
== iOS-Gerät und App vorbereiten ==<br />
Das Ansteuern von iOS-Geräten ist nur über einen Mac möglich. Lesen Sie daher auch den Abschnitt zur [[#Mac_OS|Installation unter Mac OS]].<br />
<br />
Bevor Sie ein Mobilgerät mit dem Mobile Testing Plugin ansteuern können, müssen Sie für iOS-Geräte ab iOS 8 Debugging erlauben. Aktivieren Sie dazu die Option ''Enable UI Automation'' unter dem Menüpunkt ''Entwickler'' in den Einstellungen des Geräts. Falls Sie den Eintrag ''Entwickler'' in den Einstellungen nicht finden, gehen Sie wie folgt vor: Schließen Sie das Gerät über USB an den Mac an. Dabei müssen Sie ggf. am Gerät noch der Verbindung zustimmen. Starten Sie Xcode und wählen Sie dann in der Menüleiste am oberen Bildschirmrand im Menü ''Window'' den Eintrag ''Devices''. Es öffnet sich ein Fenster, in dem eine Liste der angeschlossenen Geräte angezeigt wird. Wählen Sie dort Ihr Gerät aus. Danach sollte der Eintrag ''Entwickler'' in den Einstellungen auf dem Gerät auftauchen. Dazu müssen Sie möglicherweise die Einstellungen beenden und neu starten.<br />
<br />
[[Datei:Alert.png | thumb | 270px | Beispiel für einen Alert unter iOS]]<br />
Ein Verbindungsaufbau zu dem Gerät ist nicht möglich solange es bestimmte Alerts zeigt. Ein solcher Alert kann z.&#x202f;B. erscheinen wenn FaceTime aktiviert ist, indem ein Hinweis auf anfallende SMS-Gebühren angezeigt wird (siehe Screenshot). Achten Sie darauf, das Gerät so zu konfigurieren, dass es im Leerlauf keine solchen Alerts zeigt.<br />
<br />
=== expecco 2.11 und später ===<br />
Sie können beliebige Apps testen, die auf dem verwendeten Gerät lauffähig oder bereits installiert sind. Wenn die App als Development-Build vorliegt, muss die UDID des Geräts in der App hinterlegt sein. In jedem Fall muss der WebDriverAgent für das Gerät signiert werden. Lesen Sie dazu den Abschnitt zur [[#Signierung|Signierung]] unter Mac OS.<br />
<br />
Falls Sie in einem Test den Home-Button verwenden wollen, müssen Sie auf dem Gerät AssistiveTouch aktivieren. Sie finden diese Option in den Einstellungen unter ''Allgemein'' > ''Bedienungshilfen'' > ''AssistiveTouch''. Platzieren Sie dann das Menü in der Mitte des oberen Bildschirmrands. Sie können das Drücken des Home-Buttons dann mit dem entsprechenden Menüeintrag im Recorder aufzeichnen oder direkt den Baustein ''Press Home Button'' benutzen.<br />
<br />
=== expecco 2.10 ===<br />
Die App, die Sie verwenden wollen, muss als Development-Build vorliegen. Außerdem muss die UDID des Geräts in der App hinterlegt sein.<br />
<br />
=== Development-Build signieren ===<br />
Ein Development-Build einer App ist nur für eine begrenzte Zahl von Geräten zugelassen und kann auf anderen Geräten nicht gestartet werden. Es ist aber möglich, das Zertifikat und die verwendbaren Geräte in einem Development-Build auszutauschen.<br />
<br />
* Evaluierung mit Demo-App von eXept:<br />
:Gerne stellen wir Ihnen eine Demo-App zur Verfügung, die als Development-Build vorliegt und die wir für Ihr Gerät signieren können. Senden Sie dazu bitte Ihrem eXept-Ansprechpartner die UDID Ihres Gerätes zu. Wie Sie die UDID Ihres Gerätes ermitteln können, ist im folgenden Abschnitt beschrieben.<br />
<br />
* Eigene App für Ihr Testgerät verwenden:<br />
:Wenn Sie von den App-Entwicklern einen Development-Build (IPA-Datei) erhalten, der für Ihr Testgerät zugelassen ist, können Sie diesen direkt verwenden. Dazu müssen Sie den Entwicklern die UDID Ihres Geräts mitteilen, damit sie diese eintragen können. '''Sie können die UDID eines Gerätes mithilfe von Xcode auslesen'''. Starten Sie dazu Xcode und wählen Sie in der Menüleiste am oberen Bildschirmrand im Menü ''Window'' den Eintrag ''Devices''. Es öffnet sich ein Fenster, in dem eine Liste der angeschlossenen Geräte angezeigt wird. Wählen Sie Ihr Gerät aus und suchen Sie in Eigenschaften den Eintrag ''Identifier''. Die UDID ist eine 40-stellige Hexadezimalzahl.<br />
<br />
* Extern entwickelte App für Ihr Testgerät umsignieren:<br />
:Es können auch Apps umsigniert werden, damit Sie auf anderen Geräten lauffähig sind. Dieser Vorgang ist jedoch kompliziert und setzt insbesondere einen Zugang zu einem Apple-Developer-Account voraus. Eine Dokumentation zur Vorgehensweise ist derzeit in Vorbereitung.<br />
<br />
:Für die Evaluierung unterstützen wir Sie gerne beim Umsignieren Ihrer App.<br />
<!--<br />
Melden Sie sich beim [https://developer.apple.com/ Apple-Webinterface] an. Navigieren Sie zu ''Certificates, IDs & Profiles''. Erzeugen Sie hier ggf. ein Developer-Zertifikat und ein Provisioning Profile für Ihr Gerät und laden Sie beide herunter. Sollten Sie noch keinen Developer Account haben, erstellen Sie hier einen: https://developer.apple.com/enroll/. Hierzu müssen Sie sich mit einer Apple-ID anmelden.<br />
<br />
# Team-ID herausfinden (''Membership'' -> ''Team ID'')<br />
# Unter ''Certificates, IDs & Profiles'' Development-Zertifikat auswählen (unter ''+'' anlegen, falls nicht vorhanden) und herunterladen.<br />
# Unter ''App ID'' Wildcard-App-ID erzeugen, falls nicht vorhanden. App-ID notieren (AppID = Prefix.ID)<br />
# Gerät hinzufügen, dazu UDID (bzw. ''Identifier'') des Geräts herausfinden (''Xcode'' -> ''Window'' (oben in Menüleiste) -> ''Devices'')<br />
# Provisionen Profile erstellen: ''iOS App Development'' -> ''AppID'' auswählen -> Zertifikat wählen -> Gerät auswählen -> Profilname anlegen -> Provisioning Profile herunterladen.<br />
# Das heruntergeladene Zertifikat importieren (''Downloads'' -> Zertifikat (.cer)<br />
# SHA1-Fingerabdruck kopieren. Dazu Rechtsklick auf Zertifikat -> ''Information'', anschließend bis zum Ende der Seite scrollen).<br />
# Entitlements.plist erstellen (''Terminal' öffnen -> Downloads/Mobile_Testing_Supplement/bin/gen-entitlements_plist 'Team-ID' 'App ID' Downloads/Mobile_Testing_Supplement/bin/re-sign-ipa <Pfad zum ipa (z.B. Downloads/expeccoMobileDemo.ipa)> \<br />
"<Zertifikat (SHA1-Fingerabdruck, z.B. 76 E8 4B E8 78 D5 D7 F9 2E 09 8B D7 E8 FB CE 30 0C F5 D0 EF)>" \<br />
<Pfad zum Provisionen Profile (z.B. /Users/exept_test/Downloads/dut.mobileprovision)> \<br />
<Pfad für das Ergebnis-ipa (z.B. Downloads/expeccoMobileDemo_re-signed.ipa)> \<br />
[Pfad zur entitlements.plist] (z.B. /Users/exept_test/entitlements.plist)<br />
<br />
Zum Umsignieren können Sie das entsprechende Skript aus dem Mobile Testing Supplement für Mac OS oder jedes beliebige andere Tool (z.B. isign) verwenden.<br />
--><br />
<br />
Weitere Informationen zur Verwendung von iOS-Geräten finden Sie auch in der [http://appium.io/slate/en/master/?java#appium-on-real-ios-devices Dokumentation von Appium].<br />
<br />
=== Native iOS-Apps ===<br />
Sie können auch Apps verwenden, die bereits nativ auf dem Gerät vorhanden sind. Dazu müssen Sie deren Bundle-ID kennen und diese dann in die Verbindungseinstellungen eintragen. Hier eine kleine Auswahl gängiger Apps:<br />
{| style="text-align:left"<br />
! App<br />
!<br />
! Bundle-ID<br />
|-<br />
| App Store<br />
| <br />
| com.apple.AppStore<br />
|-<br />
| Calculator<br />
| <br />
| com.apple.calculator<br />
|-<br />
| Calendar<br />
| <br />
| com.apple.mobilecal<br />
|-<br />
| Camera<br />
| <br />
| com.apple.camera<br />
|-<br />
| Contacts<br />
| <br />
| com.apple.MobileAddressBook<br />
|-<br />
| iTunes Store<br />
| <br />
| com.apple.MobileStore<br />
|-<br />
| Mail<br />
| <br />
| com.apple.mobilemail<br />
|-<br />
| Maps<br />
| <br />
| com.apple.Maps<br />
|-<br />
| Messages<br />
| <br />
| com.apple.MobileSMS<br />
|-<br />
| Phone<br />
| <br />
| com.apple.mobilephone<br />
|-<br />
| Photos<br />
| <br />
| com.apple.mobileslideshow<br />
|-<br />
| Settings<br />
| <br />
| com.apple.Preferences<br />
|}<br />
<br />
Weitere Bundle-IDs finden Sie [https://github.com/joeblau/apple-bundle-identifiers hier].<br />
<br />
= Beispiele =<br />
Bei den Demo-Testsuiten für expecco finden Sie auch Beispiele für Tests mit dem Mobile Testing Plugin. Wählen Sie dazu auf dem Startbildschirm die Option "''Beispiel aus Datei''" und öffnen Sie den Ordner "''mobile''".<br />
<br />
==<span id="TestsuiteMobileTestingDemo"><!-- Referenced by m01_MobileTestingDemo.ets --></span> ''m01_MobileTestingDemo.ets'' ==<br />
Die Testsuite enthält zwei einfache Testpläne: "''Simple CalculatorTest''" und "''Complex Calculator and Messaging Test''". Beide Tests verwenden einen Android-Emulator, den Sie vor Beginn starten müssen. Die Apps, die im Test verwendet werden, gehören zur Grundausstattung des Emulators und müssen daher nicht mehr installiert werden. Da sich die Apps unter jeder Android-Version unterscheiden können, ist es wichtig, dass Ihr Emulator unter Android 6.0 läuft. Außerdem muss die Sprache auf Englisch gestellt sein.<br />
<br />
; Simple CalculatorTest<br />
: Dieser Test verbindet sich mit dem Taschenrechner und gibt die Formel ''2+3'' ein. Das Ergebnis des Rechners wird mit dem erwarteten Wert ''5'' verglichen.<br />
<br />
; Complex Calculator and Messaging Test<br />
: Dieser Test verbindet sich mit dem Taschenrechner und öffnet anschließend den Nachrichtendienst. Dort wartet er auf eine einkommende Nachricht von der Nummer ''15555215556'', in der eine zu berechnende Formel gesendet wird. Die Nachricht wird zuvor über einen Socket beim Emulator erzeugt. Nach dem Eintreffen der Nachricht wird diese vom Test geöffnet und deren Inhalt gelesen. Danach wird wieder der Taschenrechner geöffnet, die erhaltene Formel eingegeben und das Ergebnis gelesen. Anschließend wechselt der Test wieder zum Nachrichtendienst und sendet das Ergebnis als Antwort.<br />
<br />
== ''m02_expeccoMobileDemo.ets'' und ''m03_expeccoMobileDemoIOS.ets'' ==<br />
Diese sind Bestandteil des Tutorials zum Mobile Testing Plugin. Der jeweils enthaltene Testfall ist unvollständig und wird im Zuge des Tutorials ergänzt. Lesen Sie dazu den Abschnitt [[#Tutorial|Tutorial]].<br />
<br />
= Tutorial =<br />
Dieses Tutorial beschreibt das grundsätzliche Vorgehen zur Erstellung von Tests mit dem Mobile Testing Plugin. Grundlage dafür ist ein mitgeliefertes Beispiel, bestehend aus einer einfachen App und einer expecco-Testsuite.<br />
<br />
Die App ''expecco Mobile Demo'' berechnet und überprüft verschiedene alltägliche Codes: die IBAN aus dem europäischen Zahlungsverkehr, die internationalen GTIN-13-Produktcodes, wie man sie bei Strichcodes im Einzelhandel findet, und die Seriennummern auf Euro-Banknoten.<br />
<br />
Die Testsuite enthält Testfälle für einzelne Funktionen der App. Dabei sind noch nicht alle Funktionen abgedeckt, sondern werden im Laufe des Tutorials ergänzt.<br />
<br />
Es gibt zwei Versionen dieses Tutorials:<br />
*'''[[#Erste_Schritte_mit_Android|Erste Schritte mit Android]]'''<br />
*'''[[#Erste_Schritte_mit_iOS|Erste Schritte mit iOS]]'''<br />
<br />
Das Vorgehen ist in beiden Versionen nahezu identisch, lediglich die Verbindungskonfigurationen werden unterschiedlich erzeugt. Die fertigen Tests unterscheiden sich dann im Wesentlichen in den Pfaden zur Adressierung der benutzten Elemente, da diese technologieabhängig sind.<br />
<br />
==<span id="FirstStepsAndroid"><!-- Referenced by m02_expeccoMobileDemo.ets --></span> Erste Schritte mit Android ==<br />
Es wird vorausgesetzt, dass Sie das Kapitel [[#Installation_und_Aufbau|Installation und Aufbau]] bereits gelesen und die nötigen Vorbereitungen für die Verwendung von Android-Geräten unter Windows abgeschlossen haben.<br />
<br />
=== Schritt 1: Demo ausführen ===<br />
Starten Sie expecco und öffnen Sie die Testsuite "''m02_expeccoMobileDemo.ets''" über die Schaltfläche "''Beispiel aus Datei''" (Abb. 1). Ab expecco 2.11 befindet sich diese im Unterordner "''mobile''". In dieser Testsuite befindet sich bereits ein vorgefertigter Testplan mit einigen Testfällen für diese App.<br />
<br />
[[Datei:MobileTestingBeispielÖffnen.png | frame | left | Abb. 1: Beispiel-Testsuite öffnen]]<br />
<br clear="all"><br />
In der Testsuite ist das Paket der Demo-App als Anhang enthalten ("''expeccoMobileDemo-debug.apk''"). Mithilfe des bereitgestellten Bausteins "''Export Demo App''" können Sie die Datei an einen beliebigen Ort auf Ihrem Rechner exportieren. Wählen Sie dazu den Baustein aus (1) und klicken Sie auf den grünen Play-Knopf (2) um den Baustein auszuführen (Abb. 2). Der Baustein öffnet einen Dateidialog, in dem Sie angeben, wo das Paket gespeichert werden soll.<br />
<br />
[[Datei:MobileTestingExportApp.png | frame | left | Abb. 2: App exportieren]]<br />
<br clear="all"><br />
Bevor wir uns mit dem weiteren Inhalt der Testsuite beschäftigen, konfigurieren Sie zuerst die Verbindung und welches Gerät Sie benutzen wollen. Schließen Sie dazu ein Gerät über USB an Ihren Rechner an oder starten Sie einen Emulator.<br />
<br />
[[Datei:MobileTestingVerbinden.png | frame | left | Abb. 3: Verbindungseditor öffnen]]<br />
<br clear="all"><br />
Öffnen Sie nun den GUI-Browser (1) und wählen Sie unter "''Verbinden''" (2) den Eintrag "''Mobile Testing''" (3) (Abb. 3), um den Verbindungsdialog zu öffnen.<br />
<br />
Sie sehen eine Liste aller angeschlossenen Android-Geräte (1) (Abb. 3). Sollte Ihr Gerät nicht in der Liste auftauchen, stellen Sie sicher, dass es eingeschaltet und über USB verbunden ist. Lesen Sie ansonsten den Abschnitt [[#Android-Ger.C3.A4t_vorbereiten|Android-Gerät vorbereiten]]<br />
<br />
[[Datei:MobileTestingGerätAuswählen.png | frame | left | Abb. 4: Gerät im Verbindungsdialog auswählen]]<br />
<br clear="all"><br />
Haben Sie Ihr Gerät in der Liste gefunden, wählen Sie es aus und klicken Sie auf "''Weiter''" (2).<br />
<br />
Als nächstes geben Sie an, welche App Sie verwenden wollen (Abb. 5). Dabei können Sie wählen, ob Sie eine App starten möchten, die bereits auf dem Gerät installiert ist ("''App auf dem Gerät''") oder ob eine App installiert und gestartet werden soll ("''App installieren''"). Für den Fall, dass Sie eine bereits installierte App benutzen wollen, erhalten Sie eine Liste aller auf dem Gerät installierten Pakete (1), die in Systempakete und Fremdpakete (2) unterteilt sind, sowie deren Activities (3). Diese können Sie dann einfach in den jeweiligen Feldern auswählen.<br />
<br />
[[Datei:MobileTestingAppAuswählen.png | frame | left | Abb. 5: Auf dem Gerät installierte App angeben]]<br />
<br clear="all"><br />
Für dieses Tutorial soll die App installiert werden, die Sie eben aus der Testsuite exportiert haben. Wählen Sie also "''App installieren''" aus und tragen Sie bei App (1) den entsprechenden Pfad ein (Abb. 6). Sie können den Knopf links benutzen (2), um einen Dateidialog zu öffnen, mit dem Sie zu der Datei navigieren können, um sie einzugeben. Das Paket (3) und die Activity (4) der App werden automatisch eingetragen. Sollte die App mehrere Activities besitzen, können Sie die gewünschte auswählen. Klicken Sie nun auf "''Weiter''" (5).<br />
<br />
[[Datei:MobileTestingAppInstallieren.png | frame | left | Abb. 6: App angeben, die auf dem Gerät installiert werden soll]]<br />
<br clear="all"><br />
Auf der letzten Seite sehen Sie eine Übersicht aller bisherigen Angaben (1) (Abb. 7). Darunter können Sie einen Namen für die Verbindung angeben, unter dem sie im GUI-Browser angezeigt wird (2). Außerdem lässt sich eine Verbindung über diesen Namen identifizieren und in Bausteinen verwenden; der Name muss daher eindeutig sein. Falls Sie keinen Namen angeben, wird generisch einer erzeugt. Geben Sie als Namen "''expeccoMobileDemo''" ein. Im Feld darunter ist die Adresse zum Appium-Server einzutragen (3). Appium ist die Schnittstelle, über die die angeschlossenen Geräte gesteuert werden. Für dieses Tutorial wird die Verwaltung der Instanzen des Appium-Servers von expecco übernommen. Tragen Sie dafür ist die lokale Standard-Adresse "''<nowiki>http://localhost:4723/wd/hub</nowiki>''" ein. Diese ist immer der unterste Eintrag der Vorschlagsliste. Außerdem ist die Option "''Bei Bedarf starten''" aktiviert (4). expecco überprüft dann, ob an der Adresse bereits ein Appium-Server läuft und startet und beendet ihn bei Bedarf automatisch. Wenn der Port ''4723'' bereits belegt ist oder wenn Sie einmal mehrere Verbindungen parallel betreiben wollen, verwenden Sie an dieser Stelle entsprechend einen anderen Port. Es ist dabei üblich die ungeraden Portnummern oberhalb von ''4723'' zu verwenden, also ''4725'', ''4727'' usw. Natürlich können Sie auch entfernte Server verwenden, das automatische Starten und Beenden eines Servers kann expecco aber nur lokal für Sie übernehmen.<br />
<br />
[[Datei:MobileTestingServerkonfiguration.png | frame | left | Abb. 7: Verbindungsnamen und Appium-Server konfigurieren]]<br />
<br clear="all"><br />
Klicken Sie nun auf "''Speichern''" (5) um die Einstellungen für die Testausführung zu speichern. Einstellungen können als Anhang einer Testsuite oder in eine externe Datei gespeichert werden (Abb. 8). Falls Sie mehrere Projekte gleichzeitig offen haben, können Sie in der Liste das Projekt auswählen, in dem der Anhang angelegt werden soll. Klicken Sie auf "''Speichern''" im Bereich "''Einstellungen im Anhang speichern''" und geben Sie als Name "''expeccoMobileDemo''" an. Klicken Sie nun auf ''Server starten und verbinden'' (6) um mit der angegebenen Konfiguration eine Verbindung herzustellen.<br />
<br />
[[Datei:MobileTestingEinstellungenSpeichern.png | frame | left | Abb. 8: Einstellungen speichern]]<br />
<br clear="all"><br />
Der Verbindungsaufbau kann eine Weile dauern. Warten Sie bis die Verbindung aufgebaut ist und im GUI-Browser angezeigt wird. Sie sehen, dass die App auf dem Gerät gestartet wird. Nun wissen Sie, dass die Konfiguration funktioniert. Die gespeicherten Einstellungen sollen nun für den Test verwendet werden, der dann die gleiche Verbindung aufbaut. Wählen Sie die Verbindung im GUI-Browser aus, machen Sie einen Rechtsklick und wählen Sie im Kontextmenü "''Verbindung abbauen''", damit es zu keinem Konflikt kommt. Wechseln Sie dann zurück zum Reiter der Testsuite.<br />
<br />
In der Testsuite wurden die Einstellungen als Anhang "''expeccoMobileDemo''" angelegt (Abb 9). Wählen Sie den Baustein ''Connect'' (1) aus und wechseln Sie rechts zur Ansicht "''Netzwerk''" (2). Ziehen Sie per Drag-and-drop die Einstellungen in das Netzwerk des Bausteins (3). Verbinden Sie den Ausgangspin ''pathName'' mit dem Eingangspin ''stringOrFilename[1]'' des Bausteins "''Connect from File''" (4). Mit "''Übernehmen''" (5) bestätigen Sie die Änderungen. Dieser Baustein wird zu Beginn des Tests die Verbindung zur App herstellen.<br />
<br />
[[Datei:MobileTestingConnectblock.png | frame | left | Abb. 9: Verbindungsbaustein editieren]]<br />
<br clear="all"><br />
Wechseln Sie nun zum Testplan "''Demo-Test''" (1) (Abb. 10). Dieser Testplan enthält bereits einige fertige Testfälle. Vor und nach der Ausführung (2) ist außerdem jeweils ein Baustein eingetragen: Der eben bearbeitete Baustein "''Connect''" für den Aufbau und der Baustein "''Disconnect''" für den Verbindungsabbau. Durch das Eintragen der beiden Bausteine an dieser Stelle geschieht der Verbindungsabbau insbesondere auch dann, wenn der Test vorzeitig abgebrochen wird, z. B. weil einer der Testfälle fehlschlägt.<br />
<br />
[[Datei:MobileTestingTestplan.png | frame | left | Abb. 10: Testplanausführung]]<br />
<br clear="all"><br />
Jetzt können Sie den Testplan "''Demo-Test''" starten, indem Sie auf den grünen Play-Knopf (3) klicken. Der Testplan sollte ohne Fehler durchlaufen.<br />
<br />
=== Schritt 2: Einen Baustein mit dem Recorder erstellen ===<br />
Mit Hilfe des integrierten Recorders lassen sich einfach Ausführungssequenzen aufnehmen und in einem AKtionsbaustein speichern. Dafür muss eine Verbindung zu einem Testgerät bestehen, mit dessen Hilfe der Test erstellt wird.<br />
<br />
Um eine Verbindung aufzubauen, wechseln Sie zurück zum GUI-Browser. In diesem ist noch die Verbindung eingetragen, die Sie zuvor angelegt haben. Da für die Verbindung im Testlauf derselbe Name verwendet wurde, wurden die Einstellungen damit überschrieben (In unserem Fall waren die Einstellungen ohnehin identisch). Die Verbindung ist zur Zeit nicht aktiv, da sie am Ende der Ausführung abgebaut wurde. Die Einstellungen sind dort aber noch eingetragen. Um die Verbindung mit dieser Konfiguration wieder aufzubauen, wählen Sie sie aus, gefolgt von einem Rechtsklick und ''Verbinden''.<br />
<br />
Warten Sie, bis die Verbindung aufgebaut ist (1) und drücken Sie dann den Aufnahme-Knopf (2), um eine Aufzeichnung zu starten (Abb. 11).<br />
<br />
[[Datei:MobileTestingRecorderStarten.png | frame | left | Abb. 11: Recorder starten]]<br />
<br clear="all"><br />
Es öffnet sich ein Fenster mit dem Mobile Testing Recorder (Abb. 12). Dieser zeigt einen Screenshot des verbundenen Geräts. Über diese Anzeige können Sie das Gerät fernsteuern. Dabei wird jede Aktion, die Sie ausführen, im Hintergrund aufgezeichnet.<br />
<br />
In der oberen Menüleiste können Sie das Werkzeug auswählen (1), mit dem Sie eine Aktion eingeben möchten. Als Voreinstellung ist das Werkzeug "''Auto''" ausgewählt. Sie können damit bestimmte Aktionen aufzeichnen, indem Sie mit dem Mauszeiger entsprechende Gesten auf der Anzeige ausführen. Wenn Sie zum Beispiel mit der linken Maustaste lange klicken, entspricht das einem langen Antippen des Elements an dieser Stelle. Anstatt die gewünschte Aktion mit der entsprechenden Geste zu bestimmen, können Sie diese alternativ auch manuell auswählen.<br />
<br />
Es soll nun ein neuer Test für das Erkennen korrekter GTIN-13-Codes aufgenommen werden. Klicken Sie zunächst in der Anzeige kurz auf den Button "''GTIN-13 (EAN-13)''" (2) der App um einen entsprechenden Klick auf dem Gerät auszulösen. Während der Ausführung dieser Aktion wird der Rahmen des Recorders kurzzeitig rot. Falls der Recorder danach nicht die aktuelle Ansicht der App darstellen sollte, klicken Sie im Recorder auf das Aktualisierungssymbol (3).<br />
<br />
[[Datei:MobileTestingRecorder1.png | frame | left | Abb. 12: Über Recorder zur GTIN-13-Activity wechseln]]<br />
<br clear="all"><br />
Anschließend soll im Eingabefeld der neuen Seite eine korrekte GTIN-13 eingegeben werden. Führen Sie dazu einen Rechtsklick auf dem Eingabefeld (1) aus und wählen Sie im Kontextmenü die Aktion "''Text setzen''" (2) (Abb. 13). Geben Sie in den sich daraufhin öffnenden Dialog eine beliebige gültige Artikelnummer im GTIN-13-Format ein, bspw. "''4006381333986''" (3). Dieser Text wird nun in der App gesetzt.<br />
<br />
[[Datei:MobileTestingRecorder2.png | frame | left | Abb. 13: GTIN-13-Code über Recorder eingeben]]<br />
<br clear="all"><br />
Klicken Sie nun auf "''Verify''" (1) (Abb. 14). In der App erscheint nun als Ergebnis "''OK''" (2). Der Test soll feststellen, ob tatsächlich dieses Ergebnis angezeigt wird. Nach einem Rechtsklick darauf können Sie im Kontextmenü die Aktion "''Attribut zusichern''" (3) auswählen. Wählen Sie im Dialog, der sich daraufhin öffnet, die Eigenschaft "''text''" (4) aus und bestätigen Sie mit "''OK''" (5). Dieses Mal wird keine Aktion auf dem Gerät ausgelöst, sondern nur ein Baustein aufgezeichnet, der fehlschlägt, sollte das Ergebnis vom erwarteten Wert "''OK''" abweichen.<br />
<br />
[[Datei:MobileTestingRecorder3.png | frame | left | Abb. 14: Antwort der App über Recorder auslesen]]<br />
<br clear="all"><br />
Schließen Sie nun den Recorder. Im ''Arbeitsbereich'' des GUI-Browsers sehen Sie, dass für jede der aufgenommenen Aktionen ein Baustein angelegt wurde (Abb. 15). Sie können nun testen, ob sich das Aufgenommene wieder abspielen lässt. Dazu müssen Sie zunächst die App auf Ihrem Gerät in den Anfangszustand zurückbringen, indem Sie auf dem Gerät die Schaltfläche "''HOME''" oben rechts benutzen. Klicken Sie dann in expecco auf den grünen Play-Knopf (1). Wird alles grün, war die Ausführung erfolgreich. Erstellen Sie nun daraus einen neuen Baustein in der Testsuite, indem Sie auf das Bausteinsymbol (2) in der rechten oberen Ecke klicken. Geben Sie ihm den Namen "''GTIN_Verify_OK''" (3) und bestätigen Sie (4).<br />
<br />
[[Datei:MobileTestingArbeitsbereich.png | frame | left | Abb. 15: Neuen Baustein aus Arbeitsbereich exportieren]]<br />
<br clear="all"><br />
Bauen Sie nun die Verbindung ab, indem Sie die Verbindung auswählen, rechtsklicken und im Kontextmenü "''Verbindung abbauen''" auswählen.<br />
<br />
Wechseln Sie zurück zum Reiter der Testsuite. Dort wurde der neue Baustein angelegt. Wählen Sie wieder den Testplan "''Demo-Test''" aus und fügen Sie den aufgenommenen Testfall "''GTIN_Verify_OK''" per Drag-and-drop am Ende des Testplans hinzu. Übernehmen Sie die Änderung und starten Sie erneut. Der Testplan sollte wieder ohne Fehler durchlaufen.<br />
<br />
=== Schritt 3: XPath anpassen mithilfe des GUI-Browsers ===<br />
Ihr neuer Baustein funktioniert auf anderen Geräten möglicherweise nicht. Die verwendeten Elemente werden über einen XPath adressiert und dieser kann auf anderen Geräten nicht stimmen. Lesen Sie dazu den Abschnitt [[#XPath_anpassen_mithilfe_des_GUI-Browsers|XPath anpassen mithilfe des GUI-Browsers]]. Falls Ihnen ein weiteres Gerät zur Verfügung steht, können Sie nun versuchen, die Pfade in Ihren erstellten Bausteinen zu verallgemeinern. Sie können diesen Schritt aber auch überspringen.<br />
<br />
Wenn es Ihnen schwerfällt, verkürzte Pfade zu finden, orientieren Sie sich dabei an den Pfaden der bereits vorhandenen Bausteine. Starten Sie den Test erneut. Sollte der Test jetzt fehlschlagen, überprüfen Sie die Pfade noch einmal im GUI-Browser.<br />
Um den Test nun auf einem zweiten Gerät auszuführen, öffnen Sie im Menü "''Erweiterungen''" > "''Mobile Testing''" > "''Verbindungseinstellungen erstellen''". Sie erhalten einen Dialog ähnlich zum Verbindungsdialog. Allerdings können Sie hier nur Einstellungen erstellen und speichern aber keine Verbindung herstellen. Sie haben jedoch die Möglichkeit, einzelne Aspekte der Einstellungen zu speichern wie bspw. nur das Gerät. Wählen Sie das neue Gerät aus und klicken Sie länger auf das Symbol zum Speichern im Anhang bis sich das verzögerte Menü öffnet (Abb. 16). Wählen Sie hier "''Geräte-Einstellungen speichern''". Benennen Sie den Anhang am besten nach dem Gerät. Danach können Sie den Dialog wieder schließen.<br />
<br />
[[Datei:MobileTestingGerätSpeichern.png | frame | left | Abb. 16: Einstellungen für ein Gerät speichern]]<br />
<br clear="all"><br />
Wählen Sie den Baustein "''Connect''" aus und ziehen Sie die Einstellungen für das neue Gerät in dessen Netzwerk. Verbinden Sie nun dessen Ausgangspin ''pathName'' mit dem Eingangspin ''stringOrFilename[2]'' des Bausteins "''Connect from File''". Der Baustein Connect from File liest die Angaben an den Eingangspins von oben nach unten ein, mehrfache Eigenschaften werden dabei ersetzt. In diesem Fall werden also die Einstellungen zum verwendeten Gerät ersetzt, während die übrigen Einstellungen gleich bleiben. Wenn Sie die Pfade geschickt gewählt haben, wird der Test nun auch auf dem anderen Gerät erfolgreich ablaufen.<br />
<br />
=== Schritt 4: Noch einen Baustein erstellen ===<br />
Falls sich gleiche Abläufe im Test wiederholen, können Sie dafür bereits erstellte Bausteine wiederverwenden oder abwandeln. Der in Schritt 2 erstellte Baustein prüft die Erkennung korrekter GTIN-13-Codes. Es fehlt noch ein Test, der umgekehrt das Erkennen eines falschen GTIN-13-Codes prüft. Die Struktur der beiden Tests ist identisch, sie unterscheiden sich lediglich in ihren Parametern. Kopieren Sie daher den Baustein "''GTIN_Verify_OK''" und benennen Sie die Kopie in "''GTIN_Verify_NOT_OK''" um. Ändern Sie die Eingabe der GTIN-13 in einen falschen Code zum Beispiel durch Ändern der letzten Ziffer ("''4006381333987''") und setzen Sie den Überprüfungswert der Ausgabe auf "''NOT OK''" (Abb. 17).<br />
<br />
[[Datei:MobileTestingGTIN_Verify_NOT_OK.png | frame | left | Abb. 17: Baustein editieren]]<br />
<br clear="all"><br />
Fügen Sie diesen neuen Test ebenfalls zum Testplan Demo-Test hinzu und setzen Sie ihn ans Ende. Führen Sie den Testplan aus, aber vergessen Sie nicht, vorher die Verbindung im GUI-Browser abzubauen.<br />
<br />
Der neue Test wird fehlschlagen, weil Ihr aufgenommener Baustein nicht wieder zur Startseite der App zurückkehrt, die Tests aber jeweils von dort aus starten. In den anderen Bausteinen ist dies bereits berücksichtigt; sie führen abschließend immer den Baustein "''Back to main menu''" aus. Sie sehen das, indem Sie einen der anderen Bausteine, z. B. "''GTIN_Calculate''", auswählen und auf seine Schema-Ansicht wechseln. Dort steht der Baustein "''Back to main menu''" im Feld "''Nach Ausführung''" (Abb. 18). Wie beim entsprechenden Feld beim Testplan wird auch dieser Baustein immer am Ende ausgeführt, unabhängig davon, ob der Test erfolgreich verläuft oder abbricht. Ergänzen Sie diesen Eintrag nun in Ihren Bausteinen "''GTIN_Verify_OK''" und "''GTIN_Verify_NOT_OK''". Wählen Sie dazu den Baustein aus und ziehen Sie in der Schema-Ansicht den Baustein ''Back to main menu'' einfach auf das Eingabefeld "''Nach Ausführung''". Nun können Sie den Testplan starten und alle Tests sollten wieder problemlos ausgeführt werden.<br />
<br />
[[Datei:AppiumDemo Nach Ausführung.png | frame | left | Abb. 18: Nach-Ausführungs-Baustein setzen]]<br />
<br clear="all"><br />
<br />
=== Schritt 5: Test vervollständigen ===<br />
Für die Activity IBAN sind bereits alle Antwortmöglichkeiten der App mit Testfällen abgedeckt. In der GTIN-13-Activity werden ein korrekter und ein fehlerhafter Code getestet und eine Prüfziffer berechnet, das Verhalten der App bei Eingaben falscher Länge wird aber bisher nicht getestet (Bei Verify "''Input must be exactly 13 digits''" und "''…12 digits''". bei Calculate). Die Activity zum Prüfen der Seriennummern von Eurobanknoten wird noch gar nicht getestet. Wie bei der IBAN können hier drei Fälle auftreten: eine korrekte Seriennummer wurde eingegeben (Antwort: "''OK''"), eine falsche Seriennummer wurde eingegeben (Antwort: "''NOT OK''") oder die Angabe entspricht nicht dem Format (Antwort: "''A serial number consists of 12 characters with the first one or two being capital letters (A-Z).''"). Sie können die Testabdeckung jetzt noch erweitern, indem Sie entsprechende Testfälle erstellen. Die Bausteine dafür können Sie wie in Schritt 2 mit dem Recorder erstellen und die XPaths bei Bedarf verallgemeinern. Wenn Sie mit dem grundsätzlichen Umgang mit expecco vertraut sind, können Sie Bausteine natürlich auch ohne Recorder erstellen, indem Sie sie manuell aus vorhandenen Bausteinen der Bibliothek zusammensetzen. Sie können auch beide Vorgehensweisen nach Belieben kombinieren.<br />
<br />
Beachten Sie, dass die hier vorgestellten Testfälle jeweils nur einzelne Eingaben prüfen. Wenn Sie Testfälle für Ihre eigenen Apps schreiben, wollen Sie vermutlich engmaschiger testen, indem Sie noch weitere unterschiedliche Werte eingeben, die insbesondere auch Randfälle enthalten.<br />
<br />
==<span id="FirstStepsIOS"><!-- Referenced by m03_expeccoMobileDemoIOS.ets --></span> Erste Schritte mit iOS ==<br />
Es wird vorausgesetzt, dass Sie das Kapitel [[#Installation_und_Aufbau|Installation und Aufbau]] bereits gelesen und die nötigen Vorbereitungen für die Verwendung von iOS-Geräten unter Mac OS abgeschlossen haben. Schließen Sie das Gerät, das Sie verwenden wollen, an den Mac an. Laden Sie die iOS-Version der [http://download.exept.de/transfer/h-expecco-2.11.0-pre/expeccoMobileDemo.ipa expeccoMobileDemo-App] auf den Mac herunter. Da es sich bei der App um einen Debug-Build handelt, müssen Sie sie noch für Ihr Gerät signieren (siehe [[#iOS-Ger.C3.A4t_und_App_vorbereiten|iOS-Gerät und App vorbereiten]]). Starten Sie nun einen Appium-Server auf dem Mac.<br />
<br />
=== Schritt 1: Demo ausführen (iOS) ===<br />
Starten Sie expecco und öffnen Sie die Testsuite "''m03_expeccoMobileDemoIOS.ets''" über die Schaltfläche "''Beispiel aus Datei''" (Abb. 1). Ab expecco 2.11 befindet sich diese im Unterordner "''mobile''". Ansonsten laden Sie die Testsuite [http://download.exept.de/transfer/h-expecco-2.10.0/m03_expeccoMobileDemoIOS.ets m03_expeccoMobileDemoIOS.ets] auf den Rechner, auf dem sich Ihre expecco-Installation befindet, und öffnen diese. In dieser Testsuite befindet sich bereits ein vorgefertigter Testplan mit einigen Testfällen für diese App.<br />
<br />
[[Datei:MobileTestingIOSBeispielÖffnen.png | frame | left | Abb. 1: Beispiel-Testsuite öffnen]]<br />
<br clear="all"><br />
Bevor wir uns mit dem weiteren Inhalt der Testsuite beschäftigen, konfigurieren Sie zuerst die Verbindung und welches Gerät Sie benutzen wollen. Öffnen Sie nun den GUI-Browser (1) und wählen Sie unter "''Verbinden''" (2) den Eintrag "''Mobile Testing''" (3) (Abb. 2), um den Verbindungsdialog zu öffnen.<br />
[[Datei:MobileTestingVerbinden.png | frame | left | Abb. 2: Verbindungseditor öffnen]]<br />
<br clear="all"><br />
<br />
Hier können Sie ein iOS-Gerät nur von Hand eintragen. Wählen Sie dazu "''iOS-Gerät eingeben''" (Abb. 3). Den Namen und die iOS-Version des Geräts können Sie dessen Eigenschaften entnehmen. Um die Gerätekennung des Geräts zu erfahren, öffnen Sie auf dem Mac in Xcode das Fenster Devices (Command-Shift-2). Dort werden alle angeschlossenen Geräte sowie die zur Verfügung stehenden Simulatoren angezeigt. Hier sehen Sie auch die Gerätekennung (udid) Ihres Geräts und welche Apps installiert wurden. Nachdem Sie das Gerät im Verbindungseditor eingegeben haben, wählen Sie es in der Liste aus und klicken Sie dann auf Weiter.<br />
<br />
[[Datei:MobileTestingIOSGerät.png | frame | left | Abb. 3: Hinzufügen eines iOS-Geräts]]<br />
<br clear="all"><br />
<br />
Als nächstes geben Sie an, welche App Sie verwenden wollen. Dabei können Sie wählen, ob Sie eine App starten möchten, die bereits auf dem Gerät installiert ist ("''App auf dem Gerät''") oder ob eine App installiert und gestartet werden soll ("''App installieren''"). Für den Fall, dass Sie eine bereits installierte App benutzen wollen, müssen Sie deren Bundle-ID angeben. Diese erfahren Sie ebenfalls im Devices-Fenster von Xcode. Für die Demo-App lautet sie beispielsweise "''de.exept.expeccoMobileDemo''".<br />
<br />
Für dieses Tutorial soll die Demo-App erst installiert werden. Wählen Sie also "''App installieren''" aus und tragen Sie bei App den Pfad zu der Datei auf dem Mac ein (Abb. 4). Wenn Sie expecco 2.11 verwenden, können Sie auf dieser Seite auch die Team-ID angeben, die für iOS-Verbindungen angibt, welches Zertifiat verwendet werden soll. Falls Sie bereits in den [[#Konfiguration_des_Plugins|Plugin-Einstellungen]] eine ID angegeben haben, wird diese verwendet. Sie wird hier grau dargestellt, solange Sie keinen anderen Wert angeben. Klicken Sie nun auf "''Weiter''".<br />
<br />
[[Datei:MobileTestingIOSAppInstallieren.png | frame | left | Abb. 4: App angeben, die auf dem Gerät installiert werden soll]]<br />
<br clear="all"><br />
<br />
Auf der letzten Seite sehen Sie eine Übersicht aller bisherigen Angaben (1) (Abb. 5). Unterhalb der Capabilityliste können Sie einen Namen für die Verbindung angeben, unter dem sie im GUI-Browser angezeigt wird (2). Außerdem lässt sich eine Verbindung über diesen Namen identifizieren und in Bausteinen verwenden; der Name muss daher eindeutig sein. Falls Sie keinen Namen angeben, wird generisch einer erzeugt. Geben Sie als Namen "''expeccoMobileDemo''" ein. Im Feld darunter ist die Adresse zum Appium-Server einzutragen (3). Wenn Sie den Appium-Server mit Standardeinstellungen gestartet haben, müssen Sie dazu nur in der Standardadresse (unterster Eintrag der Vorschlagsliste) "''localhost''" durch die IP-Adresse des Macs ersetzen (im Bild "''172.23.1.49''"). Um sicher zu gehen, auf welchem Port der Appium-Server lauscht, sehen Sie in dessen Ausgabe. Dort finden am Anfang die Zeile<br />
<nowiki>info: Appium REST http interface listener started on 0.0.0.0:4723</nowiki><br />
Steht hier am Ende nicht der Standardport ''4723'' ändern Sie diese Angabe entsprechend ebenfalls in der Konfiguration.<br />
<br />
Wenn die Option "''Bei Bedarf starten''" (4) aktiviert ist, überprüft expecco, ob an der Adresse bereits ein Appium-Server läuft, und startet und beendet ihn bei Bedarf automatisch. Das ist allerdings nur für lokale Serveradressen möglich, schalten Sie diese Option daher ab.<br />
<br />
[[Datei:MobileTestingServerkonfigurationIOS.png | frame | left | Abb. 5: Verbindungsnamen und Appium-Server konfigurieren]]<br />
<br clear="all"><br />
<br />
Klicken Sie nun auf "''Speichern''" (5) um die Einstellungen für die Testausführung zu speichern. Einstellungen können als Anhang einer Testsuite oder in eine externe Datei gespeichert werden (Abb. 6). Falls Sie mehrere Projekte gleichzeitig offen haben, können Sie in der Liste das Projekt auswählen, in dem der Anhang angelegt werden soll. Klicken Sie auf "''Speichern''" im Bereich "''Einstellungen im Anhang speichern''" und geben Sie als Name "''expeccoMobileDemo''" an. Klicken Sie nun auf "''Verbinden''" (6) um mit der angegebenen Konfiguration eine Verbindung herzustellen.<br />
<br />
[[Datei:MobileTestingEinstellungenSpeichern.png | frame | left | Abb. 6: Einstellungen speichern]]<br />
<br clear="all"><br />
<br />
Der Verbindungsaufbau kann eine Weile dauern. Wenn Sie die Server-Adresse korrekt angegeben haben, sollten Sie in der Ausgabe des Appium-Servers den Verbindungsversuch erkennen. Auf Ihrem iOS-Gerät sollte dabei die App gestartet werden. Passiert nichts auf dem Gerät, kann es daran liegen, dass entweder das Gerät oder die App nicht gefunden wird. Versucht Appium hingegen, die App zu starten und dies schlägt fehl, ist wahrscheinlich die App falsch signiert. Deinstallieren Sie in diesem Fall die App, damit sie mit einer neuen Signatur wieder installiert werden kann.<br />
<br />
Warten Sie bis die Verbindung aufgebaut ist und im GUI-Browser angezeigt wird. Nun wissen Sie, dass die Konfiguration funktioniert. Die gespeicherten Einstellungen sollen nun für den Test verwendet werden, der dann die gleiche Verbindung aufbaut. Wählen Sie die Verbindung im GUI-Browser aus, machen Sie einen Rechtsklick und wählen Sie im Kontextmenü "''Verbindung abbauen''", damit es zu keinem Konflikt kommt. Wechseln Sie dann zurück zum Reiter der Testsuite.<br />
<br />
In der Testsuite wurden die Einstellungen als Anhang "''expeccoMobileDemo''" angelegt (Abb 7). Wählen Sie den Baustein ''Connect'' (1) aus und wechseln Sie rechts zur Ansicht "''Netzwerk''" (2). Ziehen Sie per Drag-and-drop die Einstellungen in das Netzwerk des Bausteins (3). Verbinden Sie den Ausgangspin ''pathName'' mit dem Eingangspin ''stringOrFilename[1]'' des Bausteins "''Connect from File''" (4). Mit "''Übernehmen''" (5) bestätigen Sie die Änderungen. Dieser Baustein wird zu Beginn des Tests die Verbindung zur App herstellen.<br />
<br />
[[Datei:MobileTestingConnectblock.png | frame | left | Abb. 7: Verbindungsbaustein editieren]]<br />
<br clear="all"><br />
<br />
Wechseln Sie nun zum Testplan "''Demo-Test''" (1) (Abb. 8). Dieser Testplan enthält bereits einige fertige Testfälle. Vor und nach der Ausführung (2) ist außerdem jeweils ein Baustein eingetragen: Der eben bearbeitete Baustein "''Connect''" für den Aufbau und der Baustein "''Disconnect''" für den Verbindungsabbau. Durch das Eintragen der beiden Bausteine an dieser Stelle geschieht der Verbindungsabbau insbesondere auch dann, wenn der Test vorzeitig abgebrochen wird, z. B. weil einer der Testfälle fehlschlägt.<br />
<br />
[[Datei:MobileTestingTestplan.png | frame | left | Abb. 8: Testplanausführung]]<br />
<br clear="all"><br />
Jetzt können Sie den Testplan "''Demo-Test''" starten, indem Sie auf den grünen Play-Knopf (3) klicken. Der Testplan sollte ohne Fehler durchlaufen.<br />
<br />
=== Schritt 2: Einen Baustein mit dem Recorder erstellen (iOS) ===<br />
Mit Hilfe des integrierten Recorders lassen sich einfach Ausführungssequenzen aufnehmen und in einem Baustein speichern. Dafür muss eine Verbindung zu einem Testgerät bestehen, mit dessen Hilfe der Test erstellt wird.<br />
<br />
Um eine Verbindung aufzubauen, wechseln Sie zurück zum GUI-Browser. In diesem ist noch die Verbindung eingetragen, die Sie zuvor angelegt haben. Da für die Verbindung im Testlauf derselbe Name verwendet wurde, wurden die Einstellungen damit überschrieben (In unserem Fall waren die Einstellungen ohnehin identisch). Die Verbindung ist zur Zeit nicht aktiv, da sie am Ende der Ausführung abgebaut wurde. Die Einstellungen sind dort aber noch eingetragen. Um die Verbindung mit dieser Konfiguration wieder aufzubauen, wählen Sie sie aus, gefolgt von einem Rechtsklick und "''Verbinden''".<br />
<br />
Warten Sie, bis die Verbindung aufgebaut ist (1) und drücken Sie dann den Aufnahme-Knopf (2), um eine Aufzeichnung zu starten (Abb. 9).<br />
<br />
[[Datei:MobileTestingRecorderStarten.png | frame | left | Abb. 9: Recorder starten]]<br />
<br clear="all"><br />
Es öffnet sich ein Fenster mit dem Mobile Testing Recorder (Abb. 10). Dieser zeigt einen Screenshot des verbundenen Geräts. Über diese Anzeige können Sie das Gerät fernsteuern. Dabei wird jede Aktion, die Sie ausführen, im Hintergrund aufgezeichnet.<br />
<br />
In der oberen Menüleiste können Sie das Werkzeug auswählen (1), mit dem Sie eine Aktion eingeben möchten. Als Voreinstellung ist das Werkzeug "''Auto''" ausgewählt. Sie können damit bestimmte Aktionen aufzeichnen, indem Sie mit dem Mauszeiger entsprechende Gesten auf der Anzeige ausführen. Wenn Sie zum Beispiel mit der linken Maustaste lange klicken, entspricht das einem langen Antippen des Elements an dieser Stelle. Anstatt die gewünschte Aktion mit der entsprechenden Geste zu bestimmen, können Sie diese alternativ auch manuell auswählen.<br />
<br />
Es soll nun ein neuer Test für das Erkennen korrekter GTIN-13-Codes aufgenommen werden. Klicken Sie zunächst in der Anzeige kurz auf den Button "''GTIN-13 (EAN-13)''" (2) der App um einen entsprechenden Klick auf dem Gerät auszulösen. Während der Ausführung dieser Aktion wird der Rahmen des Recorders kurzzeitig rot. Falls der Recorder danach nicht die aktuelle Ansicht der App darstellen sollte, klicken Sie im Recorder auf das Aktualisierungssymbol (3).<br />
<br />
[[Datei:MobileTestingRecorder1iOS.png | frame | left | Abb. 10: Über Recorder zur GTIN-13-Activity wechseln]]<br />
<br clear="all"><br />
Anschließend soll im Eingabefeld der neuen Seite eine korrekte GTIN-13 eingegeben werden. Führen Sie dazu einen Rechtsklick auf dem Eingabefeld (1) aus und wählen Sie im Kontextmenü die Aktion "''Text setzen''" (2) (Abb. 11). Geben Sie in den sich daraufhin öffnenden Dialog eine beliebige gültige Artikelnummer im GTIN-13-Format ein, bspw. "''4006381333986''" (3). Dieser Text wird nun in der App gesetzt.<br />
<br />
[[Datei:MobileTestingRecorder2iOS.png | frame | left | Abb. 11: GTIN-13-Code über Recorder eingeben]]<br />
<br clear="all"><br />
Klicken Sie nun auf "''Verify''" (1) (Abb. 12). In der App erscheint nun als Ergebnis "''OK''" (2). Der Test soll feststellen, ob tatsächlich dieses Ergebnis angezeigt wird. Nach einem Rechtsklick darauf können Sie im Kontextmenü die Aktion "''Attribut zusichern''" (3) auswählen. Wählen Sie im Dialog, der sich daraufhin öffnet, die Eigenschaft ''value'' (4) aus und bestätigen Sie mit "''OK''" (5). Dieses Mal wird keine Aktion auf dem Gerät ausgelöst, sondern nur ein Baustein aufgezeichnet, der fehlschlägt, sollte das Ergebnis vom erwarteten Wert "''OK''" abweichen.<br />
<br />
[[Datei:MobileTestingRecorder3iOS.png | frame | left | Abb. 12: Antwort der App über Recorder auslesen]]<br />
<br clear="all"><br />
Schließen Sie nun den Recorder. Im ''Arbeitsbereich'' des GUI-Browsers sehen Sie, dass für jede der aufgenommenen Aktionen ein Baustein angelegt wurde (Abb. 13). Sie können nun testen, ob sich das Aufgenommene wieder abspielen lässt. Dazu müssen Sie zunächst die App auf Ihrem Gerät in den Anfangszustand zurückbringen, indem Sie auf dem Gerät die Schaltfläche "''Home''" oben links benutzen. Klicken Sie dann in expecco auf den grünen Play-Knopf (1). Wird alles grün, war die Ausführung erfolgreich. Erstellen Sie nun daraus einen neuen Baustein in der Testsuite, indem Sie auf das Bausteinsymbol (2) in der rechten oberen Ecke klicken. Geben Sie ihm den Namen "''GTIN_Verify_OK''" (3) und bestätigen Sie (4).<br />
<br />
[[Datei:MobileTestingArbeitsbereich.png | frame | left | Abb. 13: Neuen Baustein aus Arbeitsbereich exportieren]]<br />
<br clear="all"><br />
Bauen Sie nun die Verbindung ab, indem Sie die Verbindung auswählen, rechtsklicken und im Kontextmenü ''Verbindung abbauen'' auswählen.<br />
<br />
Wechseln Sie zurück zum Reiter der Testsuite. Dort wurde der neue Baustein angelegt. Wählen Sie wieder den Testplan "''Demo-Test''" aus und fügen Sie den aufgenommenen Testfall "''GTIN_Verify_OK''" per Drag-and-drop am Ende des Testplans hinzu. Übernehmen Sie die Änderung und starten Sie erneut. Der Testplan sollte wieder ohne Fehler durchlaufen.<br />
<br />
=== Schritt 3: XPath anpassen mithilfe des GUI-Browsers (iOS) ===<br />
Ihr neuer Baustein funktioniert auf anderen Geräten möglicherweise nicht. Die verwendeten Elemente werden über einen XPath adressiert und dieser kann auf anderen Geräten nicht stimmen. Lesen Sie dazu den Abschnitt [[#XPath_anpassen_mithilfe_des_GUI-Browsers|XPath anpassen mithilfe des GUI-Browsers]]. Falls Ihnen ein weiteres Gerät zur Verfügung steht, können Sie nun versuchen, die Pfade in Ihren erstellten Bausteinen zu verallgemeinern. Sie können diesen Schritt aber auch überspringen.<br />
<br />
Wenn es Ihnen schwerfällt, verkürzte Pfade zu finden, orientieren Sie sich dabei an den Pfaden der bereits vorhandenen Bausteine. Starten Sie den Test erneut. Sollte der Test jetzt fehlschlagen, überprüfen Sie die Pfade noch einmal im GUI-Browser.<br />
Um den Test nun auf einem zweiten Gerät auszuführen, öffnen Sie im Menü "''Erweiterungen''" > "''Mobile Testing''" > "''Verbindungseinstellungen erstellen''". Sie erhalten einen Dialog ähnlich zum Verbindungsdialog. Allerdings können Sie hier nur Einstellungen erstellen und speichern aber keine Verbindung herstellen. Sie haben jedoch die Möglichkeit, einzelne Aspekte der Einstellungen zu speichern wie bspw. nur das Gerät. Geben Sie das neue Gerät ein und wählen Sie es aus. Klicken Sie länger auf das Symbol zum Speichern im Anhang bis sich das verzögerte Menü öffnet und wählen Sie hier "''Geräte-Einstellungen speichern''" (Abb. 14). Benennen Sie den Anhang am besten nach dem Gerät. Danach können Sie den Dialog wieder schließen.<br />
<br />
[[Datei:MobileTestingGerätSpeichern.png | frame | left | Abb. 14: Einstellungen für ein Gerät speichern]]<br />
<br clear="all"><br />
Wählen Sie den Baustein "''Connect''" aus und ziehen Sie die Einstellungen für das neue Gerät in dessen Netzwerk. Verbinden Sie nun dessen Ausgangspin ''pathName'' mit dem Eingangspin ''stringOrFilename[2]'' des Bausteins "''Connect from File''". Der Baustein Connect from File liest die Angaben an den Eingangspins von oben nach unten ein, mehrfache Eigenschaften werden dabei ersetzt. In diesem Fall werden also die Einstellungen zum verwendeten Gerät ersetzt, während die übrigen Einstellungen gleich bleiben. Wenn Sie die Pfade geschickt gewählt haben, wird der Test nun auch auf dem anderen Gerät erfolgreich ablaufen.<br />
<br />
=== Schritt 4: Noch einen Baustein erstellen (iOS) ===<br />
Falls sich gleiche Abläufe im Test wiederholen, können Sie dafür bereits erstellte Bausteine wieder-verwenden oder abwandeln. Der in Schritt 2 erstellte Baustein prüft die Erkennung korrekter GTIN-13-Codes. Es fehlt noch ein Test, der umgekehrt das Erkennen eines falschen GTIN-13-Codes prüft. Die Struktur der beiden Tests ist identisch, sie unterscheiden sich lediglich in ihren Parametern. Kopieren Sie daher den Baustein "''GTIN_Verify_OK''" und benennen Sie die Kopie in "''GTIN_Verify_NOT_OK''" um. Ändern Sie die Eingabe der GTIN-13 in einen falschen Code zum Beispiel durch Ändern der letzten Ziffer ("''4006381333987''") und setzen Sie den Überprüfungswert der Ausgabe auf "''NOT OK''" (Abb. 15).<br />
<br />
[[Datei:MobileTestingGTIN_Verify_NOT_OK_iOS.png | frame | left | Abb. 15: Baustein editieren]]<br />
<br clear="all"><br />
Fügen Sie diesen neuen Test ebenfalls zum Testplan Demo-Test hinzu und setzen Sie ihn ans Ende. Führen Sie den Testplan aus, aber vergessen Sie nicht, vorher die Verbindung im GUI-Browser abzubauen.<br />
<br />
Der neue Test wird fehlschlagen, weil Ihr aufgenommener Baustein nicht wieder zur Startseite der App zurückkehrt, die Tests aber jeweils von dort aus starten. In den anderen Bausteinen ist dies bereits berücksichtigt; sie führen abschließend immer den Baustein "''Back to main menu''" aus. Sie sehen das, indem Sie einen der anderen Bausteine, z. B. "''GTIN_Calculate''", auswählen und auf seine Schema-Ansicht wechseln. Dort steht der Baustein "''Back to main menu''" im Feld "''Nach Ausführung''" (Abb. 16). Wie beim entsprechenden Feld beim Testplan wird auch dieser Baustein immer am Ende ausgeführt, unabhängig davon, ob der Test erfolgreich verläuft oder abbricht. Ergänzen Sie diesen Eintrag nun in Ihren Bausteinen "''GTIN_Verify_OK''" und "''GTIN_Verify_NOT_OK''". Wählen Sie dazu den Baustein aus und ziehen Sie in der Schema-Ansicht den Baustein "''Back to main menu''" auf das Eingabefeld "''Nach Ausführung''". Nun können Sie den Testplan starten und alle Tests sollten wieder problemlos ausgeführt werden.<br />
<br />
[[Datei:AppiumDemo Nach Ausführung.png | frame | left | Abb. 16: Nach-Ausführungs-Baustein setzen]]<br />
<br clear="all"><br />
<br />
=== Schritt 5: Test vervollständigen (iOS) ===<br />
Für die Activity IBAN sind bereits alle Antwortmöglichkeiten der App mit Testfällen abgedeckt. In der GTIN-13-Activity werden ein korrekter und ein fehlerhafter Code getestet und eine Prüfziffer berechnet, das Verhalten der App bei Eingaben falscher Länge wird aber bisher nicht getestet (Bei Verify "''Input must be exactly 13 digits''" und "''…12 digits''". bei Calculate). Die Activity zum Prüfen der Seriennummern von Eurobanknoten wird noch gar nicht getestet. Wie bei der IBAN können hier drei Fälle auftreten: eine korrekte Seriennummer wurde eingegeben (Antwort: "''OK''"), eine falsche Seriennummer wurde eingegeben (Antwort: "''NOT OK''") oder die Angabe entspricht nicht dem Format (Antwort: "''A serial number consists of 12 characters with the first one or two being capital letters (A-Z).''"). Sie können die Testabdeckung jetzt noch erweitern, indem Sie entsprechende Testfälle erstellen. Die Bausteine dafür können Sie wie in Schritt 2 mit dem Recorder erstellen und die XPaths bei Bedarf verallgemeinern. Wenn Sie mit dem grundsätzlichen Umgang mit expecco vertraut sind, können Sie Bausteine natürlich auch ohne Recorder erstellen, indem Sie sie manuell aus vorhandenen Bausteinen der Bibliothek zusammensetzen. Sie können auch beide Vorgehensweisen nach Belieben kombinieren.<br />
<br />
Beachten Sie, dass die hier vorgestellten Testfälle jeweils nur einzelne Eingaben prüfen. Wenn Sie Testfälle für Ihre eigenen Apps schreiben, wollen Sie vermutlich engmaschiger testen, indem Sie noch weitere unterschiedliche Werte eingeben, die insbesondere auch Randfälle enthalten.<br />
<br />
= Dialoge des Mobile Testing Plugins =<br />
== Verbindungseditor ==<br />
Mithilfe des Verbindungseditors können Sie schnell Verbindungen definieren, ändern oder aufbauen. Je nach Aufgabe weist der Dialog kleine Unterschiede auf und wird unterschiedlich geöffnet:<br />
*Um eine Verbindung aufzubauen, klicken Sie im GUI-Browser auf "''Verbinden'"' klicken und wählen dann "''Mobile Testing''".<br />
*Um eine bestehende Verbindung im GUI-Browser zu ändern oder zu kopieren, wählen Sie diese aus, machen einen Rechtsklick und wählen im Kontextmenü "''Verbindung bearbeiten''" oder "''Verbindung kopieren''" aus.<br />
*Wollen Sie Verbindungseinstellungen nicht für den GUI-Browser sondern zur Verwendung in einem Test erstellen, wählen Sie im Menü des Mobile Testing Plugins den Punkt "''Verbindungseinstellungen erstellen...''". Darüber können nur die Einstellungen für eine Verbindung erstellt werden, ohne dass eine Verbindung tatsächlich angelegt wird.<br />
<br />
Einige der Schaltflächen sind nur beim Erstellen von Verbindungseinstellungen sichtbar:<br />
[[Datei:MobileTestingVerbindungseditorMenu.png]]<br />
#"''Einstellungen löschen''": Setzt alle Einträge zurück. (Nur beim Erstellen von Einstellungen sichtbar.)<br />
#"''Einstellungen aus Datei laden''": Erlaubt das Öffnen einer gespeicherten Einstellungsdatei (*.csf). Deren Einstellungen werden in den Dialog übernommen. Bereits getätigte Eingaben ohne Konflikt bleiben dabei erhalten.<br />
#"''Einstellungen aus Anhang laden''": Erlaubt das Öffnen eines Anhangs mit Verbindungseinstellungen aus einem geöffneten Projekt. Diese Einstellungen werden in den Dialog übernommen. Bereits getätigte Eingaben ohne Konflikt bleiben dabei erhalten.<br />
#"''Einstellungen in Datei speichern''" sowie<br />
#"''Einstellungen in Anhang speichern''": Hier können Sie die eingetragenen Einstellungen in eine Datei (*.csf) speichern oder als Anhang in einem geöffneten Projekt anlegen. Beide Optionen besitzen ein verzögertes Menü, in dem Sie auswählen können, nur einen bestimmten Teil der Einstellungen zu speichern. (Nur beim Erstellen von Einstellungen sichtbar.)<br />
#"''Erweiterte Ansicht''": Damit können Sie in die erweiterte Ansicht wechseln, um zusätzliche Einstellungen vorzunehmen. Lesen Sie dazu mehr am Ende des Kapitels. (Nur beim Erstellen von Einstellungen sichtbar.)<br />
#"''Hilfe''": An der rechten Seite wird ein Hilfetext zum jeweiligen Schritt ein- oder ausgeblendet.<br />
<br />
<br />
Der Dialog ist in drei Schritte unterteilt. Im ersten Schritt wählen Sie das Gerät, das Sie verwenden möchten, im zweiten Schritt wählen Sie aus, welche App verwendet werden soll und im letzten Schritt erfolgen die Einstellungen zum Appium-Server.<br />
<br />
===<span id="AppiumConnectionEditorStep1"><!-- Referenced by AppiumConnectionEditor in Mobile Testing Plugin --></span>Schritt 1: Gerät auswählen===<br />
Im oberen Teil erhalten Sie eine Liste aller angeschlossenen Appium-Geräte, die erkannt werden. Mit der Checkbox darunter können Sie die Geräte ausblenden, die zwar erkannt werden, aber nicht bereit sind. Falls Sie ein Gerät eintragen wollen, das nicht angeschlossen ist, können Sie dies mit dem entsprechenden Knopf "''Android-Gerät eingeben''" bzw. "''iOS-Gerät eingeben''" anlegen. Dazu müssen Sie jedoch die benötigten Eigenschaften Ihres Geräts kennen. Das Gerät wird dann in einer zweiten Geräteliste angelegt und kann dort ausgewählt werden. Wenn keine Liste mit angeschlossenen Elementen angezeigt werden kann, werden stattdessen verschiedene Meldungen angezeigt:<br />
*Keine Geräte gefunden<br />
*:expecco konnte kein Android-Geräte finden.<br />
*:Um eine Verbindung zu einem Gerät automatisch zu konfigurieren, stellen Sie sicher, dass es<br />
*:*angeschlossen ist<br />
*:*eingeschaltet ist<br />
*:*einen passenden adb-Treiber installiert hat<br />
*:*für Debugging freigeschaltet ist (siehe unten).<br />
*Keine verfügbaren Geräte gefunden<br />
*:expecco konnte keine verfügbaren Android-Geräte finden. Es wurden aber nicht verfügbare gefunden, z.B. mit dem Status "unauthorized".<br />
*:Um eine Verbindung zu einem Gerät automatisch zu konfigurieren, stellen Sie sicher, dass es<br />
*:*angeschlossen ist<br />
*:*eingeschaltet ist<br />
*:*einen passenden adb-Treiber installiert hat<br />
*:*für Debugging freigeschaltet ist (siehe unten).<br />
*:Um nicht verfügbare Geräte anzuzeigen, aktivieren Sie unten diese Option.<br />
*Verbindung verloren<br />
*:expecco hat die Verbindung zum adb-Server verloren. Versuchen Sie die Verbindung wieder herzustellen, indem Sie auf den Button klicken.<br />
*Verbindung fehlgeschlagen<br />
*:expecco konnte sich nicht mit dem adb-Server verbinden. Möglicherweise läuft er nicht oder der angegebene Pfad stimmt nicht.<br />
*:Überprüfen Sie die adb-Konfiguration in den Einstellungen und versuchen Sie den adb-Server zu starten und eine Verbindung herzustellen indem Sie auf den Knopf klicken.<br />
*Verbinden ...<br />
*:expecco verbindet sich mit dem adb-Server. Dies kann einige Sekunden dauern.<br />
*adb-Server starten ...<br />
*:expecco startet den adb-Server. Dies kann einige Sekunden dauern.<br />
<br />
<!--Bei "''Automatisierung durch''" können Sie angeben, welche Automation-Engine verwendet werden soll. Lassen Sie die Einstellung auf "''(Default)''" wird die entsprechende Capability gar nicht gesetzt. Ansonsten stehen Appium, Selendroid und ab expecco 2.11 XCUITest zur Verfügung. In der Regel wird Selendroid nur für Android-Geräte vor Version 4.1 gebraucht.-->Mit "''Weiter''" gelangen Sie zum nächsten Schritt. Wenn Sie Einstellungen für den GUI-Browser eingeben, ist das erst möglich, wenn ein Gerät ausgewählt wurde.<br />
<br />
<span id="UnlockingDeveloperOptions">Anmerkung zum Freischalten</span>: In jüngeren Android Versionen werden die Entwickleroptionen zunächst nicht mehr in den Einstellungen angeboten. Falls ihr Android Gerät in den Einstellungen keinen Eintrag zu "''Entwickleroptionen''" zeigt, wählen Sie zunächst den Eintrag "''Telefoninfo''", dann "''SoftwareVersionsInfo''" und klicken darin mehrfach auf den Eintrag "''BuildVersion''".<br />
<br />
===<span id="AppiumConnectionEditorStep2"><!-- Referenced by AppiumConnectionEditor in Mobile Testing Plugin --></span>Schritt 2: App auswählen===<br />
Hier können Sie Angaben zur App machen, die getestet werden soll. Dabei können Sie entscheiden, ob Sie eine App verwenden wollen, die bereits auf dem Gerät installiert ist, oder ob für den Test eine App installiert werden soll. Wählen Sie oben den entsprechenden Reiter aus. Je nachdem, ob Sie im vorigen Schritt ein Android- oder ein iOS-Gerät ausgewählt haben, ändert sich die erforderte Eingabe.<br />
<br />
*'''Android'''<br />
**''App auf dem Gerät''<br />
**:Wenn Sie im ersten Schritt ein angeschlossenes Gerät ausgewählt haben, werden die Pakete aller installierten Apps automatisch abgerufen und Sie können die Auswahl aus den Drop-down-Listen treffen. Die installierten Apps sind in Fremdpakete und Systempakete unterteilt; wählen Sie die entsprechende Paketliste aus. Diese Auswahl gehört nicht zu den Einstellungen, sondern stellt nur die entsprechende Paketliste zur Verfügung. Sie können den Filter benutzen, um die Liste weiter einzuschränken und dann das gewünschte Paket auswählen. Die Activities des ausgwählten Pakets werden ebenfalls automatisch abgerufen und als Drop-down-Liste zur Verfügung gestellt. Wählen Sie die Activity aus, die gestartet werden soll. In der Regel wird automatisch eine Activity aus der Liste eingetragen. Falls Sie kein verbundenes Gerät verwenden, müssen Sie die Eingabe des Pakets und der Activity von Hand vornehmen.<br />
**''App installieren''<br />
**:Geben Sie bei "''App''" den Pfad zu einer App an. Der Pfad muss für den Appium-Server gültig sein, der verwendet wird. Sie können auch eine URL angeben. Benutzen Sie einen lokalen Appium-Server, können Sie den rechten Butten benutzen, um zu der Installationsdatei der App zu navigieren und diesen Pfad einzutragen. Wenn möglich werden dabei auch das entsprechende Paket und die Activity in den Feldern darunter eingetragen. Diese Angabe ist aber nicht notwendig.<br />
<br />
*'''iOS'''<br />
**''App auf dem Gerät''<br />
**:Geben Sie die Bundle-ID einer installierten App an. Sie können die IDs der installierten Apps bspw. mithilfe von Xcode erfahren. Starten Sie dazu Xcode und wählen Sie in der Menüleiste am oberen Bildschirmrand im Menü "''Window''" den Eintrag "''Devices''". Es öffnet sich ein Fenster, in dem eine Liste der angeschlossenen Geräte angezeigt wird. Wenn Sie Ihr Gerät auswählen, sehen Sie in der Übersicht eine Auflistung der von Ihnen installierten Apps.<br />
**''App installieren''<br />
**:Geben Sie bei "''App''" den Pfad zu einer App an. Der Pfad muss für den Appium-Server gültig sein, der verwendet wird. Sie können auch eine URL angeben. Zu den Vorraussetzungen an Apps für reale Geräte lesen Sie bitte den Abschnitt [[#iOS-Ger.C3.A4t_und_App_vorbereiten|iOS-Geräte und App vorbereiten]].<br />
<br />
Im unteren Teil können Sie festlegen, ob die App beim Verbindungsabbau zurückgesetzt bzw. deinstalliert werden soll, und ob sie initial zurückgesetzt werden soll. Auch hier wird die entsprechende Capability gar nicht gesetzt, wenn Sie "''(Default)''" auswählen. Mit "''Weiter''" gelangen Sie zum nächsten Schritt.<br />
<br />
===<span id="AppiumConnectionEditorStep3"><!-- Referenced by AppiumConnectionEditor in Mobile Testing Plugin --></span>Schritt 3: Servereinstellungen===<br />
Im letzten Schritt befindet sich zunächst im oberen Teil eine Liste aller Capabilities, die sich aus Ihren Angaben der vorigen Schritte ergeben. Wenn Sie sich mit Appium auskennen und noch zusätzliche Capabilities setzen möchten, die der Verbindungseditor nicht abdeckt, können Sie durch Klicken auf "''Bearbeiten''" in die erweiterte Ansicht gelangen. Lesen Sie dazu den Abschnitt weiter unten.<br />
<br />
Wenn Sie Einstellungen für den GUI-Browser eingeben, können Sie den ''Verbindungsnamen'' eintragen, mit dem die Verbindung angezeigt wird. Dies ist auch der Name unter dem Bausteine diese Verbindung verwenden können, wenn sie aufgebaut ist. Wenn Sie das Feld frei lassen, wird ein Name generiert. Um die Adresse für den Appium-Server anzugeben, erhalten Sie die lokale Standard-Adresse und bereits verwendete Adressen zur Auswahl. Wenn Sie den Haken für "''Bei Bedarf starten''" setzen, versucht expecco beim Verbinden einen Appium-Server an der angegebenen Adresse zu starten, wenn dort noch keiner läuft. Dieser Server wird dann beim Beenden der Verbindung ebenfalls heruntergefahren. Dies funktioniert nur für lokale Adressen. Achten Sie darauf, nur Portnummern zu verwenden, die auch frei sind. Verwenden Sie am besten nur ungerade Portnummern ab dem Standardport 4723. Beim Verbindungsaufbau wird ebenfalls die folgende Portnummer verwendet, wodurch es sonst zu Konflikten kommen könnte.<br />
<br />
Je nachdem, wie Sie den Dialog geöffnet haben, gibt es nun verschiedene Schaltflächen um ihn abzuschließen. In jedem Fall haben Sie die Option zu speichern. Dabei öffnet sich ein Dialog, indem Sie entweder ein geöffnet Projekt auswählen können, um die Einstellungen dort als Anhang zu speichern, oder auswählen es in einer Datei zu speichern, die Sie anschließend angeben können. Durch das Speichern wird der Dialog nicht beendet, wodurch Sie anschließend noch eine andere Option auswählen könnten.<br />
<br />
Wenn Sie den Editor zum Verbindungsaufbau geöffnet haben, können Sie abschließend auf "''Verbinden''" oder "''Server starten und verbinden''" klicken, je nachdem, ob der Haken für den Serverstart gesetzt ist. Für das Ändern oder Kopieren einer Verbindung im GUI-Brower heißt diese Option "''Übernehmen''", da in diesem Fall nur der Verbindungseintrag geändert bzw. neu angelegt wird, der Verbindungsaufbau aber nicht gestartet wird. Das können Sie bei Bedarf anschließend über das Kontextmenü tun. Falls Sie Capabilities einer bestehenden Verbindung geändert haben, fordert Sie anschließend ein Dialog auf zu entscheiden, ob diese Änderungen direkt übernommen werden sollen, indem die Verbindung abgebaut und mit den neuen Verbindungen aufgebaut wird, oder nicht. In diesem Fall werden die Änderungen erst wirksam, nachdem Sie die Verbindung neu aufbauen.<br />
<br />
Zur Verwendung des Verbindungseditors lesen Sie auch den entsprechenden Abschnitt im jeweiligen Tutorial in Schritt 1 (Android: [[#Schritt_1:_Demo_ausf.C3.BChren|Demo ausführen]], iOS: [[#Schritt_1:_Demo_ausf.C3.BChren_.28iOS.29|Demo ausführen (iOS)]]).<br />
<br />
===Erweiterte Ansicht===<br />
Die erweiterte Ansicht des Verbindungseditors erhalten Sie entweder durch Klicken auf "''Bearbeiten''" im dritten Schritt oder jederzeit über den entsprechenden Menüeintrag, wenn Sie den Editor über das Plugin-Menü gestartet haben. In dieser Ansicht erhalten Sie eine Liste aller eingestellten Appium-Capabilities. Zu dieser können Sie weitere hinzufügen, Einträge ändern oder entfernen. Um eine Capability hinzuzufügen, wählen Sie diese aus der Drop-down-Liste des Eingabefelds aus. In dieser befinden sich alle bekannten Capabilities sortiert in die Kategorien ''Common'', ''Android'' und ''iOS''. Haben Sie eine Capability ausgewählt, wird ein kurzer Informationstext dazu angezeigt. Sie können in das Feld auch von Hand eine Capability eingeben. Klicken Sie dann auf "''Hinzufügen''", um die Capabilitiy in die Liste einzutragen. Dort können Sie in der rechten Spalte den Wert setzen. Um einen Entrag zu löschen, wählen Sie diesen aus und klicken Sie auf "''Entfernen''". Mit "''Zurück''" verlassen Sie die erweiterte Ansicht.<br />
<br />
[[Datei:MobileTestingErweiterteAnsicht.png]]<br />
<br />
== Laufende Appium-Server ==<br />
Im Menü des Mobile Testing Plugins finden Sie den Eintrag "''Appium-Server...''". Mit diesem öffnen Sie ein Fenster mit einer Übersicht aller Appium-Server, die von expecco gestartet wurden und auf welchem Port diese laufen. Durch Klicken auf das Icon in der Spalte "''Log anzeigen''" können Sie das Logfile des entsprechenden Servers anschauen. Dieses wird beim Beenden des Servers wieder gelöscht. Mit den icons in der Spalte "''Beenden''" kann der entsprechenden Server beendet werden. Allerdings wird dies verhindert, wenn expecco über diesen Server noch eine offene Verbindung hat.<br />
<br />
Außerdem können Sie hier auch Server starten. Verwenden Sie die Eingabefelder zur Konfiguration der Serveradresse. Sie können die Felder auch frei lassen, um die Standardwerte zu verwenden. Bitte beachten Sie, dass Server nur lokal gestartet werden können und der gewählte Port nicht belegt sein darf. Typischerweise werden die ungeraden Portnummern ab 4723 verwendet. Die folgende Portnummer wird beim Verbinden mit einem Gerät ebenfalls benötigt, wodurch es mit den geraden Nummern zu Konflikten kommen könnte.<br />
<br />
[[Datei:MobileTestingAppiumServer.png]]<br />
<br />
Im Menü des Mobile Testing Plugins finden Sie auch den Eintrag "''Alle Verbindungen und Server beenden''". Dies ist für den Fall gedacht, dass Verbindungen oder Server auf andere Weise nicht beendet werden können. Beenden Sie Verbindungen wenn möglich immer im GUI-Browser oder durch Ausführen eines entsprechenden Bausteins. Server, die Sie in der Server-Übersicht gestartet haben, beenden Sie dort; Server, die mit einer Verbindung gestartet wurden, werden automatisch mit dieser beendet.<br />
<br />
Beachten Sie, dass in der Übersicht nur Server aufgelistet sind, die von expecco gestartet und verwaltet werden. Mögliche andere Appium-Server, die auf andere Art gestartet wurden, werden nicht erkannt.<br />
<br />
== Recorder ==<br />
Besteht im GUI-Browser eine Verbindung zu einem Gerät, kann der integrierte Recorder verwendet werden, um mit diesem Gerät einen Testabschnitt aufzunehmen. Sie starten den Recorder, indem Sie im GUI-Browser die entsprechende Verbindung auswählen und dann auf den Aufnahme-Knopf klicken. Für den Recorder öffnet sich ein neues Fenster. Die aufgezeichneten Aktionen werden im Arbeitsbereich des GUI-Browsers angelegt. Daher ist es möglich, das Aufgenommene parallel zu editieren.<br />
<br />
[[Datei:MobileTestingRecorder.png|caption|]]<br />
<br />
;Komponenten des Recorderfensters<br />
#'''Aktualisieren''': Holt das aktuelle Bild und den aktuellen Elementbaum vom Gerät. Dies wird nötig, wenn das Gerät zur Ausführung einer Aktion länger braucht oder sich etwas ohne das Anstoßen durch den Recorder ändert.<br />
#'''Follow-Mouse''': Das Element unter dem Mauszeiger wird im GUI-Browser ausgewählt.<br />
#'''Element-Highlighting''': Das Element unter dem Mauszeiger wird rot umrandet.<br />
#'''Elemente einzeichnen''': Die Rahmen aller Elemente der Ansicht werden angezeigt.<br />
#'''Werkzeuge''': Auswahl, mit welchem Werkzeug aufgenommen werden soll. Die gewählte Aktion wird bei einem Klick auf die Anzeige ausgelöst. Dabei stehen folgende Aktionen zur Verfügung:<br />
#*Aktionen auf Elemente:<br />
#**Klicken: Kurzer Klick auf das Element, über dem der Cursor steht. Zur genaueren Bestimmung, welches Element verwendet wird, benutzen Sie die Funktion Follow-Mouse oder Element-Highlighting.<br />
#**Element antippen: Ähnlich zum Klicken, nur dass zusätzlich die Dauer des Klicks aufgezeichnet wird. Dadurch sind auch längere Klicks möglich.<br />
#**Text setzen: Ermöglicht das Setzen eines Textes in Eingabefelder.<br />
#**Text löschen: Löscht den Text eines Eingabefelds.<br />
#*Aktionen auf das Gerät:<br />
#**Antippen: Löst einen Klick auf die Bildschirmposition aus, bei dem auch die Dauer berücksichtigt wird.<br />
#**Wischen: Wischen in einer geraden Linie vom Punkt des Drückens des Mausknopfes bis zum Loslassen. Die Dauer wird ebenfalls aufgezeichnet.<br />
#:Beachten Sie bei diesen Aktionen, dass das Ergebnis sich auf verschiedenen Geräten unterscheiden kann, bspw. bei verschiedenen Bildschirmauflösungen.<br />
#*Erstellen von Testablauf-Bausteinen<br />
#**Attribut prüfen: Vergleicht den Wert eines festgelegten Attributs des Elements mit einem vorgegebenen Wert. Das Ergebnis triggert den entsprechenden Ausgang.<br />
#**Attribut zusichern: Vergleicht den Wert eines festgelegten Attributs des Elements mit einem vorgegebenen Wert. Bei Ungleichheit schlägt der Test fehl.<br />
#*Auto<br />
#:Ist das Auto-Werkzeug ausgewählt, können alle Aktionen durch spezifische Eingabeweise benutzt werden: ''Klicken'', ''Element antippen'' und ''Wischen'' funktionieren weiterhin durch Klicken, wobei sie anhand der Dauer und der Bewegung des Cursors unterschieden werden. Um ein ''Antippen'' auszulösen, halten Sie beim Klicken Strg gedrückt. Die übrigen Aktionen erhalten Sie durch einen Rechtsklick auf das Element in einem Kontextmenü.<br />
#'''Softkeys''': Nur unter Android. Simuliert das Drücken der Knöpfe Zurück, Home, Fensterliste und Power.<br />
#'''Home-Button''': Nur unter iOS ab expecco 2.11. Ermöglicht das Drücken des Home-Buttons. Vor expecco 19.2 funktioniert es nur, wenn AssistiveTouch aktiviert ist und sich das Menü in der Mitte des oberen Bildschirmrands befindet. Ab expecco 19.2 verwendet die Funktion kein AssistiveTouch mehr.<br />
#'''Anzeige''': Zeigt einen Screenshot des Geräts. Aktionen werden mit der Maus je nach Werkzeug ausgelöst. Wenn eine neue Aktion eingegeben werden kann, hat das Fenster einen grünen Rahmen, sonst ist er rot.<br />
#'''Fenster an Bild anpassen''': Ändert die Größe des Fensters so, dass der Screenshot vollständig angezeigt werden kann.<br />
#'''Bild an Fenster anpassen''': Skaliert den Screenshot auf eine Größe, mit der er die volle Größe des Fensters ausnutzt.<br />
#'''Ausrichtung anpassen''': Korrigiert das Bild, falls dieses auf dem Kopf stehen sollte. Über den Pfeil rechts daneben kann das Bild auch um 90° gedreht werden, falls dies einmal nötig sein sollte. Die Ausrichtung des Bildes ist für die Funktion des Recorders unerheblich, dieser arbeitet ausschließlich auf den erhaltenen Elementen.<br />
#'''Skalierung''': Ändert die Skalierung des Screenshots.<br />
#'''Kontrollleuchte''': Zeigt den Zustand des Recorders an<br />
#:''grün'': Der Recorder ist bereit<br />
#:''rot'': Der Recorder ist blockiert, weil die Anzeige und die Elementliste aktualisiert werden<br />
#:''grau'': Der Recorder kann nicht mehr verwendet werden, da die Verbindung zum Gerät verloren gegangen ist<br />
<br />
;Verwendung<br />
Mit jedem Klick im Fenster wird eine Aktion ausgelöst und im Arbeitsbereich des GUI-Browsers aufgezeichnet. Dort können Sie das Aufgenommene abspielen, editieren oder daraus einen neuen Baustein erstellen.<br />
Aktionen zum Auslösen von Sofkeys finden Sie direkt in der Menüleiste (s.o.). Um Aktionen auf Elemente aufzuzeichen, ändern Sie entweder die Auswahl des Werkzeugs in der Menüleiste (s.o.) und klicken dann auf das Element oder wählen Sie die entsprechende Aktion aus dem Kontextmenü durch einen Rechtsklick auf das entsprechende Element aus. Für Texteingabe ist es zudem möglich, den Cursor über dem Element zu platzieren und den Text einzugeben. Dabei öffnet sich der Eingabedialog für diese Aktion.<br />
Zur Verwendung des Recorders lesen Sie auch Schritt 2 im Tutorial ([[#Schritt_2:_Einen_Baustein_mit_dem_Recorder_erstellen|Android]] bzw. [[#Schritt_2:_Einen_Baustein_mit_dem_Recorder_erstellen_2|iOS]]).<br />
<br />
== AVD Manager und SDK Manager ==<br />
AVD Manager und SDK Manager sind beides Anwendungen von Android. Im Menü des Mobile Testing Plugins bietet expecco die Möglichkeit, diese zu starten. Ansonsten finden Sie diese Programme bei Ihrer Android-Installation. Mit dem AVD Manager können Sie AVDs, also Konfigurationen für Emulatoren, erstellen, bearbeiten und starten. Mit dem SDK Manager erhalten Sie einen Überblick über Ihre Android-Installation und können diese bei Bedarf erweitern.<br />
<br />
= Hybrid-Apps und WebViews =<br />
<br />
'''!!! Wichtiger Hinweis - Wenn Sie Probleme haben, auf den Webview zu wechseln, geben Sie bitte unter den Android Einstellungen - Apps -Standard Apps "Chrome" als "Browser-App" an !!!<br />
'''<br />
Hybrid-Apps enthalten neben den Plattform-nativen Elementen weitere Elemente, die in einen WebView eingebunden sind. Diese Elemente können ebenfalls bedient werden, allerdings muss zuvor in den entsprechenden Kontext gewechselt werden. Mit dem Baustein "''Get Current Context''" erhalten Sie den aktuellen Kontext. Zu Beginn ist dies "''NATIVE_APP''", also der Kontext der nativen Elemente. Mit dem Baustein "''Get Context Handles''" bekommen Sie eine Collection aller vorhandenen Kontexte. Gibt es einen WebView-Kontext, so heißt dieser "''WEBVIEW_1''" oder "''WEBVIEW_<package>''" mit dem Paket des WebViews. Es kann auch mehrere WebView-Kontexte geben. Zu jedem WebView-Kontext gibt es im nativen Kontext ein entsprechendes WebView-Element. Mit dem Baustein "''Switch to Context''" können Sie in einen solchen Kontext wechseln und haben fortan nur Zugriff auf die Elemente in diesem Kontext.<br />
<br />
Im GUI-Browser werden zum einen oben im Baum die vorhandenen Kontexte angezeigt, zum anderen wird der Baum eines Kontexts unterhalb des entsprechenden WebView-Elements eingefügt.<br />
<br />
= XPath anpassen mithilfe des GUI-Browsers =<br />
Bausteine, die auf einem Gerät fehlerfrei funktionieren, tun dies auf anderen Geräten möglicherweise nicht. Auch können kleine Änderungen der App dazu führen, dass ein Baustein nicht mehr den gewünschten Effekt hat. Man sollte einen Baustein daher so robust formulieren, dass er für eine Vielzahl von Geräten verwendet werden kann und kleine Anpassungen an der App verkraftet. Dazu muss man das grundlegende Funktionsprinzip der Adressierung verstehen. Dies wird im Folgenden am Beispiel der App aus dem Tutorial erläutert.<br />
<br />
Die Ansicht der App setzt sich aus einzelnen Elementen zusammen. Dazu gehören die Schaltflächen "''GTIN-13 (EAN-13)''" und "''Verify''", das Eingabefeld der Zahl "''4006381333986''" und das Ergebnisfeld, in dem OK erscheint, wie auch alle anderen auf der Anzeige sichtbaren Dinge. Diese sichtbaren Elemente sind in unsichtbare Strukturelemente eingebettet. Alle Elemente zusammen sind in einer zusammenhängenden Hierarchie, dem Elementbaum, organisiert.<br />
<br />
[[Datei:MobileTestingGUIBrowser.png | frame | left | Abb. 1: Funktionen des GUI-Browsers]]<br />
<br clear="all"><br />
Sie können sich diesen Baum im GUI-Browser ansehen. Wechseln Sie dazu in den GUI-Browser (Abb. 1) und starten Sie eine beliebige Verbindung. Sobald die Verbindung aufgebaut ist, können Sie den gesamten Baum aufklappen (1) (Klick bei gedrückter Strg-Taste). Er enthält alle Elemente der aktuellen Seite der App.<br />
<br />
Ein Baustein, der nun ein bestimmtes Element verwendet, muss dieses eindeutig angeben, indem er dessen Position im Elementbaum mit einem Pfad im XPath-Format beschreibt. Dieses Format ist ein verbreiteter Web-Standard für XML-Dokumente und -Datenbanken, eignet sich aber genauso für Pfade im Elementbaum.<br />
<br />
Wenn Sie ein Element im Baum auswählen, wird unten der von expecco automatisch generierte XPath (2) für das Element angezeigt, der auch beim Aufzeichnen verwendet wird. Oberhalb davon in der Mitte des Fensters befindet sich eine Liste der Eigenschaften (3) des ausgewählten Elements. Man nennt diese Eigenschaften auch Attribute. Sie beschreiben das Element näher wie beispielsweise seinen Typ, seinen Text oder andere Informationen zu seinem Zustand. Links unten können Sie zur besseren Orientierung im Baum die ''Vorschau'' (4) aktivieren, um sich den Bildausschnitt des Elements anzeigen zu lassen.<br />
<br />
Der Elementbaum für gleiche Ansicht einer App kann sich je nach Gerät unterscheiden. Es sind diese Unterschiede, die verhindern, eine Aufnahme von einem Gerät unverändert auch auf allen anderen Geräten abzuspielen: Ein XPath, der im einen Elementbaum ein bestimmtes Element identifiziert, beschreibt nicht unbedingt das gleiche Element im Elementbaum auf einem anderen Gerät. Es kann stattdessen passieren, dass der XPath auf kein Element, auf ein falsches Element oder auf mehrere Elemente passt. Dann schlägt der Test fehl oder er verhält sich unerwartet.<br />
<br />
Man könnte natürlich für jedes Gerät einen eigenen Testfall schreiben. Das brächte aber unverhältnismäßigen Aufwand bei Testerstellung und -wartung mit sich. Das Problem lässt sich auch anders lösen, da ein jeweiliges Element nicht nur durch genau einen XPath beschrieben wird. Vielmehr erlaubt der Standard mithilfe verschiedener Merkmale unterschiedliche Beschreibungen für ein und dasselbe Element zu formulieren. Das Ziel ist daher, einen Pfad zu finden, der auf allen für den Test verwendeten Geräten funktioniert und überall eindeutig zum richtigen Element führt.<br />
<br />
Im Beispiel besteht die Verbindung zur Android-App aus dem Tutorial und der Eintrag des "''GTIN-13''"-Buttons ist ausgewählt (5). Dessen automatisch generierter XPath (2) kann beispielsweise so aussehen:<br />
<br />
<blockquote>//hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[@resource id='android:id/content']/android.widget.RelativeLayout/android.widget.Button[@resource-id='de.exept.expeccomobiledemo:id/gtin_13']</blockquote><br />
<br />
Er ist offensichtlich lang und unübersichtlich. Der sehr viel kürzere Pfad<br />
<br />
<blockquote>//*[@text='GTIN-13 (EAN-13)']</blockquote><br />
<br />
führt zum selben Element.<br />
<br />
Für die iOS-App lautet der automatisch generierte XPath für diesen Button beispielsweise<br />
<br />
<blockquote>//AppiumAUT/XCUIElementTypeApplication/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeButton[2]</blockquote><br />
bzw.<br />
<blockquote>//AppiumAUT/UIAApplication/UIAWindow[1]/UIAButton[2]</blockquote><br />
<br />
und kann kürzer als<br />
<br />
<blockquote>//*[@name='GTIN-13 (EAN-13)']</blockquote><br />
<br />
geschrieben werden.<br />
<br />
Sie können den Pfad entsprechend im GUI-Browser ändern und durch "''Pfad überprüfen''" (6) feststellen, ob er weiterhin auf das ausgewählte Element zeigt, was expecco mit "''Verify Path: OK''" (7) bestätigen sollte. Der erste, sehr viel längere Pfad, beschreibt den gesamten Weg vom obersten Element des Baumes bis hin zum gesuchten Button. Der zweite Pfad hingegen wählt mit "*" zunächst sämtliche Elemente des Baumes und schränkt die Auswahl dann auf genau die Elemente ein, die ein ''text''- bzw. ''name''-Attribut mit dem Wert "''GTIN-13 (EAN-13)''" besitzen, in unserem Fall also genau der eine Button, den wir suchen.<br />
<br />
Im folgenden werden Android-ähnliche Pfade zur Veranschaulichung verwendet. Die Elemente in iOS-Apps heißen zwar anders, wodurch andere Pfade entstehen; das Prinzip ist jedoch das gleiche.<br />
<br />
[[Datei:MobileTestingBaum1.png | frame | Abb. 2: Elementbaum einer fiktiven App]]<br />
<br />
Sie können solche Pfade mit Hilfe weniger Regeln selbst formulieren. Sehen Sie sich den einfachen Baum einer fiktiven Android-App in Abb. 2 an: Die Einrückungen innerhalb des Baumes geben die Hierarchie der Elemente wieder. Ein Element ist ein ''Kind'' eines anderen Elementes, wenn jenes andere Element das nächsthöhere Element mit einem um eins geringeren Einzug ist. Jenes Element ist das ''Elternelement'' des Kindes. Sind mehrere untereinander stehende Elemente gleich eingerückt, so sind sie also alle Kinder desselben Elternelements.<br />
<br />
Ein Pfad durch alle Ebenen der Hierarchie zum TextView-Element ist nun:<br />
<br />
<blockquote>//hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.TextView</blockquote><br />
<br />
Die Elemente sind mit Schrägstrichen voneinander getrennt. Es fällt auf, dass der Name des ersten Elements nicht mit dem im Baum übereinstimmt. Das oberste Element in der Hierarchie heißt immer "''hierarchy''" (für iOS wäre es "''AppiumAUT''"), expecco zeigt im Baum stattdessen den Namen der Verbindung an, damit man mehrere Verbindungen voneinander unterscheiden kann. Die weiteren Elemente tragen jeweils das Präfix "''android.widget.''", das im Baum zur besseren Übersicht nicht angezeigt wird. Bei IOS gibt es kein Präfix, das durch einen Punkt abgetrennt wäre, expecco 2.11 blendet aber entsprechend "''XCUIElementType''" am Anfang aus. Mit jedem Schrägstrich führt der Pfad über eine Eltern-Kind-Beziehung in eine tiefere Hierarchie-Ebene, d. h. "''FrameLayout''" ist ein Kindelement von "''hierarchy''", "''LinearLayout''" ist ein Kind von "''FrameLayout''" usw. Die in eckigen Klammern geschriebenen Wörter dienen nur als Orientierungshilfe im Baum. Sie gehören nicht zum Typ.<br />
<br />
Ein Pfad muss nicht beim Element "''hierarchy''" beginnen. Man kann den Pfad beginnend mit einem beliebigen Element des Baumes bilden. Man kann also verkürzt auch<br />
<br />
<blockquote>//android.widget.TextView</blockquote><br />
<br />
schreiben. Der Pfad führt zum selben "''TextView''"-Element, da es nur ein Element dieses Typs gibt. Anders verhält es sich bei dem Pfad<br />
<br />
<blockquote>//android.widget.Button.</blockquote><br />
<br />
Da es zwei Elemente vom Typ "''Button''" gibt, passt dieser Pfad auf zwei Elemente, nämlich den Button, der mit "''An''" markiert ist, und den ''Button'', der mit "''Aus''" markiert ist. Es würde an dieser Stelle aber auch nicht helfen den langen Pfad von ''hierarchy'' aus beginnend anzugeben. Um einen mehrdeutigen Pfad weiter zu differenzieren, kann man explizit ein Element aus einer Menge wählen, indem man den numerischen Index in eckigen Klammern dahinter schreibt. Der Pfad aus dem obigen Beispiel lässt sich damit so anpassen, dass er eindeutig auf den ''Button'' mit der Markierung "''Aus''" weist:<br />
<br />
<blockquote>//android.widget.Button[1].</blockquote><br />
<br />
Ihnen fällt sicher auf, dass der Index eine 1 ist obwohl das zweite Element gemeint ist. Das kommt daher, dass die Zählung bei 0 beginnt. Der Button mit der Markierung "An" hat also die Nummer 0 und der ''Button'' mit der Markierung "''Aus''" hat die Nummer 1.<br />
<br />
Dieser Ansatz, einen expliziten Index zu verwenden, hat zwei Nachteile: Zum einen lässt sich an dem Pfad nur schwer ablesen welches Element gemeint ist, zum andern ist der Pfad sehr empfindlich schon gegenüber kleinsten Änderungen, wie zum Beispiel dem Vertauschen der beiden ''Button''-Elemente oder dem Einfügen eines weiteren ''Button''-Elements in der App.<br />
<br />
Es wäre daher wünschenswert, das gemeinte Element über eine ihm charakteristische Eigenschaft wie einen Attributwert, zu adressieren. Für Android-Apps eignet sich hierfür häufig das Attribut "''resource-id''". Im Idealfall muss bei der Entwicklung der App darauf geachtet werden, dass jedes Element eine eindeutige Id erhält. Die ''resource-id'' hat den großen Vorteil, dass sie unabhängig vom Text des Elements oder der Spracheinstellung des Geräts ist. Für iOS-Apps kann entsprechend das Attribut "''name''" verwendet werden, wenn es von der App sinnvoll gesetzt wird. Der XPath-Standard erlaubt solche Auswahlbedingungen zu einem Element anzugeben. Angenommen, der ''Button'' mit der Markierung "''Aus''" hat die Eigenschaft ''resource-id'' mit dem Wert ''off'' und der ''Button'' mit der Markierung "''An''" hat als ''resource-id'' den Wert ''on'', dann kann man als eindeutigen Pfad für den "Aus"-''Button''<br />
<br />
<blockquote>//android.widget.Button[@resource-id='off']</blockquote><br />
<br />
formulieren. Wie an dem Beispiel zu sehen werden solche Bedingungen wie ein Index in eckigen Klammern an den Elementtyp angehängt. Der Name eines Attributes wird mit einem "@" eingeleitet und der Wert mit einem "=" in Anführungszeichen angehängt. Ist der Attributwert global eindeutig, kann man den vorausgehenden Pfad sogar durch den globalen Platzhalter * ersetzen, der auf jedes Element passt. Das obige Beispiel mit dem GTIN-13-''Button'' war ein solcher Fall.<br />
<br />
[[Datei:MobileTestingBaum2.png | frame | Abb. 3: Elementbaum einer fiktiven App mit Erweiterungen]]<br />
<br />
Abb. 3 zeigt eine Erweiterung des Beispiels aus Abb. 2. Die App hat nun ein weiteres, nahezu identisches ''LinearLayout'' bekommen. Die ''Buttons'' sind in ihren Attributen jeweils ununterscheidbar. Deshalb funktioniert der vorige Ansatz nicht, einen eindeutigen Pfad nur mithilfe eines Attributwerts zu formulieren. Offensichtlich unterscheiden sich aber ihre benachbarten ''TextViews''. Es ist möglich die jeweilige ''TextView'' in den Pfad mit aufzunehmen, um einen ''Button'' dennoch eindeutig zu adressieren. Ein Pfad zum ''Button'' mit der Markierung "''An''" unterhalb der ''TextView'' mit der Markierung "''Druckschalter''" kann dabei wie folgt aussehen:<br />
<br />
<blockquote>//android.widget.TextView[@resource-id='push']/../android.widget.Button[@resource-id='on']</blockquote><br />
<br />
Der erste Teil beschreibt den Pfad zu der ''TextView'' mit der Markierung "''Druckschalter''" und der ''resource-id'' mit dem Wert ''push''. Danach folgt ein Schrägstrich gefolgt von zwei Punkten. Die zwei Punkte sind eine spezielle Elementbezeichnung, die nicht ein Kindelement benennt, sondern zum Elternelement wechselt, in diesem Fall also das ''LinearLayout'', in dem die ''TextView'' eingebettet ist. Im Kontext dieses ''LinearLayout'' ist der restliche Pfad, nämlich der ''Button'' mit der ''resource-id'' mit dem Wert ''on'', eindeutig.<br />
<br />
Der XPath-Standard bietet noch sehr viel mehr Ausdrucksmittel. Mit der hier knapp vorgestellten Auswahl ist es aber bereits möglich für die meisten praktischen Testfälle gute Pfade zu formulieren. Eine vollständige Einführung in XPath ginge über den Umfang dieser Einführung weit hinaus. Sie finden zahlreiche weiterführende Dokumentationen im Web und in Büchern.<br />
<br />
Eine universelle Strategie zum Erstellen guter XPaths gibt es nicht, da sie von den Testanforderungen abhängt. In der Regel ist es sinnvoll, den XPath kurz und dennoch eindeutig zu halten. Häufig lassen sich Elemente über Eigenschaften identifizieren wie beispielsweise ihren Text. Will man aber gerade den Text eines Elements auslesen, kann dieser natürlich nicht im Pfad verwendet werden, da er vorher nicht bekannt ist. Ebenso wird der Text variieren, wenn die App mit verschiedenen Sprachen gestartet wird.<br />
<br />
Jeder Baustein, der auf einem Element arbeitet, hat einen Eingangspin für den XPath. Im GUI-Browser finden Sie in der Mitte oben eine Liste von Bausteinen mit Aktionen, die Sie auf das ausgewählte Element anwenden können. Suchen Sie den Baustein ''Click'' (8) im Ordner Elements und wählen Sie ihn aus (Abb. 1). Er wird im rechten Teil unter "''Test''" eingefügt, der Pin für den XPath ist mit dem automatisch generierten Pfad des Elements vorbelegt (9). Sie können den Baustein hier auch ausführen. Die Ansicht wechselt dann auf "''Lauf''". Ändert sich durch die Aktion der Zustand Ihrer App, müssen Sie den Baum anschließend aktualisieren (10).<br />
<br />
Wenn Sie in der unteren Liste eine Eigenschaft auswählen, wechselt die Anzeige der Bausteine zu "''Eigenschaften''", wo Sie die eigenschaftsbezogenen Bausteine finden. Wie bei den Aktionen können Sie auch hier einen Baustein auswählen, der dann rechts in Test mit dem Pfad des Elements und der ausgewählten Eigenschaft eingetragen wird, sodass Sie ihn direkt ausführen können.<br />
<br />
== Weitere Locator-Strategien ==<br />
Appium bietet neben XPath noch weitere Strategien zur Adressierung von Elementen an. Einige davon stehen Ihnen '''ab Version 20.1''' ebenfalls mit expecco zur Verfügung. Diese sind nicht ganz so mächtig wie XPath, dafür aber häufig schneller bei der Auflösung auf dem Gerät. Insbesondere bei der Verwendung mit iPhones, wo die Hierarchie bei jeder XPath-Auflösung erst aufgebaut werden muss, bieten alternative Strategien einen Vorteil für die Laufzeit.<br />
<br />
XPath ist weiterhin der Standard, das heißt alle Locator ohne besondere Angabe werden als XPath interpretiert. Um eine der anderen Strategien zu verwenden, schreiben Sie diese mit einem Gleichzeichen vor den gewünschten Locator. Diese Technik können Sie sowohl an den Blöcken verwenden, als auch im GUI-Browser testen.<br />
<br />
{|<br />
|-<br />
| style="vertical-align:top" | AccessibilityId || style="padding-bottom:0.5em" | Verwendet den Wert des Elements, der dazu dient, die App barrierefrei zu machen. Für iOS ist das das Attribut '''Accessibility-id''', für Android das Attribut '''content-descr'''. ''Beispiel: accessibilityId=Löschen''<br />
|-<br />
| style="vertical-align:top" | className || style="padding-bottom:0.5em" | Verwendet den Namen der Klasse des Elements. ''Beispiel: className=android.widget.FrameLayout''<br />
|-<br />
| style="vertical-align:top" | id || style="padding-bottom:0.5em" | Verwendet die Kennung des Elements. Für iOS ist das das Attribut '''name''', für Android das Attribut '''resource-id'''. ''Beispiel: id=android:id/text1''<br />
|-<br />
| style="vertical-align:top" | iOSClassChain<sup>1</sup> || style="padding-bottom:0.5em" | Verwendet die Hierarchie der Elemente ähnlich wie bei XPath. Eine Erklärung zum Aufbau finden Sie [https://github.com/facebookarchive/WebDriverAgent/wiki/Class-Chain-Queries-Construction-Rules hier]. ''Beispiel: iOSClassChain=XCUIElementTypeWindow/XCUIElementTypeButton[`label == "Ok"`]''<br />
|-<br />
| style="vertical-align:top; padding-right:1em" | iOSNsPredicateString<sup>1</sup> || style="padding-bottom:0.5em" | Verwendet einfache Kriterien, wie Attribute, die auch kombiniert werden können. ''Beispiel: iOSNsPredicateString=type == 'XCUIElementTypeButton' AND name == 'Weiter'''<br />
|-<br />
| style="vertical-align:top" | name<sup>1</sup> || style="padding-bottom:0.5em" | Verwendet den Namen des Elements. ''Beispiel: name=Bestätigen''<br />
|-<br />
|}<br />
<br />
:<sup>1</sup> ''nur für iOS''<br />
<br />
Um eine direkte Beschleunigung mit iOS zu erzielen, ohne dass Sie Ihre bisherigen Pfade anpassen müssen, wandelt expecco zudem Pfade, die nur aus einem Element mit Klasse und name-Attribut bestehen, zur Laufzeit automatisch in einen entsprechenden Locator der Strategie iOSNsPredicateString um. Wenn Sie einen Pfad explizit als XPath markieren, wird diese Anpassung nicht vorgenommen.<br />
<br />
=<span id="troubleshooting"><!-- Referenced by error dialog on connection error --></span>Probleme und Lösungen=<br />
==Locator sind Versionsabhängig oder variabel ==<br />
Dann sollten Sie die Locator (xPath) entweder in einer Variablen<br />
halten oder ein Locator-Mapping in einem Screenplay Anhang definieren. Es ist auch möglich, lediglich Teile des Locators (z.B. Lochtor-Pfad eines Elternelements oder Attributwert) in einer Variable zu halten und im Freezevalue des Locator-Pins mit "$(varName)"einzufügen.<br />
==Unsichtbare UI-Elemente==<br />
Beachten Sie, dass im [[#Recorder|Recorder]] auch Elemente berücksichtigt werden, die Sie auf dem Bildschirm nicht sehen. Schalten Sie daher das Element-Highlighting an oder nutzen Sie die Follow-Mouse-Funktion und den Elementbaum im GUI-Browser, um festzustellen, ob das richtige Element verwendet wird.<br />
==iOS: Kabel nicht zertifiziert==<br />
In manchen Fällen erscheint beim Verbinden eines iOS-Geräts über USB der Hinweis, das verwendete Kabel sei nicht zertifiziert. In diesem Fall hilft es nur, das entsprechende Kabel auszutauschen.<br />
==iOS: Alerts beim Verbinsungsaufbau==<br />
Stellen Sie sicher, dass beim Verbindungsaufbau mit einem iOS-Gerät keine Alerts geöffnet sind. Der Aufbau schlägt sonst fehl, da die App nicht in den Vordergrund kommen kann. Siehe auch [[#iOS-Ger.C3.A4t_und_App_vorbereiten|iOS-Gerät und App vorbereiten]].<br />
==iOS: .ipa installieren nicht möglich==<br />
Beachten Sie, dass auf iOS-Simulatoren keine ''.ipa''-Dateien sondern nur ''.app''-Dateien installiert werden können.<br />
==Android: Gerät nicht im Verbindungsdialog==<br />
Wenn ein über USB angeschlossenes Android-Gerät nicht im Verbindungsdialog auftaucht, versuchen Sie, den USB-Verbindungstyp zu ändern. In der Regel sollten MTP oder PTP funktionieren. Prüfen Sie nochmal, ob "USB Debugging" in den Entwicklereinstellungen des Geräts aktiviert ist (diese Einstellungen sind bei manchen Geräten zunächst unsichtbar, und müssen durch einen Trick zugänglich gemacht werden). Siehe auch [[#Android-Ger.C3.A4t_vorbereiten|Android-Gerät vorbereiten]].<br />
<br />
==Android: Softkeys==<br />
Bei Android-Geräten, die Softkeys automatisch ein- und ausblenden, kann es vorkommen, dass der Recorder im unteren Bereich Elemente abschneidet, die durch die Softkeys verdeckt würden, auch wenn sie zu diesem Zeitpunkt gar nicht angezeigt werden. In diesem Fall hift es, die Softkeys so einzustellen, dass sie permanent angezeigt werden.<br />
<br />
==Keine Aktion bei Klick==<br />
Der Baustein zum Klicken auf ein Element ist erfolgreich, aber auf dem Gerät wurde keine Aktion ausgeführt.<br />
:Dies kann vorkommen, wenn das Element von einem anderen Element verdeckt ist und ein Klick auf das Element deshalb nicht möglich ist. In diesem Fall wird von Appium kein Fehler geworfen, sondern es passiert einfach nichts. Wenn Sie dennoch einen Klick an der Position des Elements machen möchten, auch wenn es verdeckt ist, benutzen Sie stattdessen den Baustein ''Tap'' und übergeben Sie diesem die Position des Elements (''Get Location''). Wenn Sie stattdessen vor einem Klick prüfen möchten, ob das Element zu diesem Zeitpunkt verdeckt ist, versuchen Sie, ob Ihnen die Eigenschaften ''Is Displayed'' oder ''Is Enabled'' weiterhelfen.<br />
<br />
==Kein Update nach Aktion==<br />
Über den Recorder wurde eine Aktion ausgeführt, für die auch ein Baustein aufgezeichnet wurde, der Recorder zeigt aber immer noch das alte Bild.<br />
:Der Recorder zeigt kein Livebild des Geräts, sondern immer nur eine Momentaufnahme. Nachdem eine Aktion ausgeführt wurde, aktualisiert sich der Recorder automatisch. Es kann aber vorkommen, dass das Bild schon aktualisiert wurde, bevor die Auswirkungen der Aktion auf dem Gerät vollständig abgeschlossen sind. In diesem Fall sollten Sie den Recorder von Hand aktualisieren über das Symbol mit den blauen Pfeilen, siehe Beschreibung zum [[#Recorder|Recorder]].<br />
<br />
=="clickable" Attribut falsch==<br />
Ein Element hat im "''clickable''" Attribut/Property den Wert "''false''", ist aber dennoch anklickbar.<br />
:Das "''clickable''" Attribute muss explizit vom App-Programmierer gesetzt werden, und hat tatsächlich keine Relevanz für das tatsächliche Verhalten der App. Sie sollten dieses Attribut i.A. in Ihren Tests nicht beachten.<br>Leider existieren viele Apps, bei denen der Programmierer hier "lazy" war.<br />
<br />
==Verbindungsaufbau schlägt fehl==<br />
Schlägt der Verbindungsaufbau mit dem Appium-Server fehl, erhalten Sie in expecco eine Fehlermeldung ähnlicher der unten abgebildeten.<br />
<br />
[[Datei:MobileTestingVerbindungsfehler.png]]<br />
<br />
Hier sehen Sie die Art des aufgetretenen Fehlers. Klicken Sie auf "''Details''" um nähere Informationen zu erhalten. Mögliche Fehler sind:<br />
*''org.openqa.selenium.remote.UnreachableBrowserException''<br />
:Der angegebene Server läuft nicht oder ist nicht erreichbar. Überprüfen Sie die Serveradresse.<br />
*''org.openqa.selenium.WebDriverException''<br />
:Lesen Sie in den Details in der ersten Zeile die Meldung hinter ''Original Error'':<br />
:*''Unknown device or simulator UDID''<br />
::Entweder ist das Gerät nicht richtig angeschlossen oder die udid stimmt nicht.<br />
:*''Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65''<br />
::Dieser Fehler kann verschiedene Ursachen haben. Entweder konnte tatsächlich der WebDriverAgent nicht gebaut werden, weil die Signierungseinstellungen falsch sind oder das passende Provisioning Profile fehlt. Lesen Sie dazu den Abschnitt zur [[#Signierung|Signierung]]. Es kann auch sein, dass der WebDriverAgent auf dem Gerät nicht gestartet werden kann, weil sich beispielsweise ein Alert im Vordergrund befindet oder Sie dem Entwickler nicht vertraut haben.<br />
:*''Could not install app: 'Command 'ios-deploy [...] exited with code 253'''<br />
::Die angegebene App kann nicht auf dem iOS-Gerät installiert werden, weil es nicht im Provisioning Profile der App eingetragen ist.<br />
:*''Bad app: [...] App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name.'''<br />
::Der Pfad zur App ist falsch. Stellen Sie sicher, dass sich die Datei unter dem angegebenen Pfad auf dem Mac befindet.<br />
:*''packageAndLaunchActivityFromManifest failed.''<br />
::Die angegebene ''apk''-Datei ist vermutlich kaputt.<br />
:*''Could not find app apk at [...]''<br />
::Der Pfad zur App ist falsch. Stellen Sie sicher, dass sich die ''apk''-Datei am angegebenen Pfad befindet.<br />
<br />
<br />
Falls der Fehler nicht durch eine der oben gelisteten Ursachen bedingt ist, kann es sein, dass die auf dem Gerät befindlichen Automation-Anwendungen nicht mehr richtig funktionieren. Hier hilft es, diese vom Mobilgerät zu deinstallieren. Beim nächsten Verbindungsaufbau werden sie dann automatisch neu installiert.<br />
<br />
*Für iOS-Geräte ist das der WebDriverAgent, den Sie einfach vom Home-Screen deinstallieren können. Dies behebt in der Regel Probleme durch den Wechsel des verwendeten Macs oder der Xcode-Version.<br />
<br />
*Für Android-Geräte ist es der UIAutomator2; hier tritt auf einigen Geräten sporadisch ein Problem auf, die Ursache dafür ist uns z.Z. noch nicht bekannt. Zur Deinstallation navigieren Sie auf dem Gerät zu "''Einstellungen''" > "''Anwendungen''"<sup>*</sup> und suchen in der Liste nach folgenden Einträgen:<br />
Appium Settings<br />
io.appium.uiautomator2.server<br />
io.appium.uiautomator2.server.test<br />
:Klicken Sie auf die jeweilige Anwendung und dann auf "''Deinstallieren''".<br />
<sup>*</sup>''Der entsprechende Eintrag heißt auf manchen Geräten möglicherweise etwas anders.''<br />
<br />
<br />
Falls dies nicht hilft, kann eventuell die Ausgabe des Appium-Servers weiterhelfen. Für einen von expecco gestarteten Server finden Sie das Log in der Liste der [[#Laufende_Appium-Server|laufenden Appium-Server]].<br />
<br />
==Ich habe keinen Mac==<br />
Vielleicht hilft Ihnen diese Webseite weiter: [https://www.howtogeek.com/289594/how-to-install-macos-sierra-in-virtualbox-on-windows-10 https://www.howtogeek.com/289594/how-to-install-macos-sierra-in-virtualbox-on-windows-10]</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Mobile_Testing_Plugin/en&diff=24499Mobile Testing Plugin/en2021-10-28T14:31:09Z<p>Mb: /* Hybrid Apps and WebViews */</p>
<hr />
<div>= Introduction =<br />
With the ''Mobile Testing Plugin'' applications can be tested on Android and iOS devices. This includes both real and emulated devices. It does not matter whether real mobile devices or emulated devices are used. The plugin can (and usually is) used in conjunction with the [[Expecco_GUI_Tests_Extension_Reference|GUI-Browser]], which supports the creation of tests. It can also be used to record test procedures.<br />
<br />
[http://appium.io/ Appium] is used to connect to the devices. Appium is a free open source framework for testing and automating mobile applications.<br />
<br />
We recommend editing the [[#Tutorial|Tutorial]] to familiarize yourself with the Mobile Plugin. This tutorial leads step by step through the creation of a test case using an example and explains the necessary basics.<br />
<br />
= Installation and Setup =<br />
To use the ''Mobile Testing Plugin'', you must have installed expecco together with the corresponding plugin, and you need the appropriate licenses. expecco communicates with the mobile devices via an Appium server, which either runs on the same computer as expecco, or on a second computer. This must be accessible for expecco.<br />
<br />
== Installation Overview ==<br />
'''Computer running expecco:'''<br />
* Java JDK version 8, 9, 10 or 11<br />
'''Computer connected to Android devices :'''<br />
* Appium Server, you can install it via the Mobile Testing Supplement (see below), of which we regularly provide a new version<br />
* Android SDK, you can also get it with the Mobile Testing Supplement<br />
* Java JDK version 8, 9, 10 or 11<br />
'''Computer connected to iOS devices<sup>*</sup>:'''<br />
* Appium Server, you can install it via the Mobile Testing Supplement for MacOS (see below), of which we regularly provide a new version<br />
* Xcode in a version that supports the iOS version used, available from the Apple App Store<br />
* Java JDK version 8, 9, 10 or 11<br />
* Apple Developer Certificate incl. matching private key (to sign the WebDriverAgent)<br />
* Provisioning Profile for the mobile devices to be used<br />
<br />
<sup>*</sup> Please note that due to the requirements (no connection to non-Apple devices available) iOS devices can only be controlled from a Mac.<br />
<br />
Depending on the setup, the above-mentioned computers can also be the same device. expecco can either connect to a remote Appium Server and mobile devices connected to it via the network, or start an Appium Server locally itself and use it with local mobile devices. However, some of expecco's functions that make it easier to create test cases are only available if the mobile devices are connected to the same computer on which expecco is running. A possible setup may therefore look like the following figure:<br />
<br />
[[Datei:MobileTestingAufbau.png | 400px]]<br />
<br />
The following explains how to install Appium and other necessary applications for Windows and Mac OS.<br />
<br />
== Windows ==<br />
The easiest way is to install everything from our Mobile Testing Supplement. However, newer versions do not contain a JDK anymore due to a change in Oracle's license terms, so you have to install it additionally.<br />
*'''expecco 20.1''': [https://download.exept.de/transfer/h-expecco-20.1.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.10.1.0]<br />
:Only minor changes compared to the previous version.<br />
*expecco 19.2: [http://download.exept.de/transfer/h-expecco-19.2.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.10.0.0]<br />
:Compared to the previous version, Appium was updated to version 1.16.0-rc.1 and node 12 is used. <br />
*expecco 19.1: [http://download.exept.de/transfer/h-expecco-19.1.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.8.1.0]<br />
:This installs Appium in the version 1.12.0 and now additionally contains build-tools in the version 28.0.3 in the android-sdk. Apart from this, it is the same as the previous version.<br />
*expecco 18.2: [http://download.exept.de/transfer/h-expecco-18.2.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.7.3.0]<br />
:This installs Appium in the version 1.8.1. In addition, an installation of ''Android Debug Bridge'' and ''Google USB Driver'' ([https://gsmusbdrivers.com/download/adb-fastboot-drivers/ adb-setup-1.4.3]) is offered. This covers drivers for a broad range of Android devices, and you won't have to install an individual driver for each device. A '''JDK is not contained anymore (due to a change in Oracle's license terms)''', you have to download it on your own, e.g. from [https://www.oracle.com/technetwork/java/javase/downloads/index.html Oracle].<br />
*expecco 18.1: same procedure as for expecco 2.11<br />
*expecco 2.11: [http://download.exept.de/transfer/h-expecco-2.11.1/MobileTestingSupplement_1.6.0.2_Setup.exe Mobile Testing Supplement 1.6.0.2]<br />
:This installs a Java JDK Version 8, android-sdk and Appium Version 1.6.4. The supplement also offers a universal adb driver ([http://download.clockworkmod.com/test/UniversalAdbDriverSetup.msi ClockworkMod]). This driver supports a wide range of Android Devise, and avoids the need to search for individual device-specific drivers.<br />
*expecco 2.10: [http://download.exept.de/transfer/h-expecco-2.10.0/Mobile_Testing_Supplement_1.5.0.0_Setup.exe Mobile Testing Supplement 1.5.0.0]<br />
:It installs a Java JDK version 8, android-sdk and Appium version 1.4.16. During the installation the graphical user interface of Appium is started, you can close this window immediately. The supplement also offers a universal adb driver (ClockworkMod). This combines drivers for a wide range of Android devices so that you do not have to search for and install a separate driver for each device.<br />
<br />
If expecco has to use mobile devices that are connected to another computer, you have to start an Appium server there. You can do this by using the file <code>appium_standalone.cmd</code>. The server is then started on default port 4723. If you want to use a different port number, start the server with<br />
<br />
appium_standalone.cmd -p <portnummer><br />
<br />
The server is ready, as soon as the line<br />
<blockquote>Appium REST http interface listener started on 0.0.0.0:4723</blockquote><br />
is displayed, where you can read the used port number at the end.<br />
<br />
If your Android device is connected to a remote machine,<br />
you may want to see the live screen locally using a tool like<br />
[https://github.com/Genymobile/scrcpy scrcpy].<br />
<br />
<br />
When Appium is started for the first time – either standalone or by expecco – it may happen that the Windows firewall blocks access to the node server. Allow the access or Appium cannot be started.<br />
<br />
== Mac OS ==<br />
Note: the following can be ignored if you do not plan to test iOS (iPhone) devices. The Mac setup is not needed for Android devices.<br />
<br />
=== Xcode ===<br />
Automation with iOS devices needs [https://developer.apple.com/xcode/ Xcode]. You can install it from the App Store. Please make sure that the version matches the tested iOS versions:<br />
{| class="wikitable"<br />
|-<br />
|'''iOS'''&nbsp;&nbsp; <br />
|'''Xcode'''<br />
|'''macOS'''<br />
|-<br />
|10.x<br />
|8.x<br />
|10.12 (Sierra)<br />
|-<br />
|11.x<br />
|9.x<br />
|10.13 (High Sierra)<br />
|-<br />
|12.x<br />
|10.x<br />
|10.14 (Mojave)<br />
|-<br />
|13.x<br />
|11.x<br />
|10.15 (Catalina)<br />
|}<br />
The minor versions must also fit, for iOS 10.2 at least Xcode 8.2, for iOS 10.3 at least Xcode 8.3, etc. So if you are upgrading to a newer iOS version, you will usually need a newer Xcode version as well. Newer versions of Xcode may not run on older operating systems, which in turn may require an operating system upgrade. If you also want to test older iOS versions, it can be useful to install the corresponding Xcode versions in parallel.<br />
<br />
Also see [https://en.wikipedia.org/wiki/Xcode#Version_comparison_table Xcode versions].<br />
<br />
=== Appium ===<br />
You can install Appium via the Mobile Testing Supplement for Mac OS:<br />
* '''expecco 20.2''': [https://download.exept.de/transfer/h-expecco-20.2.0/Mobile_Testing_Supplement_for_Mac_OS.tar.bz2 Mobile Testing Supplement for Mac OS (1.2.2)]<br />
:Contains Appium version 1.18.3 and uses node 14.<br />
<br />
* expecco 20.1: [https://download.exept.de/transfer/h-expecco-20.1.0/Mobile_Testing_Supplement_for_Mac_OS.tar.bz2 Mobile Testing Supplement for Mac OS (1.2.0)]<br />
:Only a few changes compared to the previous version.<br />
<br />
* expecco 19.2: [http://download.exept.de/transfer/h-expecco-19.2.0/MobileTestingSupplement_for_MacOS.tar.bz2 Mobile Testing Supplement for Mac OS (1.1.98)]<br />
:Appium is updated to version 1.16.0-rc.1 and node 12 is used.<br />
<br />
* expecco 19.1: [http://download.exept.de/transfer/h-expecco-19.1.0/Mobile_Testing_Supplement_for_Mac_OS_1.1.96.tar.bz2 Mobile Testing Supplement for Mac OS (1.1.96)]<br />
:This version contains Appium 1.12.0.<br />
<br />
* expecco 18.1: [http://download.exept.de/transfer/h-expecco-18.1.0/Mobile_Testing_Supplement_for_Mac_OS_1.1.94.tar.bz2 Mobile Testing Supplement for Mac OS (1.1.94)]<br />
:This version contains Appium 1.8.0.<br />
<br />
* expecco 2.11:[http://download.exept.de/transfer/h-expecco-2.11.1/Mobile_Testing_Supplement_for_Mac_OS_1.0.94.tar.bz2 Mobile Testing Supplement for Mac OS (1.0.94)]<br />
:This version contains Appium 1.6.4.<br />
<br />
* expecco 2.10: [http://download.exept.de/transfer/h-expecco-2.10.0/Mobile_Testing_Supplement_for_Mac_OS_1.0.tar.bz2 Mobile Testing Supplement for Mac OS]<br />
:Diese Version entält Appium 1.4.16.<br />
<br />
After you have downloaded the supplement, you can move it to a directory of your choice (e.g. your home directory) and unpack it there. A suitable command in a shell could look like this, adjust the version number accordingly:<br />
<br />
tar -xvpf Mobile_Testing_Supplement_for_Mac_OS_1.1.98.tar.bz2<br />
<br />
If your default Xcode installation is the one you want to use, you can start Appium directly from the file in the ''bin'' directory with the appropriate version number:<br />
<br />
Mobile_Testing_Supplement/bin/start-appium-1.16.0-rc.1<br />
<br />
If you want to use another Xcode than the one configured as default, you have to tell Appium the corresponding path by using the environment variable ''DEVELOPER_DIR''. For example, if you have installed Xcode in ''/Applications/Xcode-11.3.app'', you can start Appium this way:<br />
<br />
DEVELOPER_DIR="/Applications/Xcode-11.3.app/Contents/Developer" Mobile_Testing_Supplement/bin/start-appium-1.16.0-rc.1<br />
<br />
To find out what is set as the default Xcode installation on your system, use this command:<br />
<br />
xcode-select -p<br />
<br />
If Appium cannot find your Xcode installation, a message like this appears:<br />
''<blockquote>org.openqa.selenium.SessionNotCreatedException - A new session could not be created. (Original error: Could not find path to Xcode, environment variable DEVELOPER_DIR set to: /Applications/Xcode.app but no Xcode found)</blockquote>''<br />
In such a case, restart Appium by specifying a valid ''DEVELOPER_DIR''.<br />
<br />
=== Signing ===<br />
To establish a test connection with a device, you need an Apple account. For evaluation you can use a free account. This has the disadvantage that created profiles are only valid for one week and must be recreated afterwards. Also be careful when sharing the account, as certificates may be revoked or invalidated by automatic generation. As a result, apps that have already been signed can no longer be used.<br />
<br />
First, connect the device you want to use to your Mac via USB. Start Xcode and open ''Preferences''. Go to the Accounts page and create an entry with your account. You can then click on ''Manage Certificates...'' to see the certificates that belong to that account. To run tests, you need an iOS Development Certificate and the associated private key. If you do not already have one, create one. If you already have one, but it is not in your keychain (indicated by "Not in Keychain"), you can import it. In any case, open the keychain management on your Mac and select the keychain ''login''. If you want to import a certificate from a PKCS#12-Datei (Endung typischerweise .p12), you can do this via the menu File > ''Import objects''. If you don't know where the certificate is stored, you can also revoke it in Xcode and recreate it in your keychain. However, only do this if you know that the old certificate is no longer in use because it can no longer be used afterwards. Now the keychain should contain an iOS development certificate. From the right-click menu, select Information. Under the details of the certificate you will find the Team ID, which is referred to here as the Organizational Unit. Enter it in the Team ID field of the plug-in's settings, see [[#Plugin_Configuration|Plugin Configuration]].<br />
<br />
Return to Xcode und select ''Open...'' in the menue ''File'', to open the WebDriverAgent project. This is found in the Mobile Testing Supplements folder under<br />
''<nowiki>Mobile_Testing_Supplement/lib/node_modules/appium-1.16.0-rc.1/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj</nowiki>''<br />
<br />
[[Datei:MobileTestingWebDriverAgentXcode.png]]<br />
<br />
Select ''WebDriverAgentLib'' and the page ''Signing & Capabilities''. In the section ''Signing'' set the option ''Automatically manage signing'' and then select a team. Now switch to ''WebDriverAgentRunner'' and do the same there.<br />
<!-- (The following seems to not be relevant anymore.) Here you should see errors indicating that no Provisioning Profiles have been created or found. Therefore, go to the ''Build Settings'' page and look for the entry ''Product Bundle Identifier'' in the ''Packaging'' section. Change this from com.facebook.WebDriverAgentRunner to something Xcode accepts by changing the prefix. Xcode can now generate a matching Provisioning Profile and the errors on the General page should disappear. After that you can quit Xcode. --><br />
By setting the team, the errors showing up for WebDriverAgentRunner should disappear. After that you can quit Xcode.<br />
<br />
If you now connect to your device from expecco, the WebDriverAgent will be installed and started on it and then switch to the app to be tested. On the device, however, the execution of the WebDriverAgent must still be trusted. To do this, open the settings during the connection setup on the device and then the entry Device management under General. This entry is only visible if a developer app is installed on the device. You may therefore have to wait until the WebDriverAgent is installed before the entry appears. Select the entry of your Apple account and trust it. Since the WebDriverAgent will be uninstalled again if the start did not work, you have to do this during the connection setup. If this is too hectic for you, you can also execute the following code:<br />
<br />
''xcodebuild -project Mobile_Testing_Supplement/lib/node_modules/appium-1.16.0-rc.1/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=<udid>' test''<br />
<br />
This installs the WebDriverAgent on the device without deleting it again. Refer to the [https://support.apple.com/en-us/HT204460 Apple documentation] for details on installing and trusting such apps.<br />
<br />
== Plugin Configuration ==<br />
Before you start, please check the settings of the Mobile Testing Plugin and adjust them if necessary. Select the menu item "''Extras''" &#8594; "''Settings''" &#8594; "''Extensions''" &#8594; "''Mobile Testing''" (see fig.). By default, these paths are found automatically (1). To adjust a path manually, deactivate the corresponding check mark at the right. You'll see a drop-down list with some paths to choose from. If an entered path is wrong or cannot be found, the field is marked red and a message appears. Make sure that all paths are specified correctly.<br />
<br />
[[Datei:MobileTestingEinstellungen.png | thumb | 400px | Plugin Configuration]]<br />
<br />
*'''appium''': Enter the path to the executable file with which Appium can be started in the command line. Under Windows this file will usually be called "<code>appium.cmd</code>". This path is used when expecco starts an Appium server.<br />
*'''node''': Enter the path to the executable that starts Node (also called (also called "Node.js"). This path is passed to Appium when a server is started so that Appium can find it independently of the PATH variable. Under Windows this file is usually called "<code>node.exe</code>".<br />
*'''JAVA_HOME''': Enter the path to a JDK (Java Development Kit)here. This path is passed to each Appium server. Leave the field blank to use the value from the environment variable. To specify which Java should be used by expecco, set this path in the Java Bridge settings.<br />
*'''ANDROID_HOME''': Enter the path to an Android SDK here. This path is passed to each Appium server. Leave the field blank to use the value from the environment variable.<br />
*'''adb''': The path to the adb command. Under Windows the file is called "<code>adb.exe</code>". This file is used by expecco, for example, to get the list of connected devices. This path should be selected automatically, if the command is found in the ANDROID_HOME directory. This is also used by Appium. If expecco and Appium use different versions of adb, conflicts may occur.<br />
*'''android.bat''': This file is only needed to start the AVD and the SDK Manager, which deal with phone emulators. The file in the ANDROID_HOME directory will be selected automatically, if present there.<br />
*'''aapt''': The path to the "aapt" command here. Under Windows this file is called "<code>aapt.exe</code>". expecco uses "aapt" only in the connection editor to read the package and activities of an "apk" file. The file in the ANDROID_HOME directory will be selected automatically, if present there.<br />
<br />
[[Datei:MobileTestingJavaBridgeEinstellungen.png | thumb | 400px | JDK Configuration]]<br />
<br />
Starting with expecco 2.11, there is an additional field called ''Team ID''. If you run iOS tests, enter the Team ID of your certificate here. This is used for every iOS connection, unless you change the value in the connection settings in individual cases. For information on how to obtain the team ID, please refer to the section on [[#Signing| signing]] for installations on Mac OS. With expecco 2.10 and older, you can only enter the Team ID as capability for each connection setting separately. However, you must use the [[#Extended_View|extended view]] to do this. Enter the capability ''xcodeOrgId'' here and set the Team ID of the certificate as value.<br />
<br />
The server address setting at the bottom of the page refers to the behavior of the connection editor. It checks at the end whether the server address ends in ''/wd/hub'' as this is the usual form. If not, a dialog asks how to react. The defined behavior can be viewed and changed here.<br />
<br />
Also switch to the entry ''Java Bridge'' (see figure). Here you have to specify the path to your Java installation, which is used by expecco. Enter a JDK here. If you want to use the one from the Mobile Testing Supplement under Windows, the path is<br />
<nowiki>C:\Program Files (x86)\exept\Mobile Testing Supplement\jdk</nowiki><br />
You can also use the system settings.<br />
<br />
== Prepare Android Device ==<br />
If you connect an Android device under Windows, you may still need an adb driver for the device. You can usually find a suitable driver on the manufacturer's website. If you have installed the universal driver from the Mobile Testing Supplement, everything should already work for most devices. In some cases, Windows will automatically try to install a driver when you connect the device for the first time. <br><br />
'''Attention''': Before you can control a mobile device with the Appium plugin, you have to allow this debugging!<br />
<br />
For Android devices, you can find this option in the settings under ''[https://developer.android.com/studio/debug/dev-options Developer Options]'' called ''USB-Debugging''. If the developer options are not displayed, you can unlock them by tapping Build Number seven times in About the Phone.<br />
<br />
Also enable the ''Stay awake'' feature to prevent the device from turning off the screen during test creation or execution.<br />
<br />
For security reasons, USB debugging must be allowed for each computer individually. When connecting the device to the PC via USB, you must agree to the connection on the device. If you haven't done this for your computer yet, but no corresponding dialog appears on the device, it may help to unplug and reconnect the device. This can happen especially if you have installed the ADB driver while the device was already connected via USB. If this doesn't help either, open the notifications by dragging them from the top of the screen. There you will find the USB connection and you can open the options. Select another type of connection; usually MTP or PTP should work.<br />
<br />
You can also test on an emulator. It does not need to be prepared separately, as it is already designed for USB debugging. It is even possible to start an emulator at the beginning of the test.<br />
<br />
To check if a device you have connected to your computer can be used, open the [[#Connection_Editor|connection editor]]. The device should be displayed there.<br />
<br />
=== Connection via WLAN ===<br />
It is possible to connect to Android devices via Wireless LAN. To prepare and enable this, you have to connect initially via USB. Open a command window (terminal window) and enter:<br />
<nowiki>adb tcpip 5555</nowiki><br />
The device listens for a TCP/IP connection on port 5555. If you have several devices connected or emulators running, you have to specify which device you mean. Enter in this case:<br />
<nowiki>adb devices -l</nowiki><br />
to get a list of all devices, where the first column gives the device's ID.<br />
Then, enter:<br />
<nowiki>adb -s <deviceID> tcpip 5555</nowiki><br />
with the device identification of the desired device. You can now disconnect the USB connection.<br>Now you have to find out the IP address of your device. You can usually find it somewhere in the device's settings, for example in the Status or WLAN settings of the phone. Then type in:<br />
<nowiki>adb connect <IP address of device></nowiki><br />
The device should now be connected via WLAN and can be used in the same way as with a USB connection. You can check this by entering "<code>adb devices -l</code>" again or open the connection dialog in expecco. In the list, the device appears with its IP address and port. Remember that the WLAN connection no longer exists when the ADB server or the device is restarted.<br />
<br />
== Preparing an iOS-Device and App ==<br />
Control of iOS devices is only possible via a Mac. Please also read the section [[#Mac_OS|Installation under Mac OS]].<br />
<br />
Before you can control a mobile device with the Mobile Testing Plugin, you must allow debugging for iOS devices with iOS 8 or higher. Activate the option "''Enable UI Automation''" under the "''Developer''" menu in the device settings.<br>If you cannot find the "''Developer''" entry in the settings, proceed as follows: Connect the device to the Mac via USB. If necessary, you must still agree to the connection on the device. Start Xcode and then select "''Devices''" from the menu bar at the top of the screen in the "''Window''" menu. A window opens in which a list of the connected devices is displayed. Select your device there. Then the entry "''Developer''" should appear in the settings on the device. You may have to exit the settings and restart.<br />
<br />
[[Datei:Alert.png | thumb | 270px | Alert unter iOS]]<br />
It is not possible to establish a connection to the device as long as it shows certain alerts. Such an alert may appear if FaceTime is activated (by displaying a message about SMS charges as shown in the screenshot). Be sure to configure the device so that it does not show such alerts when idle.<br />
<br />
=== expecco 2.11 and later ===<br />
You can test any app which is executable or already installed on the device used. If the app is available as a development build, the UDID of the device must be stored in the app. In any case, the WebDriverAgent must be signed for the device. Please read the section about [[#Signing|signing]] under Mac OS.<br />
<br />
If you want to use the Home button in a test, you must activate "AssistiveTouch" on the device. You will find this option in the settings under "''General''" > "''Operating Help''" > "''AssistiveTouch''". Then place the menu in the middle of the upper edge of the screen. You can then record pressing the Home button with the corresponding menu entry in the recorder or use the "''Press Home Button''" block directly.<br />
<br />
=== expecco 2.10 ===<br />
The app you want to use must be available as a development build. The UDID of the device must also be stored in the app.<br />
<br />
=== Sign the development build ===<br />
A development build of an app is only allowed for a limited number of devices and cannot be started on other devices. However, it is possible to exchange the certificate and the usable devices in a development build.<br />
<br />
* Evaluation with demo app of eXept:<br />
:We will be happy to provide you with a demo app which is available as a development build and which we can sign for your device. Please send the UDID of your device to your eXept contact person. How to determine the UDID of your device is described in the following section.<br />
<br />
* Using your own app for your test device:<br />
:If you receive a development build (IPA file) from the app developers that is approved for your test device, you can use it directly. To do this, you must tell the developers the UDID of your device so they can enter it. '''You can use Xcode to read the UDID of a device'''. Start Xcode and select ''Devices'' from the menu bar at the top of the screen in the ''Window'' menu. A window opens in which a list of the connected devices is displayed. Select your device and search for the ''Identifier'' entry in Properties. The UDID is a 40-digit hexadecimal number.<br />
<br />
* Externally developed app for your test device:<br />
:You can also re-sign apps to make them run on other devices. However, this process is complicated and requires access to an Apple Developer account. A documentation on the procedure is currently in preparation.<br />
<br />
:For the evaluation we will gladly support you with the re-signing of your app..<br />
<!--<br />
Log in to the [https://developer.apple.com/ Apple-Webinterface]. Navigate to ''Certificates, IDs & Profiles''. If necessary, create a Developer Certificate and a Provisioning Profile for your device here and download both. If you don't have a Developer Account yet, create one here: https://developer.apple.com/enroll/. For this you have to register with an Apple-ID.<br />
<br />
# Find out Team ID (''Membership'' -> ''Team ID'')<br />
# Under ''Certificates, IDs & Profiles'' select development certificate (under ''+'' create, if not available) and download<br />
# Under ''App ID'' create Wildcard App ID, if not present. Note App ID (AppID = Prefix.ID)<br />
# Add device, find out UDID (or ''Identifier'') of the device (''Xcode'' -> ''Window'' (above in menu bar) -> ''Devices'')<br />
# Create commission profiles: ''iOS App Development'' -> Select ''AppID'' -> Select certificate -> Select device -> Create profile name -> Download provisioning profiles.<br />
# Import the downloaded certificate (''Downloads'' -> Certificate (.cer)<br />
# Copy SHA1 fingerprint. Right click on Certificate -> ''Information'', then scroll to the bottom of the page).<br />
# Create Entitlements.plist (''Open Terminal' -> Downloads/Mobile_Testing_Supplement/bin/gen-entitlements_plist 'Team-ID' 'App ID' Downloads/Mobile_Testing_Supplement/bin/re-sign-ipa <path to ipa (z.B. Downloads/expeccoMobileDemo.ipa)> \<br />
"<Zertifikat (SHA1-Fingerabdruck, z.B. 76 E8 4B E8 78 D5 D7 F9 2E 09 8B D7 E8 FB CE 30 0C F5 D0 EF)>" \<br />
<Path to Commission Profile (e.g. /Users/exept_test/Downloads/dut.mobileprovision)> \<br />
<Path for the result ipa (z.B. Downloads/expeccoMobileDemo_re-signed.ipa)> \<br />
[Pfad zur entitlements.plist] (z.B. /Users/exept_test/entitlements.plist)<br />
<br />
To re-sign, you can use the corresponding script from the Mobile Testing Supplement for Mac OS or any other tool (e.g. isign).<br />
--><br />
<br />
For more information about using iOS devices, see also the <br />
[http://appium.io/slate/en/master/?java#appium-on-real-ios-devices Appium documentation].<br />
<br />
=== Native iOS-Apps ===<br />
You can also use apps that are already natively present on the device. To do this, you must know their bundle ID and then enter it in the connection settings. Here is a small selection of common apps:<br />
{| style="text-align:left"<br />
! App<br />
!<br />
! Bundle-ID<br />
|-<br />
| App Store<br />
| <br />
| com.apple.AppStore<br />
|-<br />
| Calculator<br />
| <br />
| com.apple.calculator<br />
|-<br />
| Calendar<br />
| <br />
| com.apple.mobilecal<br />
|-<br />
| Camera<br />
| <br />
| com.apple.camera<br />
|-<br />
| Contacts<br />
| <br />
| com.apple.MobileAddressBook<br />
|-<br />
| iTunes Store<br />
| <br />
| com.apple.MobileStore<br />
|-<br />
| Mail<br />
| <br />
| com.apple.mobilemail<br />
|-<br />
| Maps<br />
| <br />
| com.apple.Maps<br />
|-<br />
| Messages<br />
| <br />
| com.apple.MobileSMS<br />
|-<br />
| Phone<br />
| <br />
| com.apple.mobilephone<br />
|-<br />
| Photos<br />
| <br />
| com.apple.mobileslideshow<br />
|-<br />
| Settings<br />
| <br />
| com.apple.Preferences<br />
|}<br />
<br />
You can find further Bundle-IDs [https://github.com/joeblau/apple-bundle-identifiers here].<br />
<br />
= Examples =<br />
In the demo test suites for expecco you will also find examples for tests with the Mobile Testing Plugin. To do this, select the option "''Example from File''" on the start screen and open the folder named "''mobile''".<br />
<br />
==<span id="TestsuiteMobileTestingDemo"><!-- Referenced by m01_MobileTestingDemo.ets --></span> ''m01_MobileTestingDemo.ets'' ==<br />
The test suite contains two simple test plans: "''Simple CalculatorTest''" and "''Complex Calculator and Messaging Test''". Both tests use an Android emulator, which you must start before starting. The apps used in the test are part of the basic equipment of the emulator and therefore no longer need to be installed. Since the apps may differ under every Android version, it is important that your emulator runs under Android 6.0. In addition, the language must be set to English.<br />
<br />
; Simple CalculatorTest<br />
: This test connects to the calculator and enters the formula ''2+3''. The result of the calculator is compared with the expected value ''5''.<br />
<br />
; Complex Calculator and Messaging Test<br />
: This test connects to the calculator and then opens the message service. There it waits for an incoming message from the number ''15555215556'', in which a formula to be calculated is sent. The message is generated before via a socket at the emulator. When the message arrives, it is opened by the test and its contents are read. Then the calculator is opened again, the received formula is entered and the result is read. The test then switches back to the message service and sends the result as an answer.<br />
<br />
== ''m02_expeccoMobileDemo.ets'' und ''m03_expeccoMobileDemoIOS.ets'' ==<br />
These are part of the tutorial for the Mobile Testing Plugin. The included test case is incomplete and will be added during the tutorial. Please read the section [[#Tutorial|Tutorial]].<br />
<br />
= Tutorial =<br />
This tutorial describes the basic procedure for creating tests with the Mobile Testing Plugin. The basis for this is a supplied example consisting of a simple app and an expecco test suite.<br />
<br />
The ''expecco Mobile Demo'' app calculates and checks various everyday codes: the IBAN from European payment transactions, the international GTIN 13 product codes found in retail bar codes, and the serial numbers on euro banknotes.<br />
<br />
The test-suite contains test cases for individual functions of the app. Not all functions are covered yet, but will be added in the course of the tutorial.<br />
<br />
There are two versions of these Tutorials:<br />
*'''[[#First_steps_with_Android|First steps with Android]]'''<br />
*'''[[#First_steps_with_iOS|First steps with iOS]]'''<br />
<br />
The procedure is almost identical in both versions, only the connection configurations are created differently. The finished tests then differ essentially in the paths for addressing the elements used, since these are technology-dependent.<br />
<br />
==<span id="FirstStepsAndroid"><!-- Referenced by m02_expeccoMobileDemo.ets --></span> First steps with Android ==<br />
It is assumed that you have already read the chapter [[#Installation_and_Setup|Installation and Setup]] and completed the necessary preparations for for using iOS devices under Mac OS. Connect the device you want to use to your Mac. Download the iOS version of the [http://download.exept.de/transfer/h-expecco-2.11.0-pre/expeccoMobileDemo.ipa expeccoMobileDemo-App] to your Mac. Since the app is a debug build, you still need to sign it for your device (see [[#Preparing an iOS-Device_and_App|Preparing an iOS-Device and App]]). Now start an Appium server on your Mac.<br />
<br />
=== Step 1: Run Demo ===<br />
Start expecco and open the test-suite ''m02_expeccoMobileDemo.ets'' via the button ''Example from file'' (fig. 1). As of expecco 2.11 this is located in the subfolder ''mobile''. Otherwise download the test-suite [http://download.exept.de/transfer/h-expecco-2.10.0/m03_expeccoMobileDemoIOS.ets m03_expeccoMobileDemoIOS.ets] to the computer where your expecco installation is located and open it. In this test-suite there is already a ready-made test plan with some test cases for this app.<br />
<br />
[[Datei:MobileTestingBeispielÖffnen.png | frame | left | Abb. 1: Beispiel-Testsuite öffnen]]<br />
<br clear="all"><br />
In the test suite the package of the demo app is included as an attachment ''(expeccoMobileDemo-debug.apk)''. With the provided module Export Demo App you can export the file to any location on your computer. Select the device (1) and click on the green play button (2) to execute the device (fig. 2). The block opens a file dialog in which you specify where the package should be saved.<br />
<br />
[[Datei:MobileTestingExportApp.png | frame | left | Abb. 2: App exportieren]]<br />
<br clear="all"><br />
Before we get into the rest of the test-suite, first configure the connection and which device you want to use. To do this, connect a device to your computer via USB or start an emulator.<br />
<br />
[[Datei:MobileTestingVerbinden.png | frame | left | Abb. 3: Verbindungseditor öffnen]]<br />
<br clear="all"><br />
Now open the GUI browser (1) and select the entry ''Mobile Testing'' (3) under ''Connect'' (2) (Fig. 3) to open the connection dialog.<br />
<br />
You will see a list of all connected Android devices (1) (Fig. 3). If your device does not appear in the list, make sure it is turned on and connected via USB. Otherwise read the section [[#Prepare_Android_Device|Prepare Android Device]]<br />
<br />
[[Datei:MobileTestingGerätAuswählen.png | frame | left | Abb. 4: Gerät im Verbindungsdialog auswählen]]<br />
<br clear="all"><br />
Once you have found your device in the list, select it and click ''Next'' (2).<br />
<br />
Next, specify which app you want to use (Fig. 5). You can choose if you want to start an app that is already installed on the device (''App on the device'') or if you want to install and start an app (''Install app''). In case you want to use an already installed app, you will get a list of all packages installed on the device (1), which are divided into system packages and foreign packages (2), as well as their activities (3). You can then simply select these in the respective fields.<br />
<br />
[[Datei:MobileTestingAppAuswählen.png | frame | left | Abb. 5: Auf dem Gerät installierte App angeben]]<br />
<br clear="all"><br />
For this tutorial the app you just exported from the test-suite should be installed. Select ''Install App'' and enter the appropriate path in App (1) (Fig. 6). You can use the button on the left (2) to open a file dialog where you can navigate to the file to enter it. The package (3) and the activity (4) of the app will be entered automatically. If the app has multiple activities, you can select the one you want. Now click on ''Next'' (5).<br />
<br />
[[Datei:MobileTestingAppInstallieren.png | frame | left | Abb. 6: App angeben, die auf dem Gerät installiert werden soll]]<br />
<br clear="all"><br />
On the last page you can see an overview of all previous data (1) (Fig. 7). Below, you can enter a name for the connection under which it will be displayed in the GUI browser (2). In addition, a connection can be identified by this name and used in blocks; the name must therefore be unique. If you do not specify a name, one is generated generically. Enter ''expeccoMobileDemo'' as the name. Enter the address for the Appium server in the field below (3). Appium is the interface, via which the connected devices are controlled. For this tutorial expecco manages the instances of the Appium server. Enter the local default address ''<nowiki>http://localhost:4723/wd/hub</nowiki>''. This is always the lowest entry in the proposal list. In addition the option ''Start if necessary'' is activated (4). expecco then checks if an Appium server is already running at the address and starts and ends it automatically if necessary. If the port ''4723'' is already occupied or if you want to use several connections at the same time, use a different port at this point. It is common to use the odd port numbers above ''4723'', i.e. ''4725'', ''4727'' and so on. Of course you can also use remote servers, but the automatic start and stop of a server can only be done locally by expecco.<br />
<br />
[[Datei:MobileTestingServerkonfiguration.png | frame | left | Abb. 7: Verbindungsnamen und Appium-Server konfigurieren]]<br />
<br clear="all"><br />
Now click on ''Save'' (5) to save the settings for the test execution. Settings can be saved as an attachment to an execution definition or to an external file (Fig. 8). If you have several projects open at the same time, you can select the project in which the attachment is to be created from the list. Click on ''Save'' in the ''Save settings in attachment'' area and enter ''expeccoMobileDemo'' as the name. Now click on ''Start server and connect'' (6) to establish a connection with the specified configuration.<br />
<br />
[[Datei:MobileTestingEinstellungenSpeichern.png | frame | left | Abb. 8: Einstellungen speichern]]<br />
<br clear="all"><br />
It may take a while to establish the connection. Wait until the connection is established and displayed in the GUI browser. You will see that the app is started on the device. Now you know that the configuration works. The saved settings should now be used for the test, which then establishes the same connection. Select the connection in the GUI browser, right-click and select 'Close Connection' from the context menu to avoid any conflict. Then switch back to the test-suite tab.<br />
<br />
In the test suite, the settings were created as an appendix ''expeccoMobileDemo'' (Fig 9). Select the ''Connect'' block (1) and switch to the ''Network'' view on the right (2). Drag and drop the settings into the network of the block (3). Connect the output pin ''pathName'' with the input pin ''stringOrFilename[1]'' of the block ''Connect from File'' (4). Confirm the changes with ''Apply'' (5). This block will establish the connection to the app at the beginning of the test.<br />
<br />
[[Datei:MobileTestingConnectblock.png | frame | left | Abb. 9: Verbindungsbaustein editieren]]<br />
<br clear="all"><br />
Now switch to the test plan ''Demo Test'' (1) (Fig. 10). This test plan already contains some finished test cases. Before and after the execution (2) one block is also entered: The just edited block ''Connect'' for the setup and the block ''Disconnect'' for the disconnection. By entering the two blocks at this point, the connection is terminated, especially if the test is aborted prematurely, e.g. because one of the test cases fails.<br />
<br />
[[Datei:MobileTestingTestplan.png | frame | left | Abb. 10: Testplanausführung]]<br />
<br clear="all"><br />
Now you can start the test plan ''Demo Test'' by clicking on the green Play button (3). The test plan should run without errors.<br />
<br />
=== Step 2: Creating a Block with the Recorder ===<br />
With the help of the integrated recorder, you can easily record execution sequences and store them in a block. This requires a connection to a test device, which is used to create the test.<br />
<br />
To establish a connection, switch back to the GUI browser. The connection that you created previously is still entered here. Since the same name was used for the connection in the test run, the settings were overwritten (in our case, the settings were identical anyway). The connection is currently not active, since it was terminated at the end of the execution. However, the settings are still entered there. To reestablish the connection with this configuration, select it, right-click it, and then ''Connect''.<br />
<br />
Wait until the connection is established (1), then press the record button (2) to start recording (Fig. 11).<br />
<br />
[[Datei:MobileTestingRecorderStarten.png | frame | left | Abb. 11: Recorder starten]]<br />
<br clear="all"><br />
A window opens with the Mobile Testing Recorder (Fig. 12). This shows a screenshot of the connected device. This screen allows you to control the device remotely. Every action you perform is recorded in the background.<br />
<br />
In the upper menu bar you can select the tool (1) with which you want to enter an action. The Auto tool is selected by default. You can use it to record certain actions by making gestures on the display with the mouse pointer. For example, if you left-click for a long time, this corresponds to a long tap on the element at this point. Instead of specifying the desired action with the corresponding gesture, you can also select it manually.<br />
<br />
A new test for the recognition of correct GTIN-13 codes should now be recorded. First click briefly on the button ''GTIN-13 (EAN-13)'' (2) of the app in the display to trigger a corresponding click on the device. During the execution of this action, the frame of the recorder will briefly turn red. If the recorder does not display the current view of the app afterwards, click on the update icon (3) in the recorder.<br />
<br />
[[Datei:MobileTestingRecorder1.png | frame | left | Abb. 12: Über Recorder zur GTIN-13-Activity wechseln]]<br />
<br clear="all"><br />
Then enter a correct GTIN-13 in the input field of the new page. To do this, right-click on the input field (1) and select the action ''Set text'' (2) in the context menu (Fig. 13). Enter any valid article number in GTIN-13 format, e.g. ''4006381333986'' (3). This text is now set in the app.<br />
<br />
[[Datei:MobileTestingRecorder2.png | frame | left | Abb. 13: GTIN-13-Code über Recorder eingeben]]<br />
<br clear="all"><br />
Now click on ''Verify'' (1) (Fig. 14). The app now displays ''OK'' (2) as the result. The test should determine whether this result is actually displayed. After a right click you can select the action ''Assure attribute'' (3) in the context menu. In the dialog that opens, select the property ''text'' (4) and confirm with ''OK'' (5). This time, no action is triggered on the device, but only a block is recorded that fails if the result deviates from the expected value ''OK''.<br />
<br />
[[Datei:MobileTestingRecorder3.png | frame | left | Abb. 14: Antwort der App über Recorder auslesen]]<br />
<br clear="all"><br />
Now close the recorder. In the ''workspace'' of the GUI browser you can see that a block has been created for each of the recorded actions (Fig. 15). You can now test whether the recorded action can be played back. To do this, you must first return the app on your device to its initial state by using the ''HOME'' button on the top right of the device. Then click in expecco on the green Play button (1). If everything turns green, the execution was successful. Now create a new block in the test-suite by clicking on the block symbol (2) in the upper right corner. Give it the name ''GTIN_Verify_OK'' (3) and confirm (4).<br />
<br />
[[Datei:MobileTestingArbeitsbereich.png | frame | left | Abb. 15: Neuen Baustein aus Arbeitsbereich exportieren]]<br />
<br clear="all"><br />
Now close the connection by selecting the connection, right-clicking and selecting ''Close connection'' from the context menu.<br />
<br />
Switch back to the Testsuite tab. The new block was created there. Again select the test plan ''Demo-Test'' and add the recorded test case ''GTIN_Verify_OK'' by drag-and-drop at the end of the test plan. Apply the change and restart. The test plan should run again without errors.<br />
<br />
=== Step 3: Customizing XPath Using the GUI Browser ===<br />
Your new device may not work on other devices. The elements used are addressed via an XPath and this cannot be correct on other devices. See the [[#XPath_Customizing_using_the_GUI-Browsers|Customizing XPath Using the GUI-Browser]] section for more information. If you have another device available, you can now try to generalize the paths in your created devices. You can also skip this step.<br />
<br />
If you find it difficult to find shortened paths, follow the paths of the existing blocks. Start the test again. If the test now fails, check the paths again in the GUI browser.<br />
To run the test on a second device, open in the menu ''Extensions'' > ''Mobile Testing'' > ''Create connection settings''. You will get a dialog similar to the connection dialog. However, you can only create and save settings but not establish a connection. However, you have the option to save individual aspects of the settings, such as only the device. Select the new device and click on the Save icon in the attachment until the delayed menu opens (Fig. 16). Select ''Save device settings'' here. It is best to name the attachment after the device. You can then close the dialog again.<br />
<br />
[[Datei:MobileTestingGerätSpeichern.png | frame | left | Abb. 16: Einstellungen für ein Gerät speichern]]<br />
<br clear="all"><br />
Select the ''Connect'' block and drag the settings for the new device into its network. Now connect its output pin ''pathName'' with the input pin ''stringOrFilename[2]'' of the block ''Connect from File''. The block Connect from File reads the information at the input pins from top to bottom, multiple properties are replaced. In this case, the settings for the device used are replaced, while the other settings remain the same. If you have chosen the paths skilfully, the test will now also run successfully on the other device.<br />
<br />
=== Step 4: Create another block ===<br />
If the same procedures are repeated in the test, you can reuse or modify blocks that have already been created for this purpose. The block created in step 2 checks the recognition of correct GTIN 13 codes. A test is still missing which, conversely, checks the detection of a wrong GTIN-13 code. The structure of the two tests is identical, they only differ in their parameters. Therefore, copy the block ''GTIN_Verify_OK'' and rename the copy to ''GTIN_Verify_NOT_OK''. Change the input of the GTIN-13 to a wrong code, for example by changing the last digit (''4006381333987'') and set the check value of the output to ''NOT OK'' (Fig. 17).<br />
<br />
[[Datei:MobileTestingGTIN_Verify_NOT_OK.png | frame | left | Abb. 17: Baustein editieren]]<br />
<br clear="all"><br />
Add this new test to the Test Plan Demo Test as well and place it at the end. Run the test plan, but don't forget to disconnect in the GUI browser first.<br />
<br />
The new test will fail because the device you added does not return to the start page of the app, but the tests start from there. This is already considered in the other blocks; they always execute the block ''Back to main menu'' at the end. You can see this by selecting one of the other blocks, e.g. ''GTIN_Calculate'', and switching to its schematic view. There the block ''Back to main menu'' is displayed in the field ''After execution'' (Fig. 18). As with the corresponding field in the test plan, this block is always executed at the end, regardless of whether the test is successful or aborted. Now add this entry to your blocks ''GTIN_Verify_OK'' and ''GTIN_Verify_NOT_OK''. Select the block and drag the block ''Back to main menu'' in the schema view to the input field ''After execution''. Now you can start the test plan and all tests should be executed again without any problems.<br />
<br />
[[Datei:AppiumDemo Nach Ausführung.png | frame | left | Abb. 18: Nach-Ausführungs-Baustein setzen]]<br />
<br clear="all"><br />
<br />
=== Step 5: Complete Test ===<br />
For the Activity IBAN all answer possibilities of the app are already covered with test cases. In the GTIN-13-Activity a correct and a faulty code are tested and a check digit is calculated, but the behaviour of the app in case of input of wrong length is not tested yet (With Verify '''Input must be exactly 13 digits''. and ''...12 digits''. for Calculate). The activity for checking the serial numbers of euro banknotes is not yet tested. As with the IBAN, three cases can occur here: a correct serial number was entered (answer: ''OK''), an incorrect serial number was entered (answer: ''NOT OK'') or the specification does not correspond to the format (answer: ''A serial number consists of 12 characters with the first one or two being capital letters (A-Z).''). You can now extend the test coverage by creating test cases. You can create the blocks for this with the recorder as in step 2 and generalize the XPaths if necessary. If you are familiar with the basic handling of expecco, you can of course also create blocks without recorder by manually assembling them from existing blocks of the library. You can also combine both approaches as you wish.<br />
<br />
Note that the test cases presented here only check individual entries. If you write test cases for your own apps, you will probably want to test more closely by entering more different values, including edge cases.<br />
<br />
==<span id="FirstStepsIOS"><!-- Referenced by m03_expeccoMobileDemoIOS.ets --></span> First steps with iOS ==<br />
It is assumed that you have already read the chapter [[#Installation_and_Setup|Installation and Setup]] and completed the necessary preparations for using iOS devices under Mac OS. Connect the device you want to use to your Mac. Download the iOS version of the [http://download.exept.de/transfer/h-expecco-2.11.0-pre/expeccoMobileDemo.ipa expeccoMobileDemo-App] to your Mac. Since the app is a debug build, you still need to sign it for your device (see [[#iOS-Ger.C3.A4t_und_App_vorbereiten|iOS-Device and App preparing]]). Now start an Appium server on your Mac.<br />
<br />
=== Step 1: Run Demo ===<br />
Start expecco and open the test-suite ''m03_expeccoMobileDemoIOS.ets'' via the button ''Example from file'' (Fig. 1). As of expecco 2.11 this is located in the subfolder ''mobile''. Otherwise download the test-suite [http://download.exept.de/transfer/h-expecco-2.10.0/m03_expeccoMobileDemoIOS.ets m03_expeccoMobileDemoIOS.ets] to the computer on which your expecco installation is located and open it. In this test-suite there is already a ready-made test plan with some test cases for this app. <br />
<br />
[[Datei:MobileTestingIOSBeispielÖffnen.png | frame | left | Abb. 1: Beispiel-Testsuite öffnen]]<br />
<br clear="all"><br />
Before we get into the rest of the test-suite, first configure the connection and which device you want to use. Now open the GUI browser (1) and select the entry ''Mobile Testing'' (3) under ''Connect'' (2) (Fig. 2) to open the connection dialog.<br />
[[Datei:MobileTestingVerbinden.png | frame | left | Abb. 2: Verbindungseditor öffnen]]<br />
<br clear="all"><br />
<br />
Here you can enter an iOS device only by hand. Select ''Enter iOS device'' (Fig. 3). The name and iOS version of the device can be found in its properties. To find out the device ID of the device, open the Devices (Command-Shift-2) window in Xcode on the Mac. All connected devices and the available simulators are displayed there. Here you can also see the device ID (udid) of your device and which apps have been installed. After you have entered the device in the connection editor, select it in the list and click Next.<br />
<br />
[[Datei:MobileTestingIOSGerät.png | frame | left | Abb. 3: Hinzufügen eines iOS-Geräts]]<br />
<br clear="all"><br />
<br />
Next, specify which app you want to use. You can choose whether you want to start an app that is already installed on the device (''App on the device'') or if you want to install and start an app (''Install app''). In case you want to use an already installed app, you have to specify its bundle ID. You will also find this in the Devices window of Xcode. For the demo app it is ''de.exept.expeccoMobileDemo''.<br />
<br />
For this tutorial the demo app has to be installed first. Select ''Install App'' and enter the path to the file on your Mac (fig. 4). If you are using expecco 2.11, you can also specify the Team-ID on this page, which specifies which certificate should be used for iOS connections. If you have already specified an ID in [[#Configuration_of_Plugins|Plugin Settings]], it will be used. It will be grayed out unless you specify another value. Now click on ''Next''.<br />
<br />
[[Datei:MobileTestingIOSAppInstallieren.png | frame | left | Abb. 4: App angeben, die auf dem Gerät installiert werden soll]]<br />
<br clear="all"><br />
<br />
On the last page you can see an overview of all previous data (1) (Fig. 5). Below the Capabilities list, you can enter a name for the connection under which it is displayed in the GUI browser (2). In addition, a connection can be identified by this name and used in blocks; the name must therefore be unique. If you do not specify a name, one is generated generically. Enter ''expeccoMobileDemo'' as the name. Enter the address for the Appium server in the field below (3). If you have started the Appium server with default settings, you only have to replace ''localhost'' in the default address (lowest entry of the suggestion list) with the IP address of the Mac (in the picture ''172.23.1.49''). To make sure which port the Appium server is listening on, see its output. At the beginning there is the line<br />
<nowiki>info: Appium REST http interface listener started on 0.0.0.0:4723</nowiki><br />
If the default port ''4723'' does not appear at the end, change this value accordingly in the configuration.<br />
<br />
If the option ''Start on demand'' (4) is activated, expecco checks if an Appium server is already running at the address and starts and stops it automatically if necessary. However, this is only possible for local server addresses, so deactivate this option.<br />
<br />
[[Datei:MobileTestingServerkonfigurationIOS.png | frame | left | Abb. 5: Verbindungsnamen und Appium-Server konfigurieren]]<br />
<br clear="all"><br />
<br />
Now click on ''Save'' (5) to save the settings for the test execution. Settings can be saved as an attachment to an execution definition or to an external file (Fig. 6). If you have several projects open at the same time, you can select the project in which the attachment is to be created from the list. Click on ''Save'' in the ''Save settings in attachment'' area and enter ''expeccoMobileDemo'' as the name. Now click on ''Connect'' (6) to establish a connection with the specified configuration.<br />
<br />
[[Datei:MobileTestingEinstellungenSpeichern.png | frame | left | Abb. 6: Einstellungen speichern]]<br />
<br clear="all"><br />
<br />
It may take a while to establish the connection. If you have entered the correct server address, you should see the connection attempt in the Appium server output. The app should be started on your iOS device. If nothing happens on the device, either the device or the app may not be found. If Appium tries to start the app and this fails, the app is probably signed incorrectly. In this case, uninstall the app so that it can be reinstalled with a new signature.<br />
<br />
Wait until the connection is established and displayed in the GUI browser. Now you know that the configuration works. The saved settings should now be used for the test, which then establishes the same connection. Select the connection in the GUI browser, right-click and select 'Close Connection' from the context menu to avoid any conflict. Then switch back to the test-suite tab.<br />
<br />
In the test suite, the settings were created as an appendix ''expeccoMobileDemo'' (Fig 7). Select the ''Connect'' block (1) and switch to the ''Network'' view on the right (2). Drag and drop the settings into the network of the block (3). Connect the output pin ''pathName'' with the input pin ''stringOrFilename[1]'' of the block ''Connect from File'' (4). Confirm the changes with ''Apply'' (5). This block will establish the connection to the app at the beginning of the test.<br />
<br />
[[Datei:MobileTestingConnectblock.png | frame | left | Abb. 7: Verbindungsbaustein editieren]]<br />
<br clear="all"><br />
<br />
Now switch to the test plan ''Demo Test'' (1) (Fig. 8). This test plan already contains some finished test cases. Before and after the execution (2) one block is also entered: The just edited block ''Connect'' for the setup and the block ''Disconnect'' for the disconnection. By entering the two blocks at this point, the connection is terminated, especially if the test is aborted prematurely, e.g. because one of the test cases fails.<br />
<br />
[[Datei:MobileTestingTestplan.png | frame | left | Abb. 8: Testplanausführung]]<br />
<br clear="all"><br />
Now you can start the test plan ''Demo Test'' by clicking on the green Play button (3). The test plan should run without errors.<br />
<br />
=== Step 2: Creating a block with the Recorder ===<br />
With the help of the integrated recorder, you can easily record execution sequences and store them in a block. This requires a connection to a test device, which is used to create the test.<br />
<br />
To establish a connection, switch back to the GUI browser. The connection that you created previously is still entered in this browser. Since the same name was used for the connection in the test run, the settings were overwritten with it (in our case, the settings were identical anyway). The connection is currently not active, since it was terminated at the end of the execution. However, the settings are still entered there. To reestablish the connection with this configuration, select it, right-click it, and then ''Connect''.<br />
<br />
Wait until the connection is established (1) and then press the record button (2) to start recording (Fig. 9).<br />
<br />
[[Datei:MobileTestingRecorderStarten.png | frame | left | Abb. 9: Recorder starten]]<br />
<br clear="all"><br />
A window opens with the Mobile Testing Recorder (Fig. 10). This shows a screenshot of the connected device. This screen allows you to control the device remotely. Every action you perform is recorded in the background.<br />
<br />
In the upper menu bar, you can select the tool (1) with which you want to enter an action. The tool ''Auto'' is selected by default. You can use it to record certain actions by making gestures on the display with the mouse pointer. For example, if you left-click for a long time, this corresponds to a long tap on the element at this point. Instead of specifying the desired action with the corresponding gesture, you can also select it manually.<br />
<br />
Now a new test for the recognition of correct GTIN-13 codes shall be recorded. First click briefly on the button ''GTIN-13 (EAN-13)'' (2) of the app in the display to trigger a corresponding click on the device. During the execution of this action, the frame of the recorder will briefly turn red. If the recorder does not display the current view of the app afterwards, click on the update icon (3) in the recorder.<br />
<br />
[[Datei:MobileTestingRecorder1iOS.png | frame | left | Abb. 10: Über Recorder zur GTIN-13-Activity wechseln]]<br />
<br clear="all"><br />
Then enter a correct GTIN-13 in the input field of the new page. To do this, right-click on the input field (1) and select the action ''Set text'' (2) in the context menu (Fig. 11). Enter any valid article number in GTIN-13 format, e.g. ''4006381333986'' (3). This text is now set in the app.<br />
<br />
[[Datei:MobileTestingRecorder2iOS.png | frame | left | Abb. 11: GTIN-13-Code über Recorder eingeben]]<br />
<br clear="all"><br />
Now click on ''Verify'' (1) (Fig. 12). The app now displays ''OK'' (2) as the result. The test should determine whether this result is actually displayed. After a right click you can select the action ''Assure attribute'' (3) in the context menu. In the dialog that opens, select the property ''value'' (4) and confirm with ''OK'' (5). This time, no action is triggered on the device, but only a block is recorded that fails if the result deviates from the expected value ''OK''.<br />
<br />
[[Datei:MobileTestingRecorder3iOS.png | frame | left | Abb. 12: Antwort der App über Recorder auslesen]]<br />
<br clear="all"><br />
Now close the recorder. In the ''workspace'' of the GUI browser you can see that a block has been created for each of the recorded actions (Fig. 13). You can now test whether the recorded action can be played back. To do this, you must first return the app on your device to its initial state by using the ''Home'' button on the top left of the device. Then click in expecco on the green Play button (1). If everything turns green, the execution was successful. Now create a new block in the test-suite by clicking on the block symbol (2) in the upper right corner. Give it the name ''GTIN_Verify_OK'' (3) and confirm (4).<br />
<br />
[[Datei:MobileTestingArbeitsbereich.png | frame | left | Abb. 13: Neuen Baustein aus Arbeitsbereich exportieren]]<br />
<br clear="all"><br />
Now close the connection by selecting the connection, right-clicking and selecting ''Close connection'' from the context menu.<br />
<br />
Switch back to the Testsuite tab. The new module was created there. Again select the test plan ''Demo-Test'' and add the recorded test case ''GTIN_Verify_OK'' by drag-and-drop at the end of the test plan. Apply the change and restart. The test plan should run again without errors.<br />
<br />
=== Step 3: Customizing XPath Using the GUI Browser ===<br />
Your new device may not work on other devices. The elements used are addressed via an XPath and this cannot be correct on other devices. See the [[#XPath_Customizing_using_the_GUI_Browser|Customizing_XPath using the GUI Browser]] section for more information. If you have another device available, you can now try to generalize the paths in your created devices. You can also skip this step.<br />
<br />
If you find it difficult to find shortened paths, follow the paths of the existing blocks. Start the test again. If the test now fails, check the paths again in the GUI browser.<br />
To run the test on a second device, open in the menu ''Extensions'' > ''Mobile Testing'' > ''Create connection settings''. You will get a dialog similar to the connection dialog. However, you can only create and save settings but not establish a connection. However, you have the option to save individual aspects of the settings, such as only the device. Enter the new device and select it. Click longer on the symbol for saving in the attachment until the delayed menu opens and select ''Save device settings'' here (Fig. 14). It is best to name the attachment after the device. You can then close the dialog again.<br />
<br />
[[Datei:MobileTestingGerätSpeichern.png | frame | left | Abb. 14: Einstellungen für ein Gerät speichern]]<br />
<br clear="all"><br />
Select the ''Connect'' block and drag the settings for the new device into its network. Now connect its output pin ''pathName'' with the input pin ''stringOrFilename[2]'' of the block ''Connect from File''. The block Connect from File reads the information at the input pins from top to bottom, multiple properties are replaced. In this case, the settings for the device used are replaced, while the other settings remain the same. If you have chosen the paths skilfully, the test will now also run successfully on the other device.<br />
<br />
=== Step 4: Create another block ===<br />
If the same procedures are repeated in the test, you can reuse or modify modules that have already been created for this purpose. The block created in step 2 checks the recognition of correct GTIN 13 codes. A test is still missing which, conversely, checks the detection of a wrong GTIN-13 code. The structure of the two tests is identical, they only differ in their parameters. Therefore copy the block ''GTIN_Verify_OK'' and rename the copy to ''GTIN_Verify_NOT_OK''. Change the input of the GTIN-13 to a wrong code, for example by changing the last digit (''4006381333987'') and set the check value of the output to ''NOT OK'' (Fig. 15).<br />
<br />
[[Datei:MobileTestingGTIN_Verify_NOT_OK_iOS.png | frame | left | Abb. 15: Baustein editieren]]<br />
<br clear="all"><br />
Add this new test to the Test Plan Demo Test as well and place it at the end. Run the test plan, but don't forget to disconnect in the GUI browser first.<br />
<br />
The new test will fail because the device you added does not return to the start page of the app, but the tests start from there. This is already considered in the other blocks; they always execute the block ''Back to main menu'' at the end. You can see this by selecting one of the other blocks, e.g. ''GTIN_Calculate'', and switching to its schematic view. There the block ''Back to main menu'' is displayed in the field ''After execution'' (Fig. 16). As with the corresponding field in the test plan, this block is always executed at the end, regardless of whether the test is successful or aborted. Now add this entry to your blocks ''GTIN_Verify_OK'' and ''GTIN_Verify_NOT_OK''. Select the block and drag the block ''Back to main menu'' in the schema view to the input field ''After execution''. Now you can start the test plan and all tests should be executed again without any problems.<br />
<br />
[[Datei:AppiumDemo Nach Ausführung.png | frame | left | Abb. 16: Nach-Ausführungs-Baustein setzen]]<br />
<br clear="all"><br />
<br />
=== Step 5: Complete test ===<br />
For the Activity IBAN all answer possibilities of the app are already covered with test cases. In the GTIN-13-Activity a correct and a faulty code are tested and a check digit is calculated, but the behaviour of the app in case of input of wrong length is not tested yet (With Verify '''Input must be exactly 13 digits''. and ''...12 digits''. for Calculate). The activity for checking the serial numbers of euro banknotes is not yet tested. As with the IBAN, three cases can occur here: a correct serial number was entered (answer: ''OK''), an incorrect serial number was entered (answer: ''NOT OK'') or the specification does not correspond to the format (answer: ''A serial number consists of 12 characters with the first one or two being capital letters (A-Z).''). You can now extend the test coverage by creating test cases. You can create the blocks for this with the recorder as in step 2 and generalize the XPaths if necessary. If you are familiar with the basic handling of expecco, you can of course also create blocks without recorder by manually assembling them from existing blocks of the library. You can also combine both approaches as you wish.<br />
<br />
Note that the test cases presented here only check individual entries. If you write test cases for your own apps, you probably want to test more closely by entering more different values, including edge cases.<br />
<br />
= Dialogs of the Mobile Testing Plugin =<br />
== Connection Editor ==<br />
You can use the Connection Editor to quickly define, change, or establish connections. Depending on the task, the dialog has small differences and is opened differently:<br />
*If you want to establish a connection, access the dialog in the GUI browser by clicking on ''Connect'' and then selecting ''Mobile Testing''.<br />
*To change or copy an existing connection in the GUI browser, select it, right-click and select ''Edit Connection'' or ''Copy Connection'' from the context menu.<br />
*If you do not want to create connection settings for the GUI browser but for use in a test, choose ''Create Connection Settings'' from the Mobile Testing Plugin menu.... This only allows you to create the settings for a connection without creating a connection in the GUI browser.<br />
<br />
The Connection Editor menu has several buttons, some of which are only visible when creating connection settings:<br />
[[Datei:MobileTestingVerbindungseditorMenu.png]]<br />
#''Delete Settings'': Resets all entries. (Only visible when creating settings.)<br />
#''Load settings from file'': Allows to open a saved settings file (*.csf). Its settings are transferred to the dialog. Entries already made without conflict are retained.<br />
#''Load settings from attachment'': Allows you to open an attachment with connection settings from an open project. These settings are applied to the dialog. Entries already made without conflict are retained.<br />
#''Save settings to file'' and<br />
#''Save settings to attachment'': Here you can save the entered settings to a file (*.csf) or create them as an attachment in an open project. Both options have a delayed menu in which you can choose to save only a certain part of the settings. (Only visible when creating settings.)<br />
#''Advanced View'': Allows you to switch to the advanced view to make additional settings. Read more about this at the end of this chapter. (Only visible when creating settings.)<br />
#''Help'': A help text for the respective step is shown or hidden on the right side.<br />
<br />
<br />
The dialog is divided into three steps. In the first step you select the device you want to use, in the second step you select which App should be used and in the last step the settings for the Appium server are made.<br />
<br />
===<span id="AppiumConnectionEditorStep1"><!-- Referenced by AppiumConnectionEditor in Mobile Testing Plugin --></span>Step 1: Select Device ===<br />
In the upper part you will see a list of all connected Appium devices that are detected. With the checkbox below you can hide devices that are detected but not ready. If you want to enter a device that is not connected, you can create it with the corresponding button ''Enter Android device'' or ''Enter iOS device''. However, you need to know the required properties of your device. The device is then created in a second device list and can be selected there. If no list with connected elements can be displayed, various messages are displayed instead:<br />
*No devices found<br />
*:expecco could not find any Android devices.<br />
*:To automatically configure a connection to a device, make sure<br />
*:*it is connected<br />
*:*it is turned on<br />
*:*that it has an appropriate adb driver installed<br />
*:*it is enabled for debugging (see below).<br />
*No available devices found<br />
*:expecco could not find any available Android devices. But not available ones were found, e.g. with the status "unauthorized".<br />
*:To configure a connection to a device automatically, make sure that <br />
*:*it is connected<br />
*:*it is turned on<br />
*:*that it has an appropriate adb driver installed<br />
*:*it is enabled for debugging (see below).<br />
*:To view unavailable devices, enable this option below.<br />
*Connection lost<br />
*:expecco has lost the connection to the adb server. Try to re-establish the connection by clicking on the button.<br />
*Connection failed<br />
*:expecco could not connect to the adb server. Possibly it is not running or the specified path is not correct.<br />
*:Check the adb configuration in the settings and try to start the adb server and establish a connection by clicking on the button.<br />
*Connect ...<br />
*:expecco connects to the adb server. This may take a few seconds.<br />
*Start adb-Server ...<br />
*:expecco starts the adb-Server. This may take a few seconds.<br />
<br />
<!--With ''Automation by'' you can specify, which automation engine is to be used. If you leave the setting at ''(Default)'' the corresponding capability is not set at all. Otherwise Appium, Selendroid and from expecco 2.11 XCUITest are available. Selendroid is usually only used for Android devices prior to version 4.1.-->With ''Next'' you get to the next step. If you enter settings for the GUI browser, this is only possible once a device has been selected.<br />
<br />
<span id="UnlockingDeveloperOptions">Note on unlocking</span>: In newer Android versions the developer options are no longer offered in the settings at first. If your Android device does not show an entry for "''Developer options''" in the settings, first select the entry "''Phone info''", then "''SoftwareVersionsInfo''" and click on the entry "''BuildVersion''" several times.<br />
<br />
===<span id="AppiumConnectionEditorStep2"><!-- Referenced by AppiumConnectionEditor in Mobile Testing Plugin --></span>Step 2: Select App===<br />
Here you can enter information about the app to be tested. You can decide if you want to use an app that is already installed on the device or if you want to install an app for the test. Select the appropriate tab above. Depending on whether you selected an Android or an iOS device in the previous step, the required input will change.<br />
<br />
*'''Android'''<br />
**''App on Device''<br />
**:If you have selected a connected device in the first step, the packages of all installed apps are automatically retrieved and you can select from the drop-down lists. The installed apps are divided into third-party packages and system packages; select the appropriate package list. This selection does not belong to the settings, but only provides the corresponding package list. You can use the filter to further narrow down the list and then select the desired package. The activities of the selected package are also automatically retrieved and made available as a drop-down list. Select the activity you want to start. As a rule, an activity is automatically entered from the list. If you are not using a connected device, you must enter the package and the activity manually.<br />
**''Install App''<br />
**:Under ''App'', enter the path to an app. The path must be valid for the Appium server being used. You can also specify a URL. If you are using a local Appium server, you can use the right button to navigate to the App installation file and enter this path. If possible, the corresponding package and the activity are also entered in the fields below. However, this entry is not necessary.<br />
<br />
*'''iOS'''<br />
**''App on Device''<br />
**:Specify the bundle ID of an installed app. You can find out the IDs of the installed apps using Xcode, for example. Start Xcode and select ''Devices'' from the menu bar at the top of the screen in the ''Window'' menu. A window will open displaying a list of connected devices. If you select your device, you will see a list of the apps you have installed in the overview.<br />
**''Install App''<br />
**:Under ''App'', enter the path to an app. The path must be valid for the Appium server being used. You can also specify a URL. For the requirements of apps for real devices, please read the section [[#iOS-Ger.C3.A4t_and_App_Preparing|Preparing an iOS-Device and App]].<br />
<br />
In the lower part you can specify whether the app should be reset or uninstalled when the connection is terminated, and whether it should be reset initially. Again, the corresponding capability is not set if you select ''(Default)''. With ''Next'' you get to the next step.<br />
<br />
===<span id="AppiumConnectionEditorStep3"><!-- Referenced by AppiumConnectionEditor in Mobile Testing Plugin --></span>Step 3: Server Settings===<br />
In the last step, a list of all the capabilities that result from your entries in the previous steps is first displayed in the upper part. If you are familiar with Appium and want to set additional capabilities that are not covered by the connection editor, you can click on ''Edit'' to open the extended view. See the section below for more information.<br />
<br />
If you enter settings for the GUI browser, you can enter the ''Connection name'' with which the connection is displayed. This is also the name under which devices can use this connection when it is established. If you leave the field blank, a name will be generated. To specify the address for the Appium server, you get the local default address and addresses already used for selection. If you check the box for ''Start on demand'', expecco tries to start an Appium server at the given address when connecting, if none is running there yet. This server will then also be shut down when the connection is terminated. This only works for local addresses. Make sure that you only use port numbers that are free. It is best to only use odd port numbers from the standard port 4723. The following port number is also used when establishing a connection, which could otherwise lead to conflicts.<br />
<br />
Depending on how you opened the dialog, there are now different buttons to close it. In any case you have the option to save. This opens a dialog where you can either select an open project to save the settings there as an attachment, or choose to save it to a file that you can then specify. Saving does not close the dialog, allowing you to select another option.<br />
<br />
If you have opened the editor for establishing a connection, you can finally click on ''Connect'' or ''Start and connect server'', depending on whether the check mark for server start is set. For changing or copying a connection in the GUI Browser, this option is called ''Apply'', since in this case only the connection entry is changed or created, but the connection setup is not started. If necessary, you can do this afterwards via the context menu. If you have changed capabilities of an existing connection, a dialog then prompts you to decide whether these changes should be applied directly by closing the connection and establishing the new connection or not. In this case, the changes only take effect after you reestablish the connection.<br />
<br />
To use the connection editor, also read the corresponding section in the respective tutorial in step 1. (Android: [[#Step_1:_Demo_Run|Run Demo]], iOS: [[#Step_1:_Demo_Run_2|Run Demo]]).<br />
<br />
===Extended View===<br />
The extended view of the connection editor can be obtained either by clicking on ''Edit'' in the third step or at any time via the corresponding menu item if you have started the editor via the plugin menu. This view displays a list of all configured Appium Capabilities. You can add, change or remove further entries to this list. To add a capability, select it from the drop-down list of the input field. In this list all known capabilities are sorted into the categories ''Common'', ''Android'' and ''iOS''. If you have selected a capability, a short information text is displayed. You can also enter a capability manually in the field. Then click on ''Add'' to add the capability to the list. There you can set the value in the right column. To delete an entry, select it and click on ''Remove''. With ''Back'' you leave the extended view.<br />
<br />
[[Datei:MobileTestingErweiterteAnsicht.png]]<br />
<br />
== Running Appium Servers ==<br />
In the menu of the Mobile Testing Plugin you will find the entry ''Appium-Server...''. This opens a window with an overview of all Appium servers started by expecco and on which port they are running. By clicking on the icon in the column ''Show Log'' you can view the logfile of the corresponding server. This is deleted when the server is shut down. With the icons in the column ''Exit'' the corresponding server can be terminated. However, this is prevented if expecco still has an open connection via this server.<br />
<br />
You can also start servers here. Use the input fields to configure the server address. You can also leave the fields blank to use the default values. Please note that servers can only be started locally and the selected port must not be occupied. Typically the odd port numbers from 4723 are used. The following port number is also required when connecting to a device, which could lead to conflicts with the even numbers.<br />
<br />
[[Datei:MobileTestingAppiumServer.png]]<br />
<br />
In the menu of the Mobile Testing Plugin you will also find the entry ''Close all Connections and Servers''. This is intended for cases where connections or servers cannot be terminated in any other way. If possible, always terminate connections in the GUI browser or by executing a corresponding block. Servers that you have started in the server overview should be terminated there; servers that were started with a connection are automatically terminated with this connection.<br />
<br />
Note that only servers started and managed by expecco are listed in the overview. Possible other Appium servers that were started in a different way are not recognized.<br />
<br />
== Recorder ==<br />
If the GUI browser is connected to a device, the integrated recorder can be used to record a test section with that device. To start the recorder, select the appropriate connection in the GUI browser and click the Record button. A new window opens for the recorder. The recorded actions are created in the GUI browser work area. It is therefore possible to edit the recorded data in parallel.<br />
<br />
[[Datei:MobileTestingRecorder.png|caption|]]<br />
<br />
;Components of the Recorder Window<br />
#'''Update''': Gets the current image and element tree from the device. This is necessary if the device takes longer to execute an action or if something changes without being triggered by the recorder. <br />
#'''Follow Mouse''': Select the element under the mouse pointer in the GUI browser.<br />
#'''Element Highlighting''': The element under the mouse is outlined in red.<br />
#'''Show Elements''': Show the borders of all elements in the view.<br />
#'''Tools''': Selection, which tool is used for recording. The selected action is triggered with each click on the view. The following actions are available:<br />
#*Element Actions:<br />
#**Click: Short click on the element under cursor. Kurzer Klick auf das Element über dem der Cursor steht. To determine more precisely which element is used, use the Follow Mouse or Element Highlighting function.<br />
#**Tap Element: Similar to click, exept that the duration of the click will be recorded as well. This allows the recording of long clicks.<br />
#**Set Text: Allows to set the text of an input field.<br />
#**Clear Text: Clears the text of an input field.<br />
#*Device Actions:<br />
#**Tap: Triggers a click at the screen position, which also considers the duration<br />
#**Swipe: Swipe in a straight line from the point where you press the mouse button until you release it. The duration is also recorded.<br />
#:Please note for this actions that the result may differ on different devices, e.g. with different screen resolutions.<br />
#*Test Flow Blocks<br />
#**Check Attribute: Compares the value of a specified attribute of the element with a predefined value. The result triggers the corresponding output.<br />
#**Assert Attribut: Compares the value of a specified attribute of the element with a predefined value. If the values are not equal, the test fails.<br />
#*Auto<br />
#:If the Auto tool is selected, you can use all actions by specific input methods: ''Click'', ''Tap Element'' and ''Swipe'' still work by clicking, but are distinguished by the duration and movement of the cursor. To trigger a ''Tap'', hold down Ctrl while clicking. The remaining actions are available in a context menu by right-clicking on the element.<br />
#'''Softkeys''': Only for Android. Simulates pressing the buttons Back, Home, Menu and Power.<br />
#'''Home Button''': Only for iOS since expecco 2.11. Allows pressing the Home button.Prior to expecco 19.2, it only works if AssistiveTouch is activated and the menu is located in the middle of the upper screen border. From expecco 19.2 on, the function no longer uses AssistiveTouch.<br />
#'''View''': Shows a screenshot of the device. Actions are triggerd by mouse depending on the selected tool. If a new action can be recorded, the window has a green frame, else it is red.<br />
#'''Resize Window to Image''': Resizes the recorder window so that the screenshot can be displayed completely.<br />
#'''Resize Image to Window''': Scales the screenshot to a size that makes use of the full size of the window.<br />
#'''Correct Orientation''': Corrects the image if it is upside down. Using the arrow to the right, the image can also be rotated by 90°, if this should ever be necessary. The orientation of the image is irrelevant for the functionality of the recorder, it only works on the elements it receives.<br />
#'''Scaling''': Changes the scaling of the screenshots.<br />
#'''Control''': Shows the state of the recorder<br />
#:''green'': The recorder is ready<br />
#:''red'': The recorder is locked because the display and the element list are updated<br />
#:''gray'': The recorder can no longer be used because the connection to the device has been lost<br />
<br />
;Usage<br />
Each click in the window triggers an action and is recorded in the workspace of the GUI browser. There you can run, edit, or create a new block from what you have recorded. On how to use the recorder, see also step 2 in the tutorial ([[#Step_2:_Creating_a_Block_with_the_Recorder|Android]] resp. [[#Step_2:_Creating_a_block_with_the_Recorder_2|iOS]]).<br />
<br />
== AVD Manager und SDK Manager ==<br />
AVD Manager und SDK Manager sind beides Anwendungen von Android. Im Menü des Mobile Testing Plugins bietet expecco die Möglichkeit, diese zu starten. Ansonsten finden Sie diese Programme bei Ihrer Android-Installation. Mit dem AVD Manager können Sie AVDs, also Konfigurationen für Emulatoren, erstellen, bearbeiten und starten. Mit dem SDK Manager erhalten Sie einen Überblick über Ihre Android-Installation und können diese bei Bedarf erweitern.<br />
<br />
= Hybrid Apps and WebViews =<br />
'''!!! IMPORTANT NOTICE - If you have problems switching to the webview, please set the "Default Application - Browser App" in Android Settings to "Chrome" !!!'''<br />
<br />
Hybrid apps contain platform native elements as well as other elements that are integrated in a WebView. These elements can also be used, but you first have to switch to the corresponding context. With the block ''Get Current Context'' you get the current context. Initially this is ''NATIVE_APP'', i.e. the context of the native elements. With the block ''Get Context Handles'' you get a collection of all existing contexts. If there is a WebView context, it is called ''WEBVIEW_1'' or ''WEBVIEW_<package>'' with the package of the WebView. Several WebView contexts are also possible. For each WebView context, there is a corresponding WebView element in the native context. You can use the ''Switch to Context'' block to switch to such a context and from now on only have access to the elements in this context.<br />
<br />
In the GUI browser, the existing contexts are displayed at the top of the tree as well as the tree of a context is inserted below the corresponding WebView element.<br />
<br />
=<span id="Customizing XPath using the GUI Browsers"><!-- name before 01.10.2020--></span>Customizing XPath using the GUI Browser=<br />
Bausteine, die auf einem Gerät fehlerfrei funktionieren, tun dies auf anderen Geräten möglicherweise nicht. Auch können kleine Änderungen der App dazu führen, dass ein Baustein nicht mehr den gewünschten Effekt hat. Man sollte einen Baustein daher so robust formulieren, dass er für eine Vielzahl von Geräten verwendet werden kann und kleine Anpassungen an der App verkraftet. Dazu muss man das grundlegende Funktionsprinzip der Adressierung verstehen. Dies wird im Folgenden am Beispiel der App aus dem Tutorial erläutert.<br />
<br />
Die Ansicht der App setzt sich aus einzelnen Elementen zusammen. Dazu gehören die Schaltflächen ''GTIN-13 (EAN-13)'' und ''Verify'', das Eingabefeld der Zahl ''4006381333986'' und das Ergebnisfeld, in dem OK erscheint, wie auch alle anderen auf der Anzeige sichtbaren Dinge. Diese sichtbaren Elemente sind in unsichtbare Strukturelemente eingebettet. Alle Elemente zusammen sind in einer zusammenhängenden Hierarchie, dem Elementbaum, organisiert.<br />
<br />
[[Datei:MobileTestingGUIBrowser.png | frame | left | Abb. 1: Funktionen des GUI-Browsers]]<br />
<br clear="all"><br />
Sie können sich diesen Baum im GUI-Browser ansehen. Wechseln Sie dazu in den GUI-Browser (Abb. 1) und starten Sie eine beliebige Verbindung. Sobald die Verbindung aufgebaut ist, können Sie den gesamten Baum aufklappen (1) (Klick bei gedrückter Strg-Taste). Er enthält alle Elemente der aktuellen Seite der App.<br />
<br />
Ein Baustein, der nun ein bestimmtes Element verwendet, muss dieses eindeutig angeben, indem er dessen Position im Elementbaum mit einem Pfad im XPath-Format beschreibt. Dieses Format ist ein verbreiteter Web-Standard für XML-Dokumente und -Datenbanken, eignet sich aber genauso für Pfade im Elementbaum.<br />
<br />
Wenn Sie ein Element im Baum auswählen, wird unten der von expecco automatisch generierte XPath (2) für das Element angezeigt, der auch beim Aufzeichnen verwendet wird. Oberhalb davon in der Mitte des Fensters befindet sich eine Liste der Eigenschaften (3) des ausgewählten Elements. Man nennt diese Eigenschaften auch Attribute. Sie beschreiben das Element näher wie beispielsweise seinen Typ, seinen Text oder andere Informationen zu seinem Zustand. Links unten können Sie zur besseren Orientierung im Baum die ''Vorschau'' (4) aktivieren, um sich den Bildausschnitt des Elements anzeigen zu lassen.<br />
<br />
Der Elementbaum für gleiche Ansicht einer App kann sich je nach Gerät unterscheiden. Es sind diese Unterschiede, die verhindern, eine Aufnahme von einem Gerät unverändert auch auf allen anderen Geräten abzuspielen: Ein XPath, der im einen Elementbaum ein bestimmtes Element identifiziert, beschreibt nicht unbedingt das gleiche Element im Elementbaum auf einem anderen Gerät. Es kann stattdessen passieren, dass der XPath auf kein Element, auf ein falsches Element oder auf mehrere Elemente passt. Dann schlägt der Test fehl oder er verhält sich unerwartet.<br />
<br />
Man könnte natürlich für jedes Gerät einen eigenen Testfall schreiben. Das brächte aber unverhältnismäßigen Aufwand bei Testerstellung und -wartung mit sich. Das Problem lässt sich auch anders lösen, da ein jeweiliges Element nicht nur durch genau einen XPath beschrieben wird. Vielmehr erlaubt der Standard mithilfe verschiedener Merkmale unterschiedliche Beschreibungen für ein und dasselbe Element zu formulieren. Das Ziel ist daher, einen Pfad zu finden, der auf allen für den Test verwendeten Geräten funktioniert und überall eindeutig zum richtigen Element führt.<br />
<br />
Im Beispiel besteht die Verbindung zur Android-App aus dem Tutorial und der Eintrag des GTIN-13-Buttons ist ausgewählt (5). Dessen automatisch generierter XPath (2) kann beispielsweise so aussehen:<br />
<br />
<blockquote>//hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[@resource id='android:id/content']/android.widget.RelativeLayout/android.widget.Button[@resource-id='de.exept.expeccomobiledemo:id/gtin_13']</blockquote><br />
<br />
Er ist offensichtlich lang und unübersichtlich. Der sehr viel kürzere Pfad<br />
<br />
<blockquote>//*[@text='GTIN-13 (EAN-13)']</blockquote><br />
<br />
führt zum selben Element.<br />
<br />
Für die iOS-App lautet der automatisch generierte XPath für diesen Button beispielsweise<br />
<br />
<blockquote>//AppiumAUT/XCUIElementTypeApplication/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeButton[2]</blockquote><br />
bzw.<br />
<blockquote>//AppiumAUT/UIAApplication/UIAWindow[1]/UIAButton[2]</blockquote><br />
<br />
und kann kürzer als<br />
<br />
<blockquote>//*[@name='GTIN-13 (EAN-13)']</blockquote><br />
<br />
geschrieben werden.<br />
<br />
Sie können den Pfad entsprechend im GUI-Browser ändern und durch ''Pfad überprüfen'' (6) feststellen, ob er weiterhin auf das ausgewählte Element zeigt, was expecco mit ''Verify Path: OK'' (7) bestätigen sollte. Der erste, sehr viel längere Pfad, beschreibt den gesamten Weg vom obersten Element des Baumes bis hin zum gesuchten Button. Der zweite Pfad hingegen wählt mit * zunächst sämtliche Elemente des Baumes und schränkt die Auswahl dann auf genau die Elemente ein, die ein ''text''- bzw. ''name''-Attribut mit dem Wert ''GTIN-13 (EAN-13)'' besitzen, in unserem Fall also genau der eine Button, den wir suchen.<br />
<br />
Im folgenden werden Android-ähnliche Pfade zur Veranschaulichung verwendet. Die Elemente in iOS-Apps heißen zwar anders, wodurch andere Pfade entstehen; das Prinzip ist jedoch das gleiche.<br />
<br />
[[Datei:MobileTestingBaum1.png | frame | Abb. 2: Elementbaum einer fiktiven App]]<br />
<br />
Sie können solche Pfade mit Hilfe weniger Regeln selbst formulieren. Sehen Sie sich den einfachen Baum einer fiktiven Android-App in Abb. 2 an: Die Einrückungen innerhalb des Baumes geben die Hierarchie der Elemente wieder. Ein Element ist ein ''Kind'' eines anderen Elementes, wenn jenes andere Element das nächsthöhere Element mit einem um eins geringeren Einzug ist. Jenes Element ist das ''Elternelement'' des Kindes. Sind mehrere untereinander stehende Elemente gleich eingerückt, so sind sie also alle Kinder desselben Elternelements.<br />
<br />
Ein Pfad durch alle Ebenen der Hierarchie zum TextView-Element ist nun:<br />
<br />
<blockquote>//hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.TextView</blockquote><br />
<br />
Die Elemente sind mit Schrägstrichen voneinander getrennt. Es fällt auf, dass der Name des ersten Elements nicht mit dem im Baum übereinstimmt. Das oberste Element in der Hierarchie heißt immer ''hierarchy'' (für iOS wäre es ''AppiumAUT''), expecco zeigt im Baum stattdessen den Namen der Verbindung an, damit man mehrere Verbindungen voneinander unterscheiden kann. Die weiteren Elemente tragen jeweils das Präfix ''android.widget.'', das im Baum zur besseren Übersicht nicht angezeigt wird. Bei IOS gibt es kein Präfix, das durch einen Punkt abgetrennt wäre, expecco 2.11 blendet aber entsprechend ''XCUIElementType'' am Anfang aus. Mit jedem Schrägstrich führt der Pfad über eine Eltern-Kind-Beziehung in eine tiefere Hierarchie-Ebene, d. h. ''FrameLayout'' ist ein Kindelement von ''hierarchy'', ''LinearLayout'' ist ein Kind von ''FrameLayout'' usw. Die in eckigen Klammern geschriebenen Wörter dienen nur als Orientierungshilfe im Baum. Sie gehören nicht zum Typ.<br />
<br />
Ein Pfad muss nicht beim Element ''hierarchy'' beginnen. Man kann den Pfad beginnend mit einem beliebigen Element des Baumes bilden. Man kann also verkürzt auch<br />
<br />
<blockquote>//android.widget.TextView</blockquote><br />
<br />
schreiben. Der Pfad führt zum selben ''TextView''-Element, da es nur ein Element dieses Typs gibt. Anders verhält es sich bei dem Pfad<br />
<br />
<blockquote>//android.widget.Button.</blockquote><br />
<br />
Da es zwei Elemente vom Typ ''Button'' gibt, passt dieser Pfad auf zwei Elemente, nämlich den Button, der mit "''An''" markiert ist, und den ''Button'', der mit "''Aus''" markiert ist. Es würde an dieser Stelle aber auch nicht helfen den langen Pfad von ''hierarchy'' aus beginnend anzugeben. Um einen mehrdeutigen Pfad weiter zu differenzieren, kann man explizit ein Element aus einer Menge wählen, indem man den numerischen Index in eckigen Klammern dahinter schreibt. Der Pfad aus dem obigen Beispiel lässt sich damit so anpassen, dass er eindeutig auf den ''Button'' mit der Markierung "''Aus''" weist:<br />
<br />
<blockquote>//android.widget.Button[1].</blockquote><br />
<br />
Ihnen fällt sicher auf, dass der Index eine 1 ist obwohl das zweite Element gemeint ist. Das kommt daher, dass die Zählung bei 0 beginnt. Der Button mit der Markierung "An" hat also die Nummer 0 und der ''Button'' mit der Markierung "''Aus''" hat die Nummer 1.<br />
<br />
Dieser Ansatz, einen expliziten Index zu verwenden, hat zwei Nachteile: Zum einen lässt sich an dem Pfad nur schwer ablesen welches Element gemeint ist, zum andern ist der Pfad sehr empfindlich schon gegenüber kleinsten Änderungen, wie zum Beispiel dem Vertauschen der beiden ''Button''-Elemente oder dem Einfügen eines weiteren ''Button''-Elements in der App.<br />
<br />
Es wäre daher wünschenswert, das gemeinte Element über eine ihm charakteristische Eigenschaft wie einen Attributwert, zu adressieren. Für Android-Apps eignet sich hierfür häufig das Attribut ''resource-id''. Im Idealfall muss bei der Entwicklung der App darauf geachtet werden, dass jedes Element eine eindeutige Id erhält. Die ''resource-id'' hat den großen Vorteil, dass sie unabhängig vom Text des Elements oder der Spracheinstellung des Geräts ist. Für iOS-Apps kann entsprechend das Attribut ''name'' verwendet werden, wenn es von der App sinnvoll gesetzt wird. Der XPath-Standard erlaubt solche Auswahlbedingungen zu einem Element anzugeben. Angenommen, der ''Button'' mit der Markierung "''Aus''" hat die Eigenschaft ''resource-id'' mit dem Wert ''off'' und der ''Button'' mit der Markierung "''An''" hat als ''resource-id'' den Wert ''on'', dann kann man als eindeutigen Pfad für den "Aus"-''Button''<br />
<br />
<blockquote>//android.widget.Button[@resource-id='off']</blockquote><br />
<br />
formulieren. Wie an dem Beispiel zu sehen werden solche Bedingungen wie ein Index in eckigen Klammern an den Elementtyp angehängt. Der Name eines Attributes wird mit einem @ eingeleitet und der Wert mit einem = in Anführungszeichen angehängt. Ist der Attributwert global eindeutig, kann man den vorausgehenden Pfad sogar durch den globalen Platzhalter * ersetzen, der auf jedes Element passt. Das obige Beispiel mit dem GTIN-13-''Button'' war ein solcher Fall.<br />
<br />
[[Datei:MobileTestingBaum2.png | frame | Abb. 3: Elementbaum einer fiktiven App mit Erweiterungen]]<br />
<br />
Abb. 3 zeigt eine Erweiterung des Beispiels aus Abb. 2. Die App hat nun ein weiteres, nahezu identisches ''LinearLayout'' bekommen. Die ''Buttons'' sind in ihren Attributen jeweils ununterscheidbar. Deshalb funktioniert der vorige Ansatz nicht, einen eindeutigen Pfad nur mithilfe eines Attributwerts zu formulieren. Offensichtlich unterscheiden sich aber ihre benachbarten ''TextViews''. Es ist möglich die jeweilige ''TextView'' in den Pfad mit aufzunehmen, um einen ''Button'' dennoch eindeutig zu adressieren. Ein Pfad zum ''Button'' mit der Markierung "''An''" unterhalb der ''TextView'' mit der Markierung "''Druckschalter''" kann dabei wie folgt aussehen:<br />
<br />
<blockquote>//android.widget.TextView[@resource-id='push']/../android.widget.Button[@resource-id='on']</blockquote><br />
<br />
Der erste Teil beschreibt den Pfad zu der ''TextView'' mit der Markierung "''Druckschalter''" und der ''resource-id'' mit dem Wert ''push''. Danach folgt ein Schrägstrich gefolgt von zwei Punkten. Die zwei Punkte sind eine spezielle Elementbezeichnung, die nicht ein Kindelement benennt, sondern zum Elternelement wechselt, in diesem Fall also das ''LinearLayout'', in dem die ''TextView'' eingebettet ist. Im Kontext dieses ''LinearLayout'' ist der restliche Pfad, nämlich der ''Button'' mit der ''resource-id'' mit dem Wert ''on'', eindeutig.<br />
<br />
Der XPath-Standard bietet noch sehr viel mehr Ausdrucksmittel. Mit der hier knapp vorgestellten Auswahl ist es aber bereits möglich für die meisten praktischen Testfälle gute Pfade zu formulieren. Eine vollständige Einführung in XPath ginge über den Umfang dieser Einführung weit hinaus. Sie finden zahlreiche weiterführende Dokumentationen im Web und in Büchern.<br />
<br />
Eine universelle Strategie zum Erstellen guter XPaths gibt es nicht, da sie von den Testanforderungen abhängt. In der Regel ist es sinnvoll, den XPath kurz und dennoch eindeutig zu halten. Häufig lassen sich Elemente über Eigenschaften identifizieren wie beispielsweise ihren Text. Will man aber gerade den Text eines Elements auslesen, kann dieser natürlich nicht im Pfad verwendet werden, da er vorher nicht bekannt ist. Ebenso wird der Text variieren, wenn die App mit verschiedenen Sprachen gestartet wird.<br />
<br />
Jeder Baustein, der auf einem Element arbeitet, hat einen Eingangspin für den XPath. Im GUI-Browser finden Sie in der Mitte oben eine Liste von Bausteinen mit Aktionen, die Sie auf das ausgewählte Element anwenden können. Suchen Sie den Baustein ''Click'' (8) im Ordner Elements und wählen Sie ihn aus (Abb. 1). Er wird im rechten Teil unter ''Test'' eingefügt, der Pin für den XPath ist mit dem automatisch generierten Pfad des Elements vorbelegt (9). Sie können den Baustein hier auch ausführen. Die Ansicht wechselt dann auf ''Lauf''. Ändert sich durch die Aktion der Zustand Ihrer App, müssen Sie den Baum anschließend aktualisieren (10).<br />
<br />
Wenn Sie in der unteren Liste eine Eigenschaft auswählen, wechselt die Anzeige der Bausteine zu ''Eigenschaften'', wo Sie die eigenschaftsbezogenen Bausteine finden. Wie bei den Aktionen können Sie auch hier einen Baustein auswählen, der dann rechts in Test mit dem Pfad des Elements und der ausgewählten Eigenschaft eingetragen wird, sodass Sie ihn direkt ausführen können.<br />
<br />
=<span id="troubleshooting"><!-- Referenced by error dialog on connection error --></span>Problems and Solutions=<br />
== General Remarks==<br />
*If an Android device connected via USB does not appear in the connection dialog, try changing the USB connection type. Usually MTP or PTP should work. See also [[#Prepare_Android_Device|Prepare Android Device]].<br />
*In some cases, when connecting an iOS device via USB, a message appears indicating that the cable used is not certified. In this case, replacing the respective cable is the only solution.<br />
*Note that the [[#Recorder|Recorder]] also considers items that you cannot see on the screen. Therefore, turn on element highlighting or use the follow mouse function and the element tree in the GUI browser to determine if the correct element is used.<br />
*Make sure that no alerts are open when connecting to an iOS device. Otherwise the connection will fail because the app cannot be brought to the foreground. See also [[#Preparing_an_iOS-Device_and_App|Preparing an iOS-Device and App]].<br />
*Note that on iOS simulators no ''.ipa'' files can be installed but only ''.app'' files.<br />
*For Android devices that automatically show and hide softkeys, the recorder may cut off elements in the lower area that would be hidden by the softkeys, even if they are not displayed at this time. In this case it is advisable to set the softkeys so that they are permanently displayed.<br />
<br />
==Connecting Fails==<br />
If the connection to the Appium server fails, you will receive an error message in expecco similar to the one shown below.<br />
<br />
[[File:MobileTestingVerbindungsfehler.png]]<br />
<br />
Here you can see the type of error that has occurred. Click on "''Details''" to get more information. Possible errors are:<br />
*''org.openqa.selenium.remote.UnreachableBrowserException''<br />
:The specified server is not running or is not reachable. Check the server address.<br />
*''org.openqa.selenium.WebDriverException''<br />
:Read the message after ''Original Error'' in the first line of the details:<br />
:*''Unknown device or simulator UDID''<br />
::Either the device is not connected properly or the udid is not correct.<br />
:*''Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65''<br />
::This error can have various causes. Either the WebDriverAgent could actually not be built because the signing settings are wrong or the appropriate provisioning profile is missing. Please read the section about [[#Signing|Signing]]. It is also possible that the WebDriverAgent cannot be started on the device, for example because an alert is in the foreground or you did not trust the developer.<br />
:*''Could not install app: 'Command 'ios-deploy [...] exited with code 253'''<br />
::The specified app cannot be installed on the iOS device because it is not entered in the app's Provisioning Profile.<br />
:*''Bad app: [...] App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name.''<br />
::The path to the app is wrong. Make sure that the file is located in the specified path on your Mac.<br />
:*''packageAndLaunchActivityFromManifest failed.''<br />
::The specified ''apk'' file is probably broken.<br />
:*''Could not find app apk at [...]''<br />
::The path to the app is wrong. Make sure that the ''apk'' file is located in the specified path.<br />
<br />
<br />
If the error is not due to one of the causes listed above, the automation applications on the device may no longer function properly. In this case it helps to uninstall them from the mobile device. They are then automatically reinstalled the next time a connection is established.<br />
<br />
*For iOS devices, this is the WebDriverAgent, which you can simply uninstall from the home screen. This usually solves problems caused by changing the used Mac or the Xcode version.<br />
<br />
*For Android devices, it is the UIAutomator2; here, a problem occurs sporadically on some devices, the cause is currently unknown to us. To uninstall, on the device, navigate to "''Settings''" > "''Applications''"<sup>*</sup> and search the list for the following entries:<br />
Appium Settings<br />
io.appium.uiautomator2.server<br />
io.appium.uiautomator2.server.test<br />
:Click on the respective application and then on "''Uninstall''".<br />
<sup>*</sup>''The corresponding entry may have a slightly different name on some devices.''<br />
<br />
<br />
If this doesn't help, check the output of the Appium server. For a server started by expecco, you can find the log in the list of [[#Running_Appium_Servers|Running Appium Servers]].<br />
<br />
==Problems==<br />
*''The block to click on an element is successful, but no action was performed on the device.''<br />
:This can happen if the element is hidden by another element and therefore clicking on the element is not possible. In this case, Appium does not throw an error, but simply nothing happens. If you would like to make a click at the position of the element anyways, even if it is hidden, use the block ''Tap'' instead and pass the location of the element to it (''Get Location''). If instead you want to check before a click whether the element is hidden at this moment, try whether the properties ''Is Displayed'' or ''Is Enabled'' might help you.</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Mobile_Testing_Plugin/en&diff=24498Mobile Testing Plugin/en2021-10-28T14:30:22Z<p>Mb: /* Hybrid Apps and WebViews */</p>
<hr />
<div>= Introduction =<br />
With the ''Mobile Testing Plugin'' applications can be tested on Android and iOS devices. This includes both real and emulated devices. It does not matter whether real mobile devices or emulated devices are used. The plugin can (and usually is) used in conjunction with the [[Expecco_GUI_Tests_Extension_Reference|GUI-Browser]], which supports the creation of tests. It can also be used to record test procedures.<br />
<br />
[http://appium.io/ Appium] is used to connect to the devices. Appium is a free open source framework for testing and automating mobile applications.<br />
<br />
We recommend editing the [[#Tutorial|Tutorial]] to familiarize yourself with the Mobile Plugin. This tutorial leads step by step through the creation of a test case using an example and explains the necessary basics.<br />
<br />
= Installation and Setup =<br />
To use the ''Mobile Testing Plugin'', you must have installed expecco together with the corresponding plugin, and you need the appropriate licenses. expecco communicates with the mobile devices via an Appium server, which either runs on the same computer as expecco, or on a second computer. This must be accessible for expecco.<br />
<br />
== Installation Overview ==<br />
'''Computer running expecco:'''<br />
* Java JDK version 8, 9, 10 or 11<br />
'''Computer connected to Android devices :'''<br />
* Appium Server, you can install it via the Mobile Testing Supplement (see below), of which we regularly provide a new version<br />
* Android SDK, you can also get it with the Mobile Testing Supplement<br />
* Java JDK version 8, 9, 10 or 11<br />
'''Computer connected to iOS devices<sup>*</sup>:'''<br />
* Appium Server, you can install it via the Mobile Testing Supplement for MacOS (see below), of which we regularly provide a new version<br />
* Xcode in a version that supports the iOS version used, available from the Apple App Store<br />
* Java JDK version 8, 9, 10 or 11<br />
* Apple Developer Certificate incl. matching private key (to sign the WebDriverAgent)<br />
* Provisioning Profile for the mobile devices to be used<br />
<br />
<sup>*</sup> Please note that due to the requirements (no connection to non-Apple devices available) iOS devices can only be controlled from a Mac.<br />
<br />
Depending on the setup, the above-mentioned computers can also be the same device. expecco can either connect to a remote Appium Server and mobile devices connected to it via the network, or start an Appium Server locally itself and use it with local mobile devices. However, some of expecco's functions that make it easier to create test cases are only available if the mobile devices are connected to the same computer on which expecco is running. A possible setup may therefore look like the following figure:<br />
<br />
[[Datei:MobileTestingAufbau.png | 400px]]<br />
<br />
The following explains how to install Appium and other necessary applications for Windows and Mac OS.<br />
<br />
== Windows ==<br />
The easiest way is to install everything from our Mobile Testing Supplement. However, newer versions do not contain a JDK anymore due to a change in Oracle's license terms, so you have to install it additionally.<br />
*'''expecco 20.1''': [https://download.exept.de/transfer/h-expecco-20.1.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.10.1.0]<br />
:Only minor changes compared to the previous version.<br />
*expecco 19.2: [http://download.exept.de/transfer/h-expecco-19.2.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.10.0.0]<br />
:Compared to the previous version, Appium was updated to version 1.16.0-rc.1 and node 12 is used. <br />
*expecco 19.1: [http://download.exept.de/transfer/h-expecco-19.1.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.8.1.0]<br />
:This installs Appium in the version 1.12.0 and now additionally contains build-tools in the version 28.0.3 in the android-sdk. Apart from this, it is the same as the previous version.<br />
*expecco 18.2: [http://download.exept.de/transfer/h-expecco-18.2.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.7.3.0]<br />
:This installs Appium in the version 1.8.1. In addition, an installation of ''Android Debug Bridge'' and ''Google USB Driver'' ([https://gsmusbdrivers.com/download/adb-fastboot-drivers/ adb-setup-1.4.3]) is offered. This covers drivers for a broad range of Android devices, and you won't have to install an individual driver for each device. A '''JDK is not contained anymore (due to a change in Oracle's license terms)''', you have to download it on your own, e.g. from [https://www.oracle.com/technetwork/java/javase/downloads/index.html Oracle].<br />
*expecco 18.1: same procedure as for expecco 2.11<br />
*expecco 2.11: [http://download.exept.de/transfer/h-expecco-2.11.1/MobileTestingSupplement_1.6.0.2_Setup.exe Mobile Testing Supplement 1.6.0.2]<br />
:This installs a Java JDK Version 8, android-sdk and Appium Version 1.6.4. The supplement also offers a universal adb driver ([http://download.clockworkmod.com/test/UniversalAdbDriverSetup.msi ClockworkMod]). This driver supports a wide range of Android Devise, and avoids the need to search for individual device-specific drivers.<br />
*expecco 2.10: [http://download.exept.de/transfer/h-expecco-2.10.0/Mobile_Testing_Supplement_1.5.0.0_Setup.exe Mobile Testing Supplement 1.5.0.0]<br />
:It installs a Java JDK version 8, android-sdk and Appium version 1.4.16. During the installation the graphical user interface of Appium is started, you can close this window immediately. The supplement also offers a universal adb driver (ClockworkMod). This combines drivers for a wide range of Android devices so that you do not have to search for and install a separate driver for each device.<br />
<br />
If expecco has to use mobile devices that are connected to another computer, you have to start an Appium server there. You can do this by using the file <code>appium_standalone.cmd</code>. The server is then started on default port 4723. If you want to use a different port number, start the server with<br />
<br />
appium_standalone.cmd -p <portnummer><br />
<br />
The server is ready, as soon as the line<br />
<blockquote>Appium REST http interface listener started on 0.0.0.0:4723</blockquote><br />
is displayed, where you can read the used port number at the end.<br />
<br />
If your Android device is connected to a remote machine,<br />
you may want to see the live screen locally using a tool like<br />
[https://github.com/Genymobile/scrcpy scrcpy].<br />
<br />
<br />
When Appium is started for the first time – either standalone or by expecco – it may happen that the Windows firewall blocks access to the node server. Allow the access or Appium cannot be started.<br />
<br />
== Mac OS ==<br />
Note: the following can be ignored if you do not plan to test iOS (iPhone) devices. The Mac setup is not needed for Android devices.<br />
<br />
=== Xcode ===<br />
Automation with iOS devices needs [https://developer.apple.com/xcode/ Xcode]. You can install it from the App Store. Please make sure that the version matches the tested iOS versions:<br />
{| class="wikitable"<br />
|-<br />
|'''iOS'''&nbsp;&nbsp; <br />
|'''Xcode'''<br />
|'''macOS'''<br />
|-<br />
|10.x<br />
|8.x<br />
|10.12 (Sierra)<br />
|-<br />
|11.x<br />
|9.x<br />
|10.13 (High Sierra)<br />
|-<br />
|12.x<br />
|10.x<br />
|10.14 (Mojave)<br />
|-<br />
|13.x<br />
|11.x<br />
|10.15 (Catalina)<br />
|}<br />
The minor versions must also fit, for iOS 10.2 at least Xcode 8.2, for iOS 10.3 at least Xcode 8.3, etc. So if you are upgrading to a newer iOS version, you will usually need a newer Xcode version as well. Newer versions of Xcode may not run on older operating systems, which in turn may require an operating system upgrade. If you also want to test older iOS versions, it can be useful to install the corresponding Xcode versions in parallel.<br />
<br />
Also see [https://en.wikipedia.org/wiki/Xcode#Version_comparison_table Xcode versions].<br />
<br />
=== Appium ===<br />
You can install Appium via the Mobile Testing Supplement for Mac OS:<br />
* '''expecco 20.2''': [https://download.exept.de/transfer/h-expecco-20.2.0/Mobile_Testing_Supplement_for_Mac_OS.tar.bz2 Mobile Testing Supplement for Mac OS (1.2.2)]<br />
:Contains Appium version 1.18.3 and uses node 14.<br />
<br />
* expecco 20.1: [https://download.exept.de/transfer/h-expecco-20.1.0/Mobile_Testing_Supplement_for_Mac_OS.tar.bz2 Mobile Testing Supplement for Mac OS (1.2.0)]<br />
:Only a few changes compared to the previous version.<br />
<br />
* expecco 19.2: [http://download.exept.de/transfer/h-expecco-19.2.0/MobileTestingSupplement_for_MacOS.tar.bz2 Mobile Testing Supplement for Mac OS (1.1.98)]<br />
:Appium is updated to version 1.16.0-rc.1 and node 12 is used.<br />
<br />
* expecco 19.1: [http://download.exept.de/transfer/h-expecco-19.1.0/Mobile_Testing_Supplement_for_Mac_OS_1.1.96.tar.bz2 Mobile Testing Supplement for Mac OS (1.1.96)]<br />
:This version contains Appium 1.12.0.<br />
<br />
* expecco 18.1: [http://download.exept.de/transfer/h-expecco-18.1.0/Mobile_Testing_Supplement_for_Mac_OS_1.1.94.tar.bz2 Mobile Testing Supplement for Mac OS (1.1.94)]<br />
:This version contains Appium 1.8.0.<br />
<br />
* expecco 2.11:[http://download.exept.de/transfer/h-expecco-2.11.1/Mobile_Testing_Supplement_for_Mac_OS_1.0.94.tar.bz2 Mobile Testing Supplement for Mac OS (1.0.94)]<br />
:This version contains Appium 1.6.4.<br />
<br />
* expecco 2.10: [http://download.exept.de/transfer/h-expecco-2.10.0/Mobile_Testing_Supplement_for_Mac_OS_1.0.tar.bz2 Mobile Testing Supplement for Mac OS]<br />
:Diese Version entält Appium 1.4.16.<br />
<br />
After you have downloaded the supplement, you can move it to a directory of your choice (e.g. your home directory) and unpack it there. A suitable command in a shell could look like this, adjust the version number accordingly:<br />
<br />
tar -xvpf Mobile_Testing_Supplement_for_Mac_OS_1.1.98.tar.bz2<br />
<br />
If your default Xcode installation is the one you want to use, you can start Appium directly from the file in the ''bin'' directory with the appropriate version number:<br />
<br />
Mobile_Testing_Supplement/bin/start-appium-1.16.0-rc.1<br />
<br />
If you want to use another Xcode than the one configured as default, you have to tell Appium the corresponding path by using the environment variable ''DEVELOPER_DIR''. For example, if you have installed Xcode in ''/Applications/Xcode-11.3.app'', you can start Appium this way:<br />
<br />
DEVELOPER_DIR="/Applications/Xcode-11.3.app/Contents/Developer" Mobile_Testing_Supplement/bin/start-appium-1.16.0-rc.1<br />
<br />
To find out what is set as the default Xcode installation on your system, use this command:<br />
<br />
xcode-select -p<br />
<br />
If Appium cannot find your Xcode installation, a message like this appears:<br />
''<blockquote>org.openqa.selenium.SessionNotCreatedException - A new session could not be created. (Original error: Could not find path to Xcode, environment variable DEVELOPER_DIR set to: /Applications/Xcode.app but no Xcode found)</blockquote>''<br />
In such a case, restart Appium by specifying a valid ''DEVELOPER_DIR''.<br />
<br />
=== Signing ===<br />
To establish a test connection with a device, you need an Apple account. For evaluation you can use a free account. This has the disadvantage that created profiles are only valid for one week and must be recreated afterwards. Also be careful when sharing the account, as certificates may be revoked or invalidated by automatic generation. As a result, apps that have already been signed can no longer be used.<br />
<br />
First, connect the device you want to use to your Mac via USB. Start Xcode and open ''Preferences''. Go to the Accounts page and create an entry with your account. You can then click on ''Manage Certificates...'' to see the certificates that belong to that account. To run tests, you need an iOS Development Certificate and the associated private key. If you do not already have one, create one. If you already have one, but it is not in your keychain (indicated by "Not in Keychain"), you can import it. In any case, open the keychain management on your Mac and select the keychain ''login''. If you want to import a certificate from a PKCS#12-Datei (Endung typischerweise .p12), you can do this via the menu File > ''Import objects''. If you don't know where the certificate is stored, you can also revoke it in Xcode and recreate it in your keychain. However, only do this if you know that the old certificate is no longer in use because it can no longer be used afterwards. Now the keychain should contain an iOS development certificate. From the right-click menu, select Information. Under the details of the certificate you will find the Team ID, which is referred to here as the Organizational Unit. Enter it in the Team ID field of the plug-in's settings, see [[#Plugin_Configuration|Plugin Configuration]].<br />
<br />
Return to Xcode und select ''Open...'' in the menue ''File'', to open the WebDriverAgent project. This is found in the Mobile Testing Supplements folder under<br />
''<nowiki>Mobile_Testing_Supplement/lib/node_modules/appium-1.16.0-rc.1/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj</nowiki>''<br />
<br />
[[Datei:MobileTestingWebDriverAgentXcode.png]]<br />
<br />
Select ''WebDriverAgentLib'' and the page ''Signing & Capabilities''. In the section ''Signing'' set the option ''Automatically manage signing'' and then select a team. Now switch to ''WebDriverAgentRunner'' and do the same there.<br />
<!-- (The following seems to not be relevant anymore.) Here you should see errors indicating that no Provisioning Profiles have been created or found. Therefore, go to the ''Build Settings'' page and look for the entry ''Product Bundle Identifier'' in the ''Packaging'' section. Change this from com.facebook.WebDriverAgentRunner to something Xcode accepts by changing the prefix. Xcode can now generate a matching Provisioning Profile and the errors on the General page should disappear. After that you can quit Xcode. --><br />
By setting the team, the errors showing up for WebDriverAgentRunner should disappear. After that you can quit Xcode.<br />
<br />
If you now connect to your device from expecco, the WebDriverAgent will be installed and started on it and then switch to the app to be tested. On the device, however, the execution of the WebDriverAgent must still be trusted. To do this, open the settings during the connection setup on the device and then the entry Device management under General. This entry is only visible if a developer app is installed on the device. You may therefore have to wait until the WebDriverAgent is installed before the entry appears. Select the entry of your Apple account and trust it. Since the WebDriverAgent will be uninstalled again if the start did not work, you have to do this during the connection setup. If this is too hectic for you, you can also execute the following code:<br />
<br />
''xcodebuild -project Mobile_Testing_Supplement/lib/node_modules/appium-1.16.0-rc.1/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=<udid>' test''<br />
<br />
This installs the WebDriverAgent on the device without deleting it again. Refer to the [https://support.apple.com/en-us/HT204460 Apple documentation] for details on installing and trusting such apps.<br />
<br />
== Plugin Configuration ==<br />
Before you start, please check the settings of the Mobile Testing Plugin and adjust them if necessary. Select the menu item "''Extras''" &#8594; "''Settings''" &#8594; "''Extensions''" &#8594; "''Mobile Testing''" (see fig.). By default, these paths are found automatically (1). To adjust a path manually, deactivate the corresponding check mark at the right. You'll see a drop-down list with some paths to choose from. If an entered path is wrong or cannot be found, the field is marked red and a message appears. Make sure that all paths are specified correctly.<br />
<br />
[[Datei:MobileTestingEinstellungen.png | thumb | 400px | Plugin Configuration]]<br />
<br />
*'''appium''': Enter the path to the executable file with which Appium can be started in the command line. Under Windows this file will usually be called "<code>appium.cmd</code>". This path is used when expecco starts an Appium server.<br />
*'''node''': Enter the path to the executable that starts Node (also called (also called "Node.js"). This path is passed to Appium when a server is started so that Appium can find it independently of the PATH variable. Under Windows this file is usually called "<code>node.exe</code>".<br />
*'''JAVA_HOME''': Enter the path to a JDK (Java Development Kit)here. This path is passed to each Appium server. Leave the field blank to use the value from the environment variable. To specify which Java should be used by expecco, set this path in the Java Bridge settings.<br />
*'''ANDROID_HOME''': Enter the path to an Android SDK here. This path is passed to each Appium server. Leave the field blank to use the value from the environment variable.<br />
*'''adb''': The path to the adb command. Under Windows the file is called "<code>adb.exe</code>". This file is used by expecco, for example, to get the list of connected devices. This path should be selected automatically, if the command is found in the ANDROID_HOME directory. This is also used by Appium. If expecco and Appium use different versions of adb, conflicts may occur.<br />
*'''android.bat''': This file is only needed to start the AVD and the SDK Manager, which deal with phone emulators. The file in the ANDROID_HOME directory will be selected automatically, if present there.<br />
*'''aapt''': The path to the "aapt" command here. Under Windows this file is called "<code>aapt.exe</code>". expecco uses "aapt" only in the connection editor to read the package and activities of an "apk" file. The file in the ANDROID_HOME directory will be selected automatically, if present there.<br />
<br />
[[Datei:MobileTestingJavaBridgeEinstellungen.png | thumb | 400px | JDK Configuration]]<br />
<br />
Starting with expecco 2.11, there is an additional field called ''Team ID''. If you run iOS tests, enter the Team ID of your certificate here. This is used for every iOS connection, unless you change the value in the connection settings in individual cases. For information on how to obtain the team ID, please refer to the section on [[#Signing| signing]] for installations on Mac OS. With expecco 2.10 and older, you can only enter the Team ID as capability for each connection setting separately. However, you must use the [[#Extended_View|extended view]] to do this. Enter the capability ''xcodeOrgId'' here and set the Team ID of the certificate as value.<br />
<br />
The server address setting at the bottom of the page refers to the behavior of the connection editor. It checks at the end whether the server address ends in ''/wd/hub'' as this is the usual form. If not, a dialog asks how to react. The defined behavior can be viewed and changed here.<br />
<br />
Also switch to the entry ''Java Bridge'' (see figure). Here you have to specify the path to your Java installation, which is used by expecco. Enter a JDK here. If you want to use the one from the Mobile Testing Supplement under Windows, the path is<br />
<nowiki>C:\Program Files (x86)\exept\Mobile Testing Supplement\jdk</nowiki><br />
You can also use the system settings.<br />
<br />
== Prepare Android Device ==<br />
If you connect an Android device under Windows, you may still need an adb driver for the device. You can usually find a suitable driver on the manufacturer's website. If you have installed the universal driver from the Mobile Testing Supplement, everything should already work for most devices. In some cases, Windows will automatically try to install a driver when you connect the device for the first time. <br><br />
'''Attention''': Before you can control a mobile device with the Appium plugin, you have to allow this debugging!<br />
<br />
For Android devices, you can find this option in the settings under ''[https://developer.android.com/studio/debug/dev-options Developer Options]'' called ''USB-Debugging''. If the developer options are not displayed, you can unlock them by tapping Build Number seven times in About the Phone.<br />
<br />
Also enable the ''Stay awake'' feature to prevent the device from turning off the screen during test creation or execution.<br />
<br />
For security reasons, USB debugging must be allowed for each computer individually. When connecting the device to the PC via USB, you must agree to the connection on the device. If you haven't done this for your computer yet, but no corresponding dialog appears on the device, it may help to unplug and reconnect the device. This can happen especially if you have installed the ADB driver while the device was already connected via USB. If this doesn't help either, open the notifications by dragging them from the top of the screen. There you will find the USB connection and you can open the options. Select another type of connection; usually MTP or PTP should work.<br />
<br />
You can also test on an emulator. It does not need to be prepared separately, as it is already designed for USB debugging. It is even possible to start an emulator at the beginning of the test.<br />
<br />
To check if a device you have connected to your computer can be used, open the [[#Connection_Editor|connection editor]]. The device should be displayed there.<br />
<br />
=== Connection via WLAN ===<br />
It is possible to connect to Android devices via Wireless LAN. To prepare and enable this, you have to connect initially via USB. Open a command window (terminal window) and enter:<br />
<nowiki>adb tcpip 5555</nowiki><br />
The device listens for a TCP/IP connection on port 5555. If you have several devices connected or emulators running, you have to specify which device you mean. Enter in this case:<br />
<nowiki>adb devices -l</nowiki><br />
to get a list of all devices, where the first column gives the device's ID.<br />
Then, enter:<br />
<nowiki>adb -s <deviceID> tcpip 5555</nowiki><br />
with the device identification of the desired device. You can now disconnect the USB connection.<br>Now you have to find out the IP address of your device. You can usually find it somewhere in the device's settings, for example in the Status or WLAN settings of the phone. Then type in:<br />
<nowiki>adb connect <IP address of device></nowiki><br />
The device should now be connected via WLAN and can be used in the same way as with a USB connection. You can check this by entering "<code>adb devices -l</code>" again or open the connection dialog in expecco. In the list, the device appears with its IP address and port. Remember that the WLAN connection no longer exists when the ADB server or the device is restarted.<br />
<br />
== Preparing an iOS-Device and App ==<br />
Control of iOS devices is only possible via a Mac. Please also read the section [[#Mac_OS|Installation under Mac OS]].<br />
<br />
Before you can control a mobile device with the Mobile Testing Plugin, you must allow debugging for iOS devices with iOS 8 or higher. Activate the option "''Enable UI Automation''" under the "''Developer''" menu in the device settings.<br>If you cannot find the "''Developer''" entry in the settings, proceed as follows: Connect the device to the Mac via USB. If necessary, you must still agree to the connection on the device. Start Xcode and then select "''Devices''" from the menu bar at the top of the screen in the "''Window''" menu. A window opens in which a list of the connected devices is displayed. Select your device there. Then the entry "''Developer''" should appear in the settings on the device. You may have to exit the settings and restart.<br />
<br />
[[Datei:Alert.png | thumb | 270px | Alert unter iOS]]<br />
It is not possible to establish a connection to the device as long as it shows certain alerts. Such an alert may appear if FaceTime is activated (by displaying a message about SMS charges as shown in the screenshot). Be sure to configure the device so that it does not show such alerts when idle.<br />
<br />
=== expecco 2.11 and later ===<br />
You can test any app which is executable or already installed on the device used. If the app is available as a development build, the UDID of the device must be stored in the app. In any case, the WebDriverAgent must be signed for the device. Please read the section about [[#Signing|signing]] under Mac OS.<br />
<br />
If you want to use the Home button in a test, you must activate "AssistiveTouch" on the device. You will find this option in the settings under "''General''" > "''Operating Help''" > "''AssistiveTouch''". Then place the menu in the middle of the upper edge of the screen. You can then record pressing the Home button with the corresponding menu entry in the recorder or use the "''Press Home Button''" block directly.<br />
<br />
=== expecco 2.10 ===<br />
The app you want to use must be available as a development build. The UDID of the device must also be stored in the app.<br />
<br />
=== Sign the development build ===<br />
A development build of an app is only allowed for a limited number of devices and cannot be started on other devices. However, it is possible to exchange the certificate and the usable devices in a development build.<br />
<br />
* Evaluation with demo app of eXept:<br />
:We will be happy to provide you with a demo app which is available as a development build and which we can sign for your device. Please send the UDID of your device to your eXept contact person. How to determine the UDID of your device is described in the following section.<br />
<br />
* Using your own app for your test device:<br />
:If you receive a development build (IPA file) from the app developers that is approved for your test device, you can use it directly. To do this, you must tell the developers the UDID of your device so they can enter it. '''You can use Xcode to read the UDID of a device'''. Start Xcode and select ''Devices'' from the menu bar at the top of the screen in the ''Window'' menu. A window opens in which a list of the connected devices is displayed. Select your device and search for the ''Identifier'' entry in Properties. The UDID is a 40-digit hexadecimal number.<br />
<br />
* Externally developed app for your test device:<br />
:You can also re-sign apps to make them run on other devices. However, this process is complicated and requires access to an Apple Developer account. A documentation on the procedure is currently in preparation.<br />
<br />
:For the evaluation we will gladly support you with the re-signing of your app..<br />
<!--<br />
Log in to the [https://developer.apple.com/ Apple-Webinterface]. Navigate to ''Certificates, IDs & Profiles''. If necessary, create a Developer Certificate and a Provisioning Profile for your device here and download both. If you don't have a Developer Account yet, create one here: https://developer.apple.com/enroll/. For this you have to register with an Apple-ID.<br />
<br />
# Find out Team ID (''Membership'' -> ''Team ID'')<br />
# Under ''Certificates, IDs & Profiles'' select development certificate (under ''+'' create, if not available) and download<br />
# Under ''App ID'' create Wildcard App ID, if not present. Note App ID (AppID = Prefix.ID)<br />
# Add device, find out UDID (or ''Identifier'') of the device (''Xcode'' -> ''Window'' (above in menu bar) -> ''Devices'')<br />
# Create commission profiles: ''iOS App Development'' -> Select ''AppID'' -> Select certificate -> Select device -> Create profile name -> Download provisioning profiles.<br />
# Import the downloaded certificate (''Downloads'' -> Certificate (.cer)<br />
# Copy SHA1 fingerprint. Right click on Certificate -> ''Information'', then scroll to the bottom of the page).<br />
# Create Entitlements.plist (''Open Terminal' -> Downloads/Mobile_Testing_Supplement/bin/gen-entitlements_plist 'Team-ID' 'App ID' Downloads/Mobile_Testing_Supplement/bin/re-sign-ipa <path to ipa (z.B. Downloads/expeccoMobileDemo.ipa)> \<br />
"<Zertifikat (SHA1-Fingerabdruck, z.B. 76 E8 4B E8 78 D5 D7 F9 2E 09 8B D7 E8 FB CE 30 0C F5 D0 EF)>" \<br />
<Path to Commission Profile (e.g. /Users/exept_test/Downloads/dut.mobileprovision)> \<br />
<Path for the result ipa (z.B. Downloads/expeccoMobileDemo_re-signed.ipa)> \<br />
[Pfad zur entitlements.plist] (z.B. /Users/exept_test/entitlements.plist)<br />
<br />
To re-sign, you can use the corresponding script from the Mobile Testing Supplement for Mac OS or any other tool (e.g. isign).<br />
--><br />
<br />
For more information about using iOS devices, see also the <br />
[http://appium.io/slate/en/master/?java#appium-on-real-ios-devices Appium documentation].<br />
<br />
=== Native iOS-Apps ===<br />
You can also use apps that are already natively present on the device. To do this, you must know their bundle ID and then enter it in the connection settings. Here is a small selection of common apps:<br />
{| style="text-align:left"<br />
! App<br />
!<br />
! Bundle-ID<br />
|-<br />
| App Store<br />
| <br />
| com.apple.AppStore<br />
|-<br />
| Calculator<br />
| <br />
| com.apple.calculator<br />
|-<br />
| Calendar<br />
| <br />
| com.apple.mobilecal<br />
|-<br />
| Camera<br />
| <br />
| com.apple.camera<br />
|-<br />
| Contacts<br />
| <br />
| com.apple.MobileAddressBook<br />
|-<br />
| iTunes Store<br />
| <br />
| com.apple.MobileStore<br />
|-<br />
| Mail<br />
| <br />
| com.apple.mobilemail<br />
|-<br />
| Maps<br />
| <br />
| com.apple.Maps<br />
|-<br />
| Messages<br />
| <br />
| com.apple.MobileSMS<br />
|-<br />
| Phone<br />
| <br />
| com.apple.mobilephone<br />
|-<br />
| Photos<br />
| <br />
| com.apple.mobileslideshow<br />
|-<br />
| Settings<br />
| <br />
| com.apple.Preferences<br />
|}<br />
<br />
You can find further Bundle-IDs [https://github.com/joeblau/apple-bundle-identifiers here].<br />
<br />
= Examples =<br />
In the demo test suites for expecco you will also find examples for tests with the Mobile Testing Plugin. To do this, select the option "''Example from File''" on the start screen and open the folder named "''mobile''".<br />
<br />
==<span id="TestsuiteMobileTestingDemo"><!-- Referenced by m01_MobileTestingDemo.ets --></span> ''m01_MobileTestingDemo.ets'' ==<br />
The test suite contains two simple test plans: "''Simple CalculatorTest''" and "''Complex Calculator and Messaging Test''". Both tests use an Android emulator, which you must start before starting. The apps used in the test are part of the basic equipment of the emulator and therefore no longer need to be installed. Since the apps may differ under every Android version, it is important that your emulator runs under Android 6.0. In addition, the language must be set to English.<br />
<br />
; Simple CalculatorTest<br />
: This test connects to the calculator and enters the formula ''2+3''. The result of the calculator is compared with the expected value ''5''.<br />
<br />
; Complex Calculator and Messaging Test<br />
: This test connects to the calculator and then opens the message service. There it waits for an incoming message from the number ''15555215556'', in which a formula to be calculated is sent. The message is generated before via a socket at the emulator. When the message arrives, it is opened by the test and its contents are read. Then the calculator is opened again, the received formula is entered and the result is read. The test then switches back to the message service and sends the result as an answer.<br />
<br />
== ''m02_expeccoMobileDemo.ets'' und ''m03_expeccoMobileDemoIOS.ets'' ==<br />
These are part of the tutorial for the Mobile Testing Plugin. The included test case is incomplete and will be added during the tutorial. Please read the section [[#Tutorial|Tutorial]].<br />
<br />
= Tutorial =<br />
This tutorial describes the basic procedure for creating tests with the Mobile Testing Plugin. The basis for this is a supplied example consisting of a simple app and an expecco test suite.<br />
<br />
The ''expecco Mobile Demo'' app calculates and checks various everyday codes: the IBAN from European payment transactions, the international GTIN 13 product codes found in retail bar codes, and the serial numbers on euro banknotes.<br />
<br />
The test-suite contains test cases for individual functions of the app. Not all functions are covered yet, but will be added in the course of the tutorial.<br />
<br />
There are two versions of these Tutorials:<br />
*'''[[#First_steps_with_Android|First steps with Android]]'''<br />
*'''[[#First_steps_with_iOS|First steps with iOS]]'''<br />
<br />
The procedure is almost identical in both versions, only the connection configurations are created differently. The finished tests then differ essentially in the paths for addressing the elements used, since these are technology-dependent.<br />
<br />
==<span id="FirstStepsAndroid"><!-- Referenced by m02_expeccoMobileDemo.ets --></span> First steps with Android ==<br />
It is assumed that you have already read the chapter [[#Installation_and_Setup|Installation and Setup]] and completed the necessary preparations for for using iOS devices under Mac OS. Connect the device you want to use to your Mac. Download the iOS version of the [http://download.exept.de/transfer/h-expecco-2.11.0-pre/expeccoMobileDemo.ipa expeccoMobileDemo-App] to your Mac. Since the app is a debug build, you still need to sign it for your device (see [[#Preparing an iOS-Device_and_App|Preparing an iOS-Device and App]]). Now start an Appium server on your Mac.<br />
<br />
=== Step 1: Run Demo ===<br />
Start expecco and open the test-suite ''m02_expeccoMobileDemo.ets'' via the button ''Example from file'' (fig. 1). As of expecco 2.11 this is located in the subfolder ''mobile''. Otherwise download the test-suite [http://download.exept.de/transfer/h-expecco-2.10.0/m03_expeccoMobileDemoIOS.ets m03_expeccoMobileDemoIOS.ets] to the computer where your expecco installation is located and open it. In this test-suite there is already a ready-made test plan with some test cases for this app.<br />
<br />
[[Datei:MobileTestingBeispielÖffnen.png | frame | left | Abb. 1: Beispiel-Testsuite öffnen]]<br />
<br clear="all"><br />
In the test suite the package of the demo app is included as an attachment ''(expeccoMobileDemo-debug.apk)''. With the provided module Export Demo App you can export the file to any location on your computer. Select the device (1) and click on the green play button (2) to execute the device (fig. 2). The block opens a file dialog in which you specify where the package should be saved.<br />
<br />
[[Datei:MobileTestingExportApp.png | frame | left | Abb. 2: App exportieren]]<br />
<br clear="all"><br />
Before we get into the rest of the test-suite, first configure the connection and which device you want to use. To do this, connect a device to your computer via USB or start an emulator.<br />
<br />
[[Datei:MobileTestingVerbinden.png | frame | left | Abb. 3: Verbindungseditor öffnen]]<br />
<br clear="all"><br />
Now open the GUI browser (1) and select the entry ''Mobile Testing'' (3) under ''Connect'' (2) (Fig. 3) to open the connection dialog.<br />
<br />
You will see a list of all connected Android devices (1) (Fig. 3). If your device does not appear in the list, make sure it is turned on and connected via USB. Otherwise read the section [[#Prepare_Android_Device|Prepare Android Device]]<br />
<br />
[[Datei:MobileTestingGerätAuswählen.png | frame | left | Abb. 4: Gerät im Verbindungsdialog auswählen]]<br />
<br clear="all"><br />
Once you have found your device in the list, select it and click ''Next'' (2).<br />
<br />
Next, specify which app you want to use (Fig. 5). You can choose if you want to start an app that is already installed on the device (''App on the device'') or if you want to install and start an app (''Install app''). In case you want to use an already installed app, you will get a list of all packages installed on the device (1), which are divided into system packages and foreign packages (2), as well as their activities (3). You can then simply select these in the respective fields.<br />
<br />
[[Datei:MobileTestingAppAuswählen.png | frame | left | Abb. 5: Auf dem Gerät installierte App angeben]]<br />
<br clear="all"><br />
For this tutorial the app you just exported from the test-suite should be installed. Select ''Install App'' and enter the appropriate path in App (1) (Fig. 6). You can use the button on the left (2) to open a file dialog where you can navigate to the file to enter it. The package (3) and the activity (4) of the app will be entered automatically. If the app has multiple activities, you can select the one you want. Now click on ''Next'' (5).<br />
<br />
[[Datei:MobileTestingAppInstallieren.png | frame | left | Abb. 6: App angeben, die auf dem Gerät installiert werden soll]]<br />
<br clear="all"><br />
On the last page you can see an overview of all previous data (1) (Fig. 7). Below, you can enter a name for the connection under which it will be displayed in the GUI browser (2). In addition, a connection can be identified by this name and used in blocks; the name must therefore be unique. If you do not specify a name, one is generated generically. Enter ''expeccoMobileDemo'' as the name. Enter the address for the Appium server in the field below (3). Appium is the interface, via which the connected devices are controlled. For this tutorial expecco manages the instances of the Appium server. Enter the local default address ''<nowiki>http://localhost:4723/wd/hub</nowiki>''. This is always the lowest entry in the proposal list. In addition the option ''Start if necessary'' is activated (4). expecco then checks if an Appium server is already running at the address and starts and ends it automatically if necessary. If the port ''4723'' is already occupied or if you want to use several connections at the same time, use a different port at this point. It is common to use the odd port numbers above ''4723'', i.e. ''4725'', ''4727'' and so on. Of course you can also use remote servers, but the automatic start and stop of a server can only be done locally by expecco.<br />
<br />
[[Datei:MobileTestingServerkonfiguration.png | frame | left | Abb. 7: Verbindungsnamen und Appium-Server konfigurieren]]<br />
<br clear="all"><br />
Now click on ''Save'' (5) to save the settings for the test execution. Settings can be saved as an attachment to an execution definition or to an external file (Fig. 8). If you have several projects open at the same time, you can select the project in which the attachment is to be created from the list. Click on ''Save'' in the ''Save settings in attachment'' area and enter ''expeccoMobileDemo'' as the name. Now click on ''Start server and connect'' (6) to establish a connection with the specified configuration.<br />
<br />
[[Datei:MobileTestingEinstellungenSpeichern.png | frame | left | Abb. 8: Einstellungen speichern]]<br />
<br clear="all"><br />
It may take a while to establish the connection. Wait until the connection is established and displayed in the GUI browser. You will see that the app is started on the device. Now you know that the configuration works. The saved settings should now be used for the test, which then establishes the same connection. Select the connection in the GUI browser, right-click and select 'Close Connection' from the context menu to avoid any conflict. Then switch back to the test-suite tab.<br />
<br />
In the test suite, the settings were created as an appendix ''expeccoMobileDemo'' (Fig 9). Select the ''Connect'' block (1) and switch to the ''Network'' view on the right (2). Drag and drop the settings into the network of the block (3). Connect the output pin ''pathName'' with the input pin ''stringOrFilename[1]'' of the block ''Connect from File'' (4). Confirm the changes with ''Apply'' (5). This block will establish the connection to the app at the beginning of the test.<br />
<br />
[[Datei:MobileTestingConnectblock.png | frame | left | Abb. 9: Verbindungsbaustein editieren]]<br />
<br clear="all"><br />
Now switch to the test plan ''Demo Test'' (1) (Fig. 10). This test plan already contains some finished test cases. Before and after the execution (2) one block is also entered: The just edited block ''Connect'' for the setup and the block ''Disconnect'' for the disconnection. By entering the two blocks at this point, the connection is terminated, especially if the test is aborted prematurely, e.g. because one of the test cases fails.<br />
<br />
[[Datei:MobileTestingTestplan.png | frame | left | Abb. 10: Testplanausführung]]<br />
<br clear="all"><br />
Now you can start the test plan ''Demo Test'' by clicking on the green Play button (3). The test plan should run without errors.<br />
<br />
=== Step 2: Creating a Block with the Recorder ===<br />
With the help of the integrated recorder, you can easily record execution sequences and store them in a block. This requires a connection to a test device, which is used to create the test.<br />
<br />
To establish a connection, switch back to the GUI browser. The connection that you created previously is still entered here. Since the same name was used for the connection in the test run, the settings were overwritten (in our case, the settings were identical anyway). The connection is currently not active, since it was terminated at the end of the execution. However, the settings are still entered there. To reestablish the connection with this configuration, select it, right-click it, and then ''Connect''.<br />
<br />
Wait until the connection is established (1), then press the record button (2) to start recording (Fig. 11).<br />
<br />
[[Datei:MobileTestingRecorderStarten.png | frame | left | Abb. 11: Recorder starten]]<br />
<br clear="all"><br />
A window opens with the Mobile Testing Recorder (Fig. 12). This shows a screenshot of the connected device. This screen allows you to control the device remotely. Every action you perform is recorded in the background.<br />
<br />
In the upper menu bar you can select the tool (1) with which you want to enter an action. The Auto tool is selected by default. You can use it to record certain actions by making gestures on the display with the mouse pointer. For example, if you left-click for a long time, this corresponds to a long tap on the element at this point. Instead of specifying the desired action with the corresponding gesture, you can also select it manually.<br />
<br />
A new test for the recognition of correct GTIN-13 codes should now be recorded. First click briefly on the button ''GTIN-13 (EAN-13)'' (2) of the app in the display to trigger a corresponding click on the device. During the execution of this action, the frame of the recorder will briefly turn red. If the recorder does not display the current view of the app afterwards, click on the update icon (3) in the recorder.<br />
<br />
[[Datei:MobileTestingRecorder1.png | frame | left | Abb. 12: Über Recorder zur GTIN-13-Activity wechseln]]<br />
<br clear="all"><br />
Then enter a correct GTIN-13 in the input field of the new page. To do this, right-click on the input field (1) and select the action ''Set text'' (2) in the context menu (Fig. 13). Enter any valid article number in GTIN-13 format, e.g. ''4006381333986'' (3). This text is now set in the app.<br />
<br />
[[Datei:MobileTestingRecorder2.png | frame | left | Abb. 13: GTIN-13-Code über Recorder eingeben]]<br />
<br clear="all"><br />
Now click on ''Verify'' (1) (Fig. 14). The app now displays ''OK'' (2) as the result. The test should determine whether this result is actually displayed. After a right click you can select the action ''Assure attribute'' (3) in the context menu. In the dialog that opens, select the property ''text'' (4) and confirm with ''OK'' (5). This time, no action is triggered on the device, but only a block is recorded that fails if the result deviates from the expected value ''OK''.<br />
<br />
[[Datei:MobileTestingRecorder3.png | frame | left | Abb. 14: Antwort der App über Recorder auslesen]]<br />
<br clear="all"><br />
Now close the recorder. In the ''workspace'' of the GUI browser you can see that a block has been created for each of the recorded actions (Fig. 15). You can now test whether the recorded action can be played back. To do this, you must first return the app on your device to its initial state by using the ''HOME'' button on the top right of the device. Then click in expecco on the green Play button (1). If everything turns green, the execution was successful. Now create a new block in the test-suite by clicking on the block symbol (2) in the upper right corner. Give it the name ''GTIN_Verify_OK'' (3) and confirm (4).<br />
<br />
[[Datei:MobileTestingArbeitsbereich.png | frame | left | Abb. 15: Neuen Baustein aus Arbeitsbereich exportieren]]<br />
<br clear="all"><br />
Now close the connection by selecting the connection, right-clicking and selecting ''Close connection'' from the context menu.<br />
<br />
Switch back to the Testsuite tab. The new block was created there. Again select the test plan ''Demo-Test'' and add the recorded test case ''GTIN_Verify_OK'' by drag-and-drop at the end of the test plan. Apply the change and restart. The test plan should run again without errors.<br />
<br />
=== Step 3: Customizing XPath Using the GUI Browser ===<br />
Your new device may not work on other devices. The elements used are addressed via an XPath and this cannot be correct on other devices. See the [[#XPath_Customizing_using_the_GUI-Browsers|Customizing XPath Using the GUI-Browser]] section for more information. If you have another device available, you can now try to generalize the paths in your created devices. You can also skip this step.<br />
<br />
If you find it difficult to find shortened paths, follow the paths of the existing blocks. Start the test again. If the test now fails, check the paths again in the GUI browser.<br />
To run the test on a second device, open in the menu ''Extensions'' > ''Mobile Testing'' > ''Create connection settings''. You will get a dialog similar to the connection dialog. However, you can only create and save settings but not establish a connection. However, you have the option to save individual aspects of the settings, such as only the device. Select the new device and click on the Save icon in the attachment until the delayed menu opens (Fig. 16). Select ''Save device settings'' here. It is best to name the attachment after the device. You can then close the dialog again.<br />
<br />
[[Datei:MobileTestingGerätSpeichern.png | frame | left | Abb. 16: Einstellungen für ein Gerät speichern]]<br />
<br clear="all"><br />
Select the ''Connect'' block and drag the settings for the new device into its network. Now connect its output pin ''pathName'' with the input pin ''stringOrFilename[2]'' of the block ''Connect from File''. The block Connect from File reads the information at the input pins from top to bottom, multiple properties are replaced. In this case, the settings for the device used are replaced, while the other settings remain the same. If you have chosen the paths skilfully, the test will now also run successfully on the other device.<br />
<br />
=== Step 4: Create another block ===<br />
If the same procedures are repeated in the test, you can reuse or modify blocks that have already been created for this purpose. The block created in step 2 checks the recognition of correct GTIN 13 codes. A test is still missing which, conversely, checks the detection of a wrong GTIN-13 code. The structure of the two tests is identical, they only differ in their parameters. Therefore, copy the block ''GTIN_Verify_OK'' and rename the copy to ''GTIN_Verify_NOT_OK''. Change the input of the GTIN-13 to a wrong code, for example by changing the last digit (''4006381333987'') and set the check value of the output to ''NOT OK'' (Fig. 17).<br />
<br />
[[Datei:MobileTestingGTIN_Verify_NOT_OK.png | frame | left | Abb. 17: Baustein editieren]]<br />
<br clear="all"><br />
Add this new test to the Test Plan Demo Test as well and place it at the end. Run the test plan, but don't forget to disconnect in the GUI browser first.<br />
<br />
The new test will fail because the device you added does not return to the start page of the app, but the tests start from there. This is already considered in the other blocks; they always execute the block ''Back to main menu'' at the end. You can see this by selecting one of the other blocks, e.g. ''GTIN_Calculate'', and switching to its schematic view. There the block ''Back to main menu'' is displayed in the field ''After execution'' (Fig. 18). As with the corresponding field in the test plan, this block is always executed at the end, regardless of whether the test is successful or aborted. Now add this entry to your blocks ''GTIN_Verify_OK'' and ''GTIN_Verify_NOT_OK''. Select the block and drag the block ''Back to main menu'' in the schema view to the input field ''After execution''. Now you can start the test plan and all tests should be executed again without any problems.<br />
<br />
[[Datei:AppiumDemo Nach Ausführung.png | frame | left | Abb. 18: Nach-Ausführungs-Baustein setzen]]<br />
<br clear="all"><br />
<br />
=== Step 5: Complete Test ===<br />
For the Activity IBAN all answer possibilities of the app are already covered with test cases. In the GTIN-13-Activity a correct and a faulty code are tested and a check digit is calculated, but the behaviour of the app in case of input of wrong length is not tested yet (With Verify '''Input must be exactly 13 digits''. and ''...12 digits''. for Calculate). The activity for checking the serial numbers of euro banknotes is not yet tested. As with the IBAN, three cases can occur here: a correct serial number was entered (answer: ''OK''), an incorrect serial number was entered (answer: ''NOT OK'') or the specification does not correspond to the format (answer: ''A serial number consists of 12 characters with the first one or two being capital letters (A-Z).''). You can now extend the test coverage by creating test cases. You can create the blocks for this with the recorder as in step 2 and generalize the XPaths if necessary. If you are familiar with the basic handling of expecco, you can of course also create blocks without recorder by manually assembling them from existing blocks of the library. You can also combine both approaches as you wish.<br />
<br />
Note that the test cases presented here only check individual entries. If you write test cases for your own apps, you will probably want to test more closely by entering more different values, including edge cases.<br />
<br />
==<span id="FirstStepsIOS"><!-- Referenced by m03_expeccoMobileDemoIOS.ets --></span> First steps with iOS ==<br />
It is assumed that you have already read the chapter [[#Installation_and_Setup|Installation and Setup]] and completed the necessary preparations for using iOS devices under Mac OS. Connect the device you want to use to your Mac. Download the iOS version of the [http://download.exept.de/transfer/h-expecco-2.11.0-pre/expeccoMobileDemo.ipa expeccoMobileDemo-App] to your Mac. Since the app is a debug build, you still need to sign it for your device (see [[#iOS-Ger.C3.A4t_und_App_vorbereiten|iOS-Device and App preparing]]). Now start an Appium server on your Mac.<br />
<br />
=== Step 1: Run Demo ===<br />
Start expecco and open the test-suite ''m03_expeccoMobileDemoIOS.ets'' via the button ''Example from file'' (Fig. 1). As of expecco 2.11 this is located in the subfolder ''mobile''. Otherwise download the test-suite [http://download.exept.de/transfer/h-expecco-2.10.0/m03_expeccoMobileDemoIOS.ets m03_expeccoMobileDemoIOS.ets] to the computer on which your expecco installation is located and open it. In this test-suite there is already a ready-made test plan with some test cases for this app. <br />
<br />
[[Datei:MobileTestingIOSBeispielÖffnen.png | frame | left | Abb. 1: Beispiel-Testsuite öffnen]]<br />
<br clear="all"><br />
Before we get into the rest of the test-suite, first configure the connection and which device you want to use. Now open the GUI browser (1) and select the entry ''Mobile Testing'' (3) under ''Connect'' (2) (Fig. 2) to open the connection dialog.<br />
[[Datei:MobileTestingVerbinden.png | frame | left | Abb. 2: Verbindungseditor öffnen]]<br />
<br clear="all"><br />
<br />
Here you can enter an iOS device only by hand. Select ''Enter iOS device'' (Fig. 3). The name and iOS version of the device can be found in its properties. To find out the device ID of the device, open the Devices (Command-Shift-2) window in Xcode on the Mac. All connected devices and the available simulators are displayed there. Here you can also see the device ID (udid) of your device and which apps have been installed. After you have entered the device in the connection editor, select it in the list and click Next.<br />
<br />
[[Datei:MobileTestingIOSGerät.png | frame | left | Abb. 3: Hinzufügen eines iOS-Geräts]]<br />
<br clear="all"><br />
<br />
Next, specify which app you want to use. You can choose whether you want to start an app that is already installed on the device (''App on the device'') or if you want to install and start an app (''Install app''). In case you want to use an already installed app, you have to specify its bundle ID. You will also find this in the Devices window of Xcode. For the demo app it is ''de.exept.expeccoMobileDemo''.<br />
<br />
For this tutorial the demo app has to be installed first. Select ''Install App'' and enter the path to the file on your Mac (fig. 4). If you are using expecco 2.11, you can also specify the Team-ID on this page, which specifies which certificate should be used for iOS connections. If you have already specified an ID in [[#Configuration_of_Plugins|Plugin Settings]], it will be used. It will be grayed out unless you specify another value. Now click on ''Next''.<br />
<br />
[[Datei:MobileTestingIOSAppInstallieren.png | frame | left | Abb. 4: App angeben, die auf dem Gerät installiert werden soll]]<br />
<br clear="all"><br />
<br />
On the last page you can see an overview of all previous data (1) (Fig. 5). Below the Capabilities list, you can enter a name for the connection under which it is displayed in the GUI browser (2). In addition, a connection can be identified by this name and used in blocks; the name must therefore be unique. If you do not specify a name, one is generated generically. Enter ''expeccoMobileDemo'' as the name. Enter the address for the Appium server in the field below (3). If you have started the Appium server with default settings, you only have to replace ''localhost'' in the default address (lowest entry of the suggestion list) with the IP address of the Mac (in the picture ''172.23.1.49''). To make sure which port the Appium server is listening on, see its output. At the beginning there is the line<br />
<nowiki>info: Appium REST http interface listener started on 0.0.0.0:4723</nowiki><br />
If the default port ''4723'' does not appear at the end, change this value accordingly in the configuration.<br />
<br />
If the option ''Start on demand'' (4) is activated, expecco checks if an Appium server is already running at the address and starts and stops it automatically if necessary. However, this is only possible for local server addresses, so deactivate this option.<br />
<br />
[[Datei:MobileTestingServerkonfigurationIOS.png | frame | left | Abb. 5: Verbindungsnamen und Appium-Server konfigurieren]]<br />
<br clear="all"><br />
<br />
Now click on ''Save'' (5) to save the settings for the test execution. Settings can be saved as an attachment to an execution definition or to an external file (Fig. 6). If you have several projects open at the same time, you can select the project in which the attachment is to be created from the list. Click on ''Save'' in the ''Save settings in attachment'' area and enter ''expeccoMobileDemo'' as the name. Now click on ''Connect'' (6) to establish a connection with the specified configuration.<br />
<br />
[[Datei:MobileTestingEinstellungenSpeichern.png | frame | left | Abb. 6: Einstellungen speichern]]<br />
<br clear="all"><br />
<br />
It may take a while to establish the connection. If you have entered the correct server address, you should see the connection attempt in the Appium server output. The app should be started on your iOS device. If nothing happens on the device, either the device or the app may not be found. If Appium tries to start the app and this fails, the app is probably signed incorrectly. In this case, uninstall the app so that it can be reinstalled with a new signature.<br />
<br />
Wait until the connection is established and displayed in the GUI browser. Now you know that the configuration works. The saved settings should now be used for the test, which then establishes the same connection. Select the connection in the GUI browser, right-click and select 'Close Connection' from the context menu to avoid any conflict. Then switch back to the test-suite tab.<br />
<br />
In the test suite, the settings were created as an appendix ''expeccoMobileDemo'' (Fig 7). Select the ''Connect'' block (1) and switch to the ''Network'' view on the right (2). Drag and drop the settings into the network of the block (3). Connect the output pin ''pathName'' with the input pin ''stringOrFilename[1]'' of the block ''Connect from File'' (4). Confirm the changes with ''Apply'' (5). This block will establish the connection to the app at the beginning of the test.<br />
<br />
[[Datei:MobileTestingConnectblock.png | frame | left | Abb. 7: Verbindungsbaustein editieren]]<br />
<br clear="all"><br />
<br />
Now switch to the test plan ''Demo Test'' (1) (Fig. 8). This test plan already contains some finished test cases. Before and after the execution (2) one block is also entered: The just edited block ''Connect'' for the setup and the block ''Disconnect'' for the disconnection. By entering the two blocks at this point, the connection is terminated, especially if the test is aborted prematurely, e.g. because one of the test cases fails.<br />
<br />
[[Datei:MobileTestingTestplan.png | frame | left | Abb. 8: Testplanausführung]]<br />
<br clear="all"><br />
Now you can start the test plan ''Demo Test'' by clicking on the green Play button (3). The test plan should run without errors.<br />
<br />
=== Step 2: Creating a block with the Recorder ===<br />
With the help of the integrated recorder, you can easily record execution sequences and store them in a block. This requires a connection to a test device, which is used to create the test.<br />
<br />
To establish a connection, switch back to the GUI browser. The connection that you created previously is still entered in this browser. Since the same name was used for the connection in the test run, the settings were overwritten with it (in our case, the settings were identical anyway). The connection is currently not active, since it was terminated at the end of the execution. However, the settings are still entered there. To reestablish the connection with this configuration, select it, right-click it, and then ''Connect''.<br />
<br />
Wait until the connection is established (1) and then press the record button (2) to start recording (Fig. 9).<br />
<br />
[[Datei:MobileTestingRecorderStarten.png | frame | left | Abb. 9: Recorder starten]]<br />
<br clear="all"><br />
A window opens with the Mobile Testing Recorder (Fig. 10). This shows a screenshot of the connected device. This screen allows you to control the device remotely. Every action you perform is recorded in the background.<br />
<br />
In the upper menu bar, you can select the tool (1) with which you want to enter an action. The tool ''Auto'' is selected by default. You can use it to record certain actions by making gestures on the display with the mouse pointer. For example, if you left-click for a long time, this corresponds to a long tap on the element at this point. Instead of specifying the desired action with the corresponding gesture, you can also select it manually.<br />
<br />
Now a new test for the recognition of correct GTIN-13 codes shall be recorded. First click briefly on the button ''GTIN-13 (EAN-13)'' (2) of the app in the display to trigger a corresponding click on the device. During the execution of this action, the frame of the recorder will briefly turn red. If the recorder does not display the current view of the app afterwards, click on the update icon (3) in the recorder.<br />
<br />
[[Datei:MobileTestingRecorder1iOS.png | frame | left | Abb. 10: Über Recorder zur GTIN-13-Activity wechseln]]<br />
<br clear="all"><br />
Then enter a correct GTIN-13 in the input field of the new page. To do this, right-click on the input field (1) and select the action ''Set text'' (2) in the context menu (Fig. 11). Enter any valid article number in GTIN-13 format, e.g. ''4006381333986'' (3). This text is now set in the app.<br />
<br />
[[Datei:MobileTestingRecorder2iOS.png | frame | left | Abb. 11: GTIN-13-Code über Recorder eingeben]]<br />
<br clear="all"><br />
Now click on ''Verify'' (1) (Fig. 12). The app now displays ''OK'' (2) as the result. The test should determine whether this result is actually displayed. After a right click you can select the action ''Assure attribute'' (3) in the context menu. In the dialog that opens, select the property ''value'' (4) and confirm with ''OK'' (5). This time, no action is triggered on the device, but only a block is recorded that fails if the result deviates from the expected value ''OK''.<br />
<br />
[[Datei:MobileTestingRecorder3iOS.png | frame | left | Abb. 12: Antwort der App über Recorder auslesen]]<br />
<br clear="all"><br />
Now close the recorder. In the ''workspace'' of the GUI browser you can see that a block has been created for each of the recorded actions (Fig. 13). You can now test whether the recorded action can be played back. To do this, you must first return the app on your device to its initial state by using the ''Home'' button on the top left of the device. Then click in expecco on the green Play button (1). If everything turns green, the execution was successful. Now create a new block in the test-suite by clicking on the block symbol (2) in the upper right corner. Give it the name ''GTIN_Verify_OK'' (3) and confirm (4).<br />
<br />
[[Datei:MobileTestingArbeitsbereich.png | frame | left | Abb. 13: Neuen Baustein aus Arbeitsbereich exportieren]]<br />
<br clear="all"><br />
Now close the connection by selecting the connection, right-clicking and selecting ''Close connection'' from the context menu.<br />
<br />
Switch back to the Testsuite tab. The new module was created there. Again select the test plan ''Demo-Test'' and add the recorded test case ''GTIN_Verify_OK'' by drag-and-drop at the end of the test plan. Apply the change and restart. The test plan should run again without errors.<br />
<br />
=== Step 3: Customizing XPath Using the GUI Browser ===<br />
Your new device may not work on other devices. The elements used are addressed via an XPath and this cannot be correct on other devices. See the [[#XPath_Customizing_using_the_GUI_Browser|Customizing_XPath using the GUI Browser]] section for more information. If you have another device available, you can now try to generalize the paths in your created devices. You can also skip this step.<br />
<br />
If you find it difficult to find shortened paths, follow the paths of the existing blocks. Start the test again. If the test now fails, check the paths again in the GUI browser.<br />
To run the test on a second device, open in the menu ''Extensions'' > ''Mobile Testing'' > ''Create connection settings''. You will get a dialog similar to the connection dialog. However, you can only create and save settings but not establish a connection. However, you have the option to save individual aspects of the settings, such as only the device. Enter the new device and select it. Click longer on the symbol for saving in the attachment until the delayed menu opens and select ''Save device settings'' here (Fig. 14). It is best to name the attachment after the device. You can then close the dialog again.<br />
<br />
[[Datei:MobileTestingGerätSpeichern.png | frame | left | Abb. 14: Einstellungen für ein Gerät speichern]]<br />
<br clear="all"><br />
Select the ''Connect'' block and drag the settings for the new device into its network. Now connect its output pin ''pathName'' with the input pin ''stringOrFilename[2]'' of the block ''Connect from File''. The block Connect from File reads the information at the input pins from top to bottom, multiple properties are replaced. In this case, the settings for the device used are replaced, while the other settings remain the same. If you have chosen the paths skilfully, the test will now also run successfully on the other device.<br />
<br />
=== Step 4: Create another block ===<br />
If the same procedures are repeated in the test, you can reuse or modify modules that have already been created for this purpose. The block created in step 2 checks the recognition of correct GTIN 13 codes. A test is still missing which, conversely, checks the detection of a wrong GTIN-13 code. The structure of the two tests is identical, they only differ in their parameters. Therefore copy the block ''GTIN_Verify_OK'' and rename the copy to ''GTIN_Verify_NOT_OK''. Change the input of the GTIN-13 to a wrong code, for example by changing the last digit (''4006381333987'') and set the check value of the output to ''NOT OK'' (Fig. 15).<br />
<br />
[[Datei:MobileTestingGTIN_Verify_NOT_OK_iOS.png | frame | left | Abb. 15: Baustein editieren]]<br />
<br clear="all"><br />
Add this new test to the Test Plan Demo Test as well and place it at the end. Run the test plan, but don't forget to disconnect in the GUI browser first.<br />
<br />
The new test will fail because the device you added does not return to the start page of the app, but the tests start from there. This is already considered in the other blocks; they always execute the block ''Back to main menu'' at the end. You can see this by selecting one of the other blocks, e.g. ''GTIN_Calculate'', and switching to its schematic view. There the block ''Back to main menu'' is displayed in the field ''After execution'' (Fig. 16). As with the corresponding field in the test plan, this block is always executed at the end, regardless of whether the test is successful or aborted. Now add this entry to your blocks ''GTIN_Verify_OK'' and ''GTIN_Verify_NOT_OK''. Select the block and drag the block ''Back to main menu'' in the schema view to the input field ''After execution''. Now you can start the test plan and all tests should be executed again without any problems.<br />
<br />
[[Datei:AppiumDemo Nach Ausführung.png | frame | left | Abb. 16: Nach-Ausführungs-Baustein setzen]]<br />
<br clear="all"><br />
<br />
=== Step 5: Complete test ===<br />
For the Activity IBAN all answer possibilities of the app are already covered with test cases. In the GTIN-13-Activity a correct and a faulty code are tested and a check digit is calculated, but the behaviour of the app in case of input of wrong length is not tested yet (With Verify '''Input must be exactly 13 digits''. and ''...12 digits''. for Calculate). The activity for checking the serial numbers of euro banknotes is not yet tested. As with the IBAN, three cases can occur here: a correct serial number was entered (answer: ''OK''), an incorrect serial number was entered (answer: ''NOT OK'') or the specification does not correspond to the format (answer: ''A serial number consists of 12 characters with the first one or two being capital letters (A-Z).''). You can now extend the test coverage by creating test cases. You can create the blocks for this with the recorder as in step 2 and generalize the XPaths if necessary. If you are familiar with the basic handling of expecco, you can of course also create blocks without recorder by manually assembling them from existing blocks of the library. You can also combine both approaches as you wish.<br />
<br />
Note that the test cases presented here only check individual entries. If you write test cases for your own apps, you probably want to test more closely by entering more different values, including edge cases.<br />
<br />
= Dialogs of the Mobile Testing Plugin =<br />
== Connection Editor ==<br />
You can use the Connection Editor to quickly define, change, or establish connections. Depending on the task, the dialog has small differences and is opened differently:<br />
*If you want to establish a connection, access the dialog in the GUI browser by clicking on ''Connect'' and then selecting ''Mobile Testing''.<br />
*To change or copy an existing connection in the GUI browser, select it, right-click and select ''Edit Connection'' or ''Copy Connection'' from the context menu.<br />
*If you do not want to create connection settings for the GUI browser but for use in a test, choose ''Create Connection Settings'' from the Mobile Testing Plugin menu.... This only allows you to create the settings for a connection without creating a connection in the GUI browser.<br />
<br />
The Connection Editor menu has several buttons, some of which are only visible when creating connection settings:<br />
[[Datei:MobileTestingVerbindungseditorMenu.png]]<br />
#''Delete Settings'': Resets all entries. (Only visible when creating settings.)<br />
#''Load settings from file'': Allows to open a saved settings file (*.csf). Its settings are transferred to the dialog. Entries already made without conflict are retained.<br />
#''Load settings from attachment'': Allows you to open an attachment with connection settings from an open project. These settings are applied to the dialog. Entries already made without conflict are retained.<br />
#''Save settings to file'' and<br />
#''Save settings to attachment'': Here you can save the entered settings to a file (*.csf) or create them as an attachment in an open project. Both options have a delayed menu in which you can choose to save only a certain part of the settings. (Only visible when creating settings.)<br />
#''Advanced View'': Allows you to switch to the advanced view to make additional settings. Read more about this at the end of this chapter. (Only visible when creating settings.)<br />
#''Help'': A help text for the respective step is shown or hidden on the right side.<br />
<br />
<br />
The dialog is divided into three steps. In the first step you select the device you want to use, in the second step you select which App should be used and in the last step the settings for the Appium server are made.<br />
<br />
===<span id="AppiumConnectionEditorStep1"><!-- Referenced by AppiumConnectionEditor in Mobile Testing Plugin --></span>Step 1: Select Device ===<br />
In the upper part you will see a list of all connected Appium devices that are detected. With the checkbox below you can hide devices that are detected but not ready. If you want to enter a device that is not connected, you can create it with the corresponding button ''Enter Android device'' or ''Enter iOS device''. However, you need to know the required properties of your device. The device is then created in a second device list and can be selected there. If no list with connected elements can be displayed, various messages are displayed instead:<br />
*No devices found<br />
*:expecco could not find any Android devices.<br />
*:To automatically configure a connection to a device, make sure<br />
*:*it is connected<br />
*:*it is turned on<br />
*:*that it has an appropriate adb driver installed<br />
*:*it is enabled for debugging (see below).<br />
*No available devices found<br />
*:expecco could not find any available Android devices. But not available ones were found, e.g. with the status "unauthorized".<br />
*:To configure a connection to a device automatically, make sure that <br />
*:*it is connected<br />
*:*it is turned on<br />
*:*that it has an appropriate adb driver installed<br />
*:*it is enabled for debugging (see below).<br />
*:To view unavailable devices, enable this option below.<br />
*Connection lost<br />
*:expecco has lost the connection to the adb server. Try to re-establish the connection by clicking on the button.<br />
*Connection failed<br />
*:expecco could not connect to the adb server. Possibly it is not running or the specified path is not correct.<br />
*:Check the adb configuration in the settings and try to start the adb server and establish a connection by clicking on the button.<br />
*Connect ...<br />
*:expecco connects to the adb server. This may take a few seconds.<br />
*Start adb-Server ...<br />
*:expecco starts the adb-Server. This may take a few seconds.<br />
<br />
<!--With ''Automation by'' you can specify, which automation engine is to be used. If you leave the setting at ''(Default)'' the corresponding capability is not set at all. Otherwise Appium, Selendroid and from expecco 2.11 XCUITest are available. Selendroid is usually only used for Android devices prior to version 4.1.-->With ''Next'' you get to the next step. If you enter settings for the GUI browser, this is only possible once a device has been selected.<br />
<br />
<span id="UnlockingDeveloperOptions">Note on unlocking</span>: In newer Android versions the developer options are no longer offered in the settings at first. If your Android device does not show an entry for "''Developer options''" in the settings, first select the entry "''Phone info''", then "''SoftwareVersionsInfo''" and click on the entry "''BuildVersion''" several times.<br />
<br />
===<span id="AppiumConnectionEditorStep2"><!-- Referenced by AppiumConnectionEditor in Mobile Testing Plugin --></span>Step 2: Select App===<br />
Here you can enter information about the app to be tested. You can decide if you want to use an app that is already installed on the device or if you want to install an app for the test. Select the appropriate tab above. Depending on whether you selected an Android or an iOS device in the previous step, the required input will change.<br />
<br />
*'''Android'''<br />
**''App on Device''<br />
**:If you have selected a connected device in the first step, the packages of all installed apps are automatically retrieved and you can select from the drop-down lists. The installed apps are divided into third-party packages and system packages; select the appropriate package list. This selection does not belong to the settings, but only provides the corresponding package list. You can use the filter to further narrow down the list and then select the desired package. The activities of the selected package are also automatically retrieved and made available as a drop-down list. Select the activity you want to start. As a rule, an activity is automatically entered from the list. If you are not using a connected device, you must enter the package and the activity manually.<br />
**''Install App''<br />
**:Under ''App'', enter the path to an app. The path must be valid for the Appium server being used. You can also specify a URL. If you are using a local Appium server, you can use the right button to navigate to the App installation file and enter this path. If possible, the corresponding package and the activity are also entered in the fields below. However, this entry is not necessary.<br />
<br />
*'''iOS'''<br />
**''App on Device''<br />
**:Specify the bundle ID of an installed app. You can find out the IDs of the installed apps using Xcode, for example. Start Xcode and select ''Devices'' from the menu bar at the top of the screen in the ''Window'' menu. A window will open displaying a list of connected devices. If you select your device, you will see a list of the apps you have installed in the overview.<br />
**''Install App''<br />
**:Under ''App'', enter the path to an app. The path must be valid for the Appium server being used. You can also specify a URL. For the requirements of apps for real devices, please read the section [[#iOS-Ger.C3.A4t_and_App_Preparing|Preparing an iOS-Device and App]].<br />
<br />
In the lower part you can specify whether the app should be reset or uninstalled when the connection is terminated, and whether it should be reset initially. Again, the corresponding capability is not set if you select ''(Default)''. With ''Next'' you get to the next step.<br />
<br />
===<span id="AppiumConnectionEditorStep3"><!-- Referenced by AppiumConnectionEditor in Mobile Testing Plugin --></span>Step 3: Server Settings===<br />
In the last step, a list of all the capabilities that result from your entries in the previous steps is first displayed in the upper part. If you are familiar with Appium and want to set additional capabilities that are not covered by the connection editor, you can click on ''Edit'' to open the extended view. See the section below for more information.<br />
<br />
If you enter settings for the GUI browser, you can enter the ''Connection name'' with which the connection is displayed. This is also the name under which devices can use this connection when it is established. If you leave the field blank, a name will be generated. To specify the address for the Appium server, you get the local default address and addresses already used for selection. If you check the box for ''Start on demand'', expecco tries to start an Appium server at the given address when connecting, if none is running there yet. This server will then also be shut down when the connection is terminated. This only works for local addresses. Make sure that you only use port numbers that are free. It is best to only use odd port numbers from the standard port 4723. The following port number is also used when establishing a connection, which could otherwise lead to conflicts.<br />
<br />
Depending on how you opened the dialog, there are now different buttons to close it. In any case you have the option to save. This opens a dialog where you can either select an open project to save the settings there as an attachment, or choose to save it to a file that you can then specify. Saving does not close the dialog, allowing you to select another option.<br />
<br />
If you have opened the editor for establishing a connection, you can finally click on ''Connect'' or ''Start and connect server'', depending on whether the check mark for server start is set. For changing or copying a connection in the GUI Browser, this option is called ''Apply'', since in this case only the connection entry is changed or created, but the connection setup is not started. If necessary, you can do this afterwards via the context menu. If you have changed capabilities of an existing connection, a dialog then prompts you to decide whether these changes should be applied directly by closing the connection and establishing the new connection or not. In this case, the changes only take effect after you reestablish the connection.<br />
<br />
To use the connection editor, also read the corresponding section in the respective tutorial in step 1. (Android: [[#Step_1:_Demo_Run|Run Demo]], iOS: [[#Step_1:_Demo_Run_2|Run Demo]]).<br />
<br />
===Extended View===<br />
The extended view of the connection editor can be obtained either by clicking on ''Edit'' in the third step or at any time via the corresponding menu item if you have started the editor via the plugin menu. This view displays a list of all configured Appium Capabilities. You can add, change or remove further entries to this list. To add a capability, select it from the drop-down list of the input field. In this list all known capabilities are sorted into the categories ''Common'', ''Android'' and ''iOS''. If you have selected a capability, a short information text is displayed. You can also enter a capability manually in the field. Then click on ''Add'' to add the capability to the list. There you can set the value in the right column. To delete an entry, select it and click on ''Remove''. With ''Back'' you leave the extended view.<br />
<br />
[[Datei:MobileTestingErweiterteAnsicht.png]]<br />
<br />
== Running Appium Servers ==<br />
In the menu of the Mobile Testing Plugin you will find the entry ''Appium-Server...''. This opens a window with an overview of all Appium servers started by expecco and on which port they are running. By clicking on the icon in the column ''Show Log'' you can view the logfile of the corresponding server. This is deleted when the server is shut down. With the icons in the column ''Exit'' the corresponding server can be terminated. However, this is prevented if expecco still has an open connection via this server.<br />
<br />
You can also start servers here. Use the input fields to configure the server address. You can also leave the fields blank to use the default values. Please note that servers can only be started locally and the selected port must not be occupied. Typically the odd port numbers from 4723 are used. The following port number is also required when connecting to a device, which could lead to conflicts with the even numbers.<br />
<br />
[[Datei:MobileTestingAppiumServer.png]]<br />
<br />
In the menu of the Mobile Testing Plugin you will also find the entry ''Close all Connections and Servers''. This is intended for cases where connections or servers cannot be terminated in any other way. If possible, always terminate connections in the GUI browser or by executing a corresponding block. Servers that you have started in the server overview should be terminated there; servers that were started with a connection are automatically terminated with this connection.<br />
<br />
Note that only servers started and managed by expecco are listed in the overview. Possible other Appium servers that were started in a different way are not recognized.<br />
<br />
== Recorder ==<br />
If the GUI browser is connected to a device, the integrated recorder can be used to record a test section with that device. To start the recorder, select the appropriate connection in the GUI browser and click the Record button. A new window opens for the recorder. The recorded actions are created in the GUI browser work area. It is therefore possible to edit the recorded data in parallel.<br />
<br />
[[Datei:MobileTestingRecorder.png|caption|]]<br />
<br />
;Components of the Recorder Window<br />
#'''Update''': Gets the current image and element tree from the device. This is necessary if the device takes longer to execute an action or if something changes without being triggered by the recorder. <br />
#'''Follow Mouse''': Select the element under the mouse pointer in the GUI browser.<br />
#'''Element Highlighting''': The element under the mouse is outlined in red.<br />
#'''Show Elements''': Show the borders of all elements in the view.<br />
#'''Tools''': Selection, which tool is used for recording. The selected action is triggered with each click on the view. The following actions are available:<br />
#*Element Actions:<br />
#**Click: Short click on the element under cursor. Kurzer Klick auf das Element über dem der Cursor steht. To determine more precisely which element is used, use the Follow Mouse or Element Highlighting function.<br />
#**Tap Element: Similar to click, exept that the duration of the click will be recorded as well. This allows the recording of long clicks.<br />
#**Set Text: Allows to set the text of an input field.<br />
#**Clear Text: Clears the text of an input field.<br />
#*Device Actions:<br />
#**Tap: Triggers a click at the screen position, which also considers the duration<br />
#**Swipe: Swipe in a straight line from the point where you press the mouse button until you release it. The duration is also recorded.<br />
#:Please note for this actions that the result may differ on different devices, e.g. with different screen resolutions.<br />
#*Test Flow Blocks<br />
#**Check Attribute: Compares the value of a specified attribute of the element with a predefined value. The result triggers the corresponding output.<br />
#**Assert Attribut: Compares the value of a specified attribute of the element with a predefined value. If the values are not equal, the test fails.<br />
#*Auto<br />
#:If the Auto tool is selected, you can use all actions by specific input methods: ''Click'', ''Tap Element'' and ''Swipe'' still work by clicking, but are distinguished by the duration and movement of the cursor. To trigger a ''Tap'', hold down Ctrl while clicking. The remaining actions are available in a context menu by right-clicking on the element.<br />
#'''Softkeys''': Only for Android. Simulates pressing the buttons Back, Home, Menu and Power.<br />
#'''Home Button''': Only for iOS since expecco 2.11. Allows pressing the Home button.Prior to expecco 19.2, it only works if AssistiveTouch is activated and the menu is located in the middle of the upper screen border. From expecco 19.2 on, the function no longer uses AssistiveTouch.<br />
#'''View''': Shows a screenshot of the device. Actions are triggerd by mouse depending on the selected tool. If a new action can be recorded, the window has a green frame, else it is red.<br />
#'''Resize Window to Image''': Resizes the recorder window so that the screenshot can be displayed completely.<br />
#'''Resize Image to Window''': Scales the screenshot to a size that makes use of the full size of the window.<br />
#'''Correct Orientation''': Corrects the image if it is upside down. Using the arrow to the right, the image can also be rotated by 90°, if this should ever be necessary. The orientation of the image is irrelevant for the functionality of the recorder, it only works on the elements it receives.<br />
#'''Scaling''': Changes the scaling of the screenshots.<br />
#'''Control''': Shows the state of the recorder<br />
#:''green'': The recorder is ready<br />
#:''red'': The recorder is locked because the display and the element list are updated<br />
#:''gray'': The recorder can no longer be used because the connection to the device has been lost<br />
<br />
;Usage<br />
Each click in the window triggers an action and is recorded in the workspace of the GUI browser. There you can run, edit, or create a new block from what you have recorded. On how to use the recorder, see also step 2 in the tutorial ([[#Step_2:_Creating_a_Block_with_the_Recorder|Android]] resp. [[#Step_2:_Creating_a_block_with_the_Recorder_2|iOS]]).<br />
<br />
== AVD Manager und SDK Manager ==<br />
AVD Manager und SDK Manager sind beides Anwendungen von Android. Im Menü des Mobile Testing Plugins bietet expecco die Möglichkeit, diese zu starten. Ansonsten finden Sie diese Programme bei Ihrer Android-Installation. Mit dem AVD Manager können Sie AVDs, also Konfigurationen für Emulatoren, erstellen, bearbeiten und starten. Mit dem SDK Manager erhalten Sie einen Überblick über Ihre Android-Installation und können diese bei Bedarf erweitern.<br />
<br />
= Hybrid Apps and WebViews =<br />
!!! IMPORTANT NOTICE - If you have problems switching to the webview, please set the "Default Application - Browser App" in Android Settings to "Chrome" !!!<br />
<br />
Hybrid apps contain platform native elements as well as other elements that are integrated in a WebView. These elements can also be used, but you first have to switch to the corresponding context. With the block ''Get Current Context'' you get the current context. Initially this is ''NATIVE_APP'', i.e. the context of the native elements. With the block ''Get Context Handles'' you get a collection of all existing contexts. If there is a WebView context, it is called ''WEBVIEW_1'' or ''WEBVIEW_<package>'' with the package of the WebView. Several WebView contexts are also possible. For each WebView context, there is a corresponding WebView element in the native context. You can use the ''Switch to Context'' block to switch to such a context and from now on only have access to the elements in this context.<br />
<br />
In the GUI browser, the existing contexts are displayed at the top of the tree as well as the tree of a context is inserted below the corresponding WebView element.<br />
<br />
=<span id="Customizing XPath using the GUI Browsers"><!-- name before 01.10.2020--></span>Customizing XPath using the GUI Browser=<br />
Bausteine, die auf einem Gerät fehlerfrei funktionieren, tun dies auf anderen Geräten möglicherweise nicht. Auch können kleine Änderungen der App dazu führen, dass ein Baustein nicht mehr den gewünschten Effekt hat. Man sollte einen Baustein daher so robust formulieren, dass er für eine Vielzahl von Geräten verwendet werden kann und kleine Anpassungen an der App verkraftet. Dazu muss man das grundlegende Funktionsprinzip der Adressierung verstehen. Dies wird im Folgenden am Beispiel der App aus dem Tutorial erläutert.<br />
<br />
Die Ansicht der App setzt sich aus einzelnen Elementen zusammen. Dazu gehören die Schaltflächen ''GTIN-13 (EAN-13)'' und ''Verify'', das Eingabefeld der Zahl ''4006381333986'' und das Ergebnisfeld, in dem OK erscheint, wie auch alle anderen auf der Anzeige sichtbaren Dinge. Diese sichtbaren Elemente sind in unsichtbare Strukturelemente eingebettet. Alle Elemente zusammen sind in einer zusammenhängenden Hierarchie, dem Elementbaum, organisiert.<br />
<br />
[[Datei:MobileTestingGUIBrowser.png | frame | left | Abb. 1: Funktionen des GUI-Browsers]]<br />
<br clear="all"><br />
Sie können sich diesen Baum im GUI-Browser ansehen. Wechseln Sie dazu in den GUI-Browser (Abb. 1) und starten Sie eine beliebige Verbindung. Sobald die Verbindung aufgebaut ist, können Sie den gesamten Baum aufklappen (1) (Klick bei gedrückter Strg-Taste). Er enthält alle Elemente der aktuellen Seite der App.<br />
<br />
Ein Baustein, der nun ein bestimmtes Element verwendet, muss dieses eindeutig angeben, indem er dessen Position im Elementbaum mit einem Pfad im XPath-Format beschreibt. Dieses Format ist ein verbreiteter Web-Standard für XML-Dokumente und -Datenbanken, eignet sich aber genauso für Pfade im Elementbaum.<br />
<br />
Wenn Sie ein Element im Baum auswählen, wird unten der von expecco automatisch generierte XPath (2) für das Element angezeigt, der auch beim Aufzeichnen verwendet wird. Oberhalb davon in der Mitte des Fensters befindet sich eine Liste der Eigenschaften (3) des ausgewählten Elements. Man nennt diese Eigenschaften auch Attribute. Sie beschreiben das Element näher wie beispielsweise seinen Typ, seinen Text oder andere Informationen zu seinem Zustand. Links unten können Sie zur besseren Orientierung im Baum die ''Vorschau'' (4) aktivieren, um sich den Bildausschnitt des Elements anzeigen zu lassen.<br />
<br />
Der Elementbaum für gleiche Ansicht einer App kann sich je nach Gerät unterscheiden. Es sind diese Unterschiede, die verhindern, eine Aufnahme von einem Gerät unverändert auch auf allen anderen Geräten abzuspielen: Ein XPath, der im einen Elementbaum ein bestimmtes Element identifiziert, beschreibt nicht unbedingt das gleiche Element im Elementbaum auf einem anderen Gerät. Es kann stattdessen passieren, dass der XPath auf kein Element, auf ein falsches Element oder auf mehrere Elemente passt. Dann schlägt der Test fehl oder er verhält sich unerwartet.<br />
<br />
Man könnte natürlich für jedes Gerät einen eigenen Testfall schreiben. Das brächte aber unverhältnismäßigen Aufwand bei Testerstellung und -wartung mit sich. Das Problem lässt sich auch anders lösen, da ein jeweiliges Element nicht nur durch genau einen XPath beschrieben wird. Vielmehr erlaubt der Standard mithilfe verschiedener Merkmale unterschiedliche Beschreibungen für ein und dasselbe Element zu formulieren. Das Ziel ist daher, einen Pfad zu finden, der auf allen für den Test verwendeten Geräten funktioniert und überall eindeutig zum richtigen Element führt.<br />
<br />
Im Beispiel besteht die Verbindung zur Android-App aus dem Tutorial und der Eintrag des GTIN-13-Buttons ist ausgewählt (5). Dessen automatisch generierter XPath (2) kann beispielsweise so aussehen:<br />
<br />
<blockquote>//hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[@resource id='android:id/content']/android.widget.RelativeLayout/android.widget.Button[@resource-id='de.exept.expeccomobiledemo:id/gtin_13']</blockquote><br />
<br />
Er ist offensichtlich lang und unübersichtlich. Der sehr viel kürzere Pfad<br />
<br />
<blockquote>//*[@text='GTIN-13 (EAN-13)']</blockquote><br />
<br />
führt zum selben Element.<br />
<br />
Für die iOS-App lautet der automatisch generierte XPath für diesen Button beispielsweise<br />
<br />
<blockquote>//AppiumAUT/XCUIElementTypeApplication/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeButton[2]</blockquote><br />
bzw.<br />
<blockquote>//AppiumAUT/UIAApplication/UIAWindow[1]/UIAButton[2]</blockquote><br />
<br />
und kann kürzer als<br />
<br />
<blockquote>//*[@name='GTIN-13 (EAN-13)']</blockquote><br />
<br />
geschrieben werden.<br />
<br />
Sie können den Pfad entsprechend im GUI-Browser ändern und durch ''Pfad überprüfen'' (6) feststellen, ob er weiterhin auf das ausgewählte Element zeigt, was expecco mit ''Verify Path: OK'' (7) bestätigen sollte. Der erste, sehr viel längere Pfad, beschreibt den gesamten Weg vom obersten Element des Baumes bis hin zum gesuchten Button. Der zweite Pfad hingegen wählt mit * zunächst sämtliche Elemente des Baumes und schränkt die Auswahl dann auf genau die Elemente ein, die ein ''text''- bzw. ''name''-Attribut mit dem Wert ''GTIN-13 (EAN-13)'' besitzen, in unserem Fall also genau der eine Button, den wir suchen.<br />
<br />
Im folgenden werden Android-ähnliche Pfade zur Veranschaulichung verwendet. Die Elemente in iOS-Apps heißen zwar anders, wodurch andere Pfade entstehen; das Prinzip ist jedoch das gleiche.<br />
<br />
[[Datei:MobileTestingBaum1.png | frame | Abb. 2: Elementbaum einer fiktiven App]]<br />
<br />
Sie können solche Pfade mit Hilfe weniger Regeln selbst formulieren. Sehen Sie sich den einfachen Baum einer fiktiven Android-App in Abb. 2 an: Die Einrückungen innerhalb des Baumes geben die Hierarchie der Elemente wieder. Ein Element ist ein ''Kind'' eines anderen Elementes, wenn jenes andere Element das nächsthöhere Element mit einem um eins geringeren Einzug ist. Jenes Element ist das ''Elternelement'' des Kindes. Sind mehrere untereinander stehende Elemente gleich eingerückt, so sind sie also alle Kinder desselben Elternelements.<br />
<br />
Ein Pfad durch alle Ebenen der Hierarchie zum TextView-Element ist nun:<br />
<br />
<blockquote>//hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.TextView</blockquote><br />
<br />
Die Elemente sind mit Schrägstrichen voneinander getrennt. Es fällt auf, dass der Name des ersten Elements nicht mit dem im Baum übereinstimmt. Das oberste Element in der Hierarchie heißt immer ''hierarchy'' (für iOS wäre es ''AppiumAUT''), expecco zeigt im Baum stattdessen den Namen der Verbindung an, damit man mehrere Verbindungen voneinander unterscheiden kann. Die weiteren Elemente tragen jeweils das Präfix ''android.widget.'', das im Baum zur besseren Übersicht nicht angezeigt wird. Bei IOS gibt es kein Präfix, das durch einen Punkt abgetrennt wäre, expecco 2.11 blendet aber entsprechend ''XCUIElementType'' am Anfang aus. Mit jedem Schrägstrich führt der Pfad über eine Eltern-Kind-Beziehung in eine tiefere Hierarchie-Ebene, d. h. ''FrameLayout'' ist ein Kindelement von ''hierarchy'', ''LinearLayout'' ist ein Kind von ''FrameLayout'' usw. Die in eckigen Klammern geschriebenen Wörter dienen nur als Orientierungshilfe im Baum. Sie gehören nicht zum Typ.<br />
<br />
Ein Pfad muss nicht beim Element ''hierarchy'' beginnen. Man kann den Pfad beginnend mit einem beliebigen Element des Baumes bilden. Man kann also verkürzt auch<br />
<br />
<blockquote>//android.widget.TextView</blockquote><br />
<br />
schreiben. Der Pfad führt zum selben ''TextView''-Element, da es nur ein Element dieses Typs gibt. Anders verhält es sich bei dem Pfad<br />
<br />
<blockquote>//android.widget.Button.</blockquote><br />
<br />
Da es zwei Elemente vom Typ ''Button'' gibt, passt dieser Pfad auf zwei Elemente, nämlich den Button, der mit "''An''" markiert ist, und den ''Button'', der mit "''Aus''" markiert ist. Es würde an dieser Stelle aber auch nicht helfen den langen Pfad von ''hierarchy'' aus beginnend anzugeben. Um einen mehrdeutigen Pfad weiter zu differenzieren, kann man explizit ein Element aus einer Menge wählen, indem man den numerischen Index in eckigen Klammern dahinter schreibt. Der Pfad aus dem obigen Beispiel lässt sich damit so anpassen, dass er eindeutig auf den ''Button'' mit der Markierung "''Aus''" weist:<br />
<br />
<blockquote>//android.widget.Button[1].</blockquote><br />
<br />
Ihnen fällt sicher auf, dass der Index eine 1 ist obwohl das zweite Element gemeint ist. Das kommt daher, dass die Zählung bei 0 beginnt. Der Button mit der Markierung "An" hat also die Nummer 0 und der ''Button'' mit der Markierung "''Aus''" hat die Nummer 1.<br />
<br />
Dieser Ansatz, einen expliziten Index zu verwenden, hat zwei Nachteile: Zum einen lässt sich an dem Pfad nur schwer ablesen welches Element gemeint ist, zum andern ist der Pfad sehr empfindlich schon gegenüber kleinsten Änderungen, wie zum Beispiel dem Vertauschen der beiden ''Button''-Elemente oder dem Einfügen eines weiteren ''Button''-Elements in der App.<br />
<br />
Es wäre daher wünschenswert, das gemeinte Element über eine ihm charakteristische Eigenschaft wie einen Attributwert, zu adressieren. Für Android-Apps eignet sich hierfür häufig das Attribut ''resource-id''. Im Idealfall muss bei der Entwicklung der App darauf geachtet werden, dass jedes Element eine eindeutige Id erhält. Die ''resource-id'' hat den großen Vorteil, dass sie unabhängig vom Text des Elements oder der Spracheinstellung des Geräts ist. Für iOS-Apps kann entsprechend das Attribut ''name'' verwendet werden, wenn es von der App sinnvoll gesetzt wird. Der XPath-Standard erlaubt solche Auswahlbedingungen zu einem Element anzugeben. Angenommen, der ''Button'' mit der Markierung "''Aus''" hat die Eigenschaft ''resource-id'' mit dem Wert ''off'' und der ''Button'' mit der Markierung "''An''" hat als ''resource-id'' den Wert ''on'', dann kann man als eindeutigen Pfad für den "Aus"-''Button''<br />
<br />
<blockquote>//android.widget.Button[@resource-id='off']</blockquote><br />
<br />
formulieren. Wie an dem Beispiel zu sehen werden solche Bedingungen wie ein Index in eckigen Klammern an den Elementtyp angehängt. Der Name eines Attributes wird mit einem @ eingeleitet und der Wert mit einem = in Anführungszeichen angehängt. Ist der Attributwert global eindeutig, kann man den vorausgehenden Pfad sogar durch den globalen Platzhalter * ersetzen, der auf jedes Element passt. Das obige Beispiel mit dem GTIN-13-''Button'' war ein solcher Fall.<br />
<br />
[[Datei:MobileTestingBaum2.png | frame | Abb. 3: Elementbaum einer fiktiven App mit Erweiterungen]]<br />
<br />
Abb. 3 zeigt eine Erweiterung des Beispiels aus Abb. 2. Die App hat nun ein weiteres, nahezu identisches ''LinearLayout'' bekommen. Die ''Buttons'' sind in ihren Attributen jeweils ununterscheidbar. Deshalb funktioniert der vorige Ansatz nicht, einen eindeutigen Pfad nur mithilfe eines Attributwerts zu formulieren. Offensichtlich unterscheiden sich aber ihre benachbarten ''TextViews''. Es ist möglich die jeweilige ''TextView'' in den Pfad mit aufzunehmen, um einen ''Button'' dennoch eindeutig zu adressieren. Ein Pfad zum ''Button'' mit der Markierung "''An''" unterhalb der ''TextView'' mit der Markierung "''Druckschalter''" kann dabei wie folgt aussehen:<br />
<br />
<blockquote>//android.widget.TextView[@resource-id='push']/../android.widget.Button[@resource-id='on']</blockquote><br />
<br />
Der erste Teil beschreibt den Pfad zu der ''TextView'' mit der Markierung "''Druckschalter''" und der ''resource-id'' mit dem Wert ''push''. Danach folgt ein Schrägstrich gefolgt von zwei Punkten. Die zwei Punkte sind eine spezielle Elementbezeichnung, die nicht ein Kindelement benennt, sondern zum Elternelement wechselt, in diesem Fall also das ''LinearLayout'', in dem die ''TextView'' eingebettet ist. Im Kontext dieses ''LinearLayout'' ist der restliche Pfad, nämlich der ''Button'' mit der ''resource-id'' mit dem Wert ''on'', eindeutig.<br />
<br />
Der XPath-Standard bietet noch sehr viel mehr Ausdrucksmittel. Mit der hier knapp vorgestellten Auswahl ist es aber bereits möglich für die meisten praktischen Testfälle gute Pfade zu formulieren. Eine vollständige Einführung in XPath ginge über den Umfang dieser Einführung weit hinaus. Sie finden zahlreiche weiterführende Dokumentationen im Web und in Büchern.<br />
<br />
Eine universelle Strategie zum Erstellen guter XPaths gibt es nicht, da sie von den Testanforderungen abhängt. In der Regel ist es sinnvoll, den XPath kurz und dennoch eindeutig zu halten. Häufig lassen sich Elemente über Eigenschaften identifizieren wie beispielsweise ihren Text. Will man aber gerade den Text eines Elements auslesen, kann dieser natürlich nicht im Pfad verwendet werden, da er vorher nicht bekannt ist. Ebenso wird der Text variieren, wenn die App mit verschiedenen Sprachen gestartet wird.<br />
<br />
Jeder Baustein, der auf einem Element arbeitet, hat einen Eingangspin für den XPath. Im GUI-Browser finden Sie in der Mitte oben eine Liste von Bausteinen mit Aktionen, die Sie auf das ausgewählte Element anwenden können. Suchen Sie den Baustein ''Click'' (8) im Ordner Elements und wählen Sie ihn aus (Abb. 1). Er wird im rechten Teil unter ''Test'' eingefügt, der Pin für den XPath ist mit dem automatisch generierten Pfad des Elements vorbelegt (9). Sie können den Baustein hier auch ausführen. Die Ansicht wechselt dann auf ''Lauf''. Ändert sich durch die Aktion der Zustand Ihrer App, müssen Sie den Baum anschließend aktualisieren (10).<br />
<br />
Wenn Sie in der unteren Liste eine Eigenschaft auswählen, wechselt die Anzeige der Bausteine zu ''Eigenschaften'', wo Sie die eigenschaftsbezogenen Bausteine finden. Wie bei den Aktionen können Sie auch hier einen Baustein auswählen, der dann rechts in Test mit dem Pfad des Elements und der ausgewählten Eigenschaft eingetragen wird, sodass Sie ihn direkt ausführen können.<br />
<br />
=<span id="troubleshooting"><!-- Referenced by error dialog on connection error --></span>Problems and Solutions=<br />
== General Remarks==<br />
*If an Android device connected via USB does not appear in the connection dialog, try changing the USB connection type. Usually MTP or PTP should work. See also [[#Prepare_Android_Device|Prepare Android Device]].<br />
*In some cases, when connecting an iOS device via USB, a message appears indicating that the cable used is not certified. In this case, replacing the respective cable is the only solution.<br />
*Note that the [[#Recorder|Recorder]] also considers items that you cannot see on the screen. Therefore, turn on element highlighting or use the follow mouse function and the element tree in the GUI browser to determine if the correct element is used.<br />
*Make sure that no alerts are open when connecting to an iOS device. Otherwise the connection will fail because the app cannot be brought to the foreground. See also [[#Preparing_an_iOS-Device_and_App|Preparing an iOS-Device and App]].<br />
*Note that on iOS simulators no ''.ipa'' files can be installed but only ''.app'' files.<br />
*For Android devices that automatically show and hide softkeys, the recorder may cut off elements in the lower area that would be hidden by the softkeys, even if they are not displayed at this time. In this case it is advisable to set the softkeys so that they are permanently displayed.<br />
<br />
==Connecting Fails==<br />
If the connection to the Appium server fails, you will receive an error message in expecco similar to the one shown below.<br />
<br />
[[File:MobileTestingVerbindungsfehler.png]]<br />
<br />
Here you can see the type of error that has occurred. Click on "''Details''" to get more information. Possible errors are:<br />
*''org.openqa.selenium.remote.UnreachableBrowserException''<br />
:The specified server is not running or is not reachable. Check the server address.<br />
*''org.openqa.selenium.WebDriverException''<br />
:Read the message after ''Original Error'' in the first line of the details:<br />
:*''Unknown device or simulator UDID''<br />
::Either the device is not connected properly or the udid is not correct.<br />
:*''Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65''<br />
::This error can have various causes. Either the WebDriverAgent could actually not be built because the signing settings are wrong or the appropriate provisioning profile is missing. Please read the section about [[#Signing|Signing]]. It is also possible that the WebDriverAgent cannot be started on the device, for example because an alert is in the foreground or you did not trust the developer.<br />
:*''Could not install app: 'Command 'ios-deploy [...] exited with code 253'''<br />
::The specified app cannot be installed on the iOS device because it is not entered in the app's Provisioning Profile.<br />
:*''Bad app: [...] App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name.''<br />
::The path to the app is wrong. Make sure that the file is located in the specified path on your Mac.<br />
:*''packageAndLaunchActivityFromManifest failed.''<br />
::The specified ''apk'' file is probably broken.<br />
:*''Could not find app apk at [...]''<br />
::The path to the app is wrong. Make sure that the ''apk'' file is located in the specified path.<br />
<br />
<br />
If the error is not due to one of the causes listed above, the automation applications on the device may no longer function properly. In this case it helps to uninstall them from the mobile device. They are then automatically reinstalled the next time a connection is established.<br />
<br />
*For iOS devices, this is the WebDriverAgent, which you can simply uninstall from the home screen. This usually solves problems caused by changing the used Mac or the Xcode version.<br />
<br />
*For Android devices, it is the UIAutomator2; here, a problem occurs sporadically on some devices, the cause is currently unknown to us. To uninstall, on the device, navigate to "''Settings''" > "''Applications''"<sup>*</sup> and search the list for the following entries:<br />
Appium Settings<br />
io.appium.uiautomator2.server<br />
io.appium.uiautomator2.server.test<br />
:Click on the respective application and then on "''Uninstall''".<br />
<sup>*</sup>''The corresponding entry may have a slightly different name on some devices.''<br />
<br />
<br />
If this doesn't help, check the output of the Appium server. For a server started by expecco, you can find the log in the list of [[#Running_Appium_Servers|Running Appium Servers]].<br />
<br />
==Problems==<br />
*''The block to click on an element is successful, but no action was performed on the device.''<br />
:This can happen if the element is hidden by another element and therefore clicking on the element is not possible. In this case, Appium does not throw an error, but simply nothing happens. If you would like to make a click at the position of the element anyways, even if it is hidden, use the block ''Tap'' instead and pass the location of the element to it (''Get Location''). If instead you want to check before a click whether the element is hidden at this moment, try whether the properties ''Is Displayed'' or ''Is Enabled'' might help you.</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Mobile_Testing_Plugin/en&diff=24497Mobile Testing Plugin/en2021-10-28T14:30:01Z<p>Mb: /* Hybrid Apps and WebViews */</p>
<hr />
<div>= Introduction =<br />
With the ''Mobile Testing Plugin'' applications can be tested on Android and iOS devices. This includes both real and emulated devices. It does not matter whether real mobile devices or emulated devices are used. The plugin can (and usually is) used in conjunction with the [[Expecco_GUI_Tests_Extension_Reference|GUI-Browser]], which supports the creation of tests. It can also be used to record test procedures.<br />
<br />
[http://appium.io/ Appium] is used to connect to the devices. Appium is a free open source framework for testing and automating mobile applications.<br />
<br />
We recommend editing the [[#Tutorial|Tutorial]] to familiarize yourself with the Mobile Plugin. This tutorial leads step by step through the creation of a test case using an example and explains the necessary basics.<br />
<br />
= Installation and Setup =<br />
To use the ''Mobile Testing Plugin'', you must have installed expecco together with the corresponding plugin, and you need the appropriate licenses. expecco communicates with the mobile devices via an Appium server, which either runs on the same computer as expecco, or on a second computer. This must be accessible for expecco.<br />
<br />
== Installation Overview ==<br />
'''Computer running expecco:'''<br />
* Java JDK version 8, 9, 10 or 11<br />
'''Computer connected to Android devices :'''<br />
* Appium Server, you can install it via the Mobile Testing Supplement (see below), of which we regularly provide a new version<br />
* Android SDK, you can also get it with the Mobile Testing Supplement<br />
* Java JDK version 8, 9, 10 or 11<br />
'''Computer connected to iOS devices<sup>*</sup>:'''<br />
* Appium Server, you can install it via the Mobile Testing Supplement for MacOS (see below), of which we regularly provide a new version<br />
* Xcode in a version that supports the iOS version used, available from the Apple App Store<br />
* Java JDK version 8, 9, 10 or 11<br />
* Apple Developer Certificate incl. matching private key (to sign the WebDriverAgent)<br />
* Provisioning Profile for the mobile devices to be used<br />
<br />
<sup>*</sup> Please note that due to the requirements (no connection to non-Apple devices available) iOS devices can only be controlled from a Mac.<br />
<br />
Depending on the setup, the above-mentioned computers can also be the same device. expecco can either connect to a remote Appium Server and mobile devices connected to it via the network, or start an Appium Server locally itself and use it with local mobile devices. However, some of expecco's functions that make it easier to create test cases are only available if the mobile devices are connected to the same computer on which expecco is running. A possible setup may therefore look like the following figure:<br />
<br />
[[Datei:MobileTestingAufbau.png | 400px]]<br />
<br />
The following explains how to install Appium and other necessary applications for Windows and Mac OS.<br />
<br />
== Windows ==<br />
The easiest way is to install everything from our Mobile Testing Supplement. However, newer versions do not contain a JDK anymore due to a change in Oracle's license terms, so you have to install it additionally.<br />
*'''expecco 20.1''': [https://download.exept.de/transfer/h-expecco-20.1.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.10.1.0]<br />
:Only minor changes compared to the previous version.<br />
*expecco 19.2: [http://download.exept.de/transfer/h-expecco-19.2.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.10.0.0]<br />
:Compared to the previous version, Appium was updated to version 1.16.0-rc.1 and node 12 is used. <br />
*expecco 19.1: [http://download.exept.de/transfer/h-expecco-19.1.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.8.1.0]<br />
:This installs Appium in the version 1.12.0 and now additionally contains build-tools in the version 28.0.3 in the android-sdk. Apart from this, it is the same as the previous version.<br />
*expecco 18.2: [http://download.exept.de/transfer/h-expecco-18.2.0/MobileTestingSupplement.exe Mobile Testing Supplement 1.7.3.0]<br />
:This installs Appium in the version 1.8.1. In addition, an installation of ''Android Debug Bridge'' and ''Google USB Driver'' ([https://gsmusbdrivers.com/download/adb-fastboot-drivers/ adb-setup-1.4.3]) is offered. This covers drivers for a broad range of Android devices, and you won't have to install an individual driver for each device. A '''JDK is not contained anymore (due to a change in Oracle's license terms)''', you have to download it on your own, e.g. from [https://www.oracle.com/technetwork/java/javase/downloads/index.html Oracle].<br />
*expecco 18.1: same procedure as for expecco 2.11<br />
*expecco 2.11: [http://download.exept.de/transfer/h-expecco-2.11.1/MobileTestingSupplement_1.6.0.2_Setup.exe Mobile Testing Supplement 1.6.0.2]<br />
:This installs a Java JDK Version 8, android-sdk and Appium Version 1.6.4. The supplement also offers a universal adb driver ([http://download.clockworkmod.com/test/UniversalAdbDriverSetup.msi ClockworkMod]). This driver supports a wide range of Android Devise, and avoids the need to search for individual device-specific drivers.<br />
*expecco 2.10: [http://download.exept.de/transfer/h-expecco-2.10.0/Mobile_Testing_Supplement_1.5.0.0_Setup.exe Mobile Testing Supplement 1.5.0.0]<br />
:It installs a Java JDK version 8, android-sdk and Appium version 1.4.16. During the installation the graphical user interface of Appium is started, you can close this window immediately. The supplement also offers a universal adb driver (ClockworkMod). This combines drivers for a wide range of Android devices so that you do not have to search for and install a separate driver for each device.<br />
<br />
If expecco has to use mobile devices that are connected to another computer, you have to start an Appium server there. You can do this by using the file <code>appium_standalone.cmd</code>. The server is then started on default port 4723. If you want to use a different port number, start the server with<br />
<br />
appium_standalone.cmd -p <portnummer><br />
<br />
The server is ready, as soon as the line<br />
<blockquote>Appium REST http interface listener started on 0.0.0.0:4723</blockquote><br />
is displayed, where you can read the used port number at the end.<br />
<br />
If your Android device is connected to a remote machine,<br />
you may want to see the live screen locally using a tool like<br />
[https://github.com/Genymobile/scrcpy scrcpy].<br />
<br />
<br />
When Appium is started for the first time – either standalone or by expecco – it may happen that the Windows firewall blocks access to the node server. Allow the access or Appium cannot be started.<br />
<br />
== Mac OS ==<br />
Note: the following can be ignored if you do not plan to test iOS (iPhone) devices. The Mac setup is not needed for Android devices.<br />
<br />
=== Xcode ===<br />
Automation with iOS devices needs [https://developer.apple.com/xcode/ Xcode]. You can install it from the App Store. Please make sure that the version matches the tested iOS versions:<br />
{| class="wikitable"<br />
|-<br />
|'''iOS'''&nbsp;&nbsp; <br />
|'''Xcode'''<br />
|'''macOS'''<br />
|-<br />
|10.x<br />
|8.x<br />
|10.12 (Sierra)<br />
|-<br />
|11.x<br />
|9.x<br />
|10.13 (High Sierra)<br />
|-<br />
|12.x<br />
|10.x<br />
|10.14 (Mojave)<br />
|-<br />
|13.x<br />
|11.x<br />
|10.15 (Catalina)<br />
|}<br />
The minor versions must also fit, for iOS 10.2 at least Xcode 8.2, for iOS 10.3 at least Xcode 8.3, etc. So if you are upgrading to a newer iOS version, you will usually need a newer Xcode version as well. Newer versions of Xcode may not run on older operating systems, which in turn may require an operating system upgrade. If you also want to test older iOS versions, it can be useful to install the corresponding Xcode versions in parallel.<br />
<br />
Also see [https://en.wikipedia.org/wiki/Xcode#Version_comparison_table Xcode versions].<br />
<br />
=== Appium ===<br />
You can install Appium via the Mobile Testing Supplement for Mac OS:<br />
* '''expecco 20.2''': [https://download.exept.de/transfer/h-expecco-20.2.0/Mobile_Testing_Supplement_for_Mac_OS.tar.bz2 Mobile Testing Supplement for Mac OS (1.2.2)]<br />
:Contains Appium version 1.18.3 and uses node 14.<br />
<br />
* expecco 20.1: [https://download.exept.de/transfer/h-expecco-20.1.0/Mobile_Testing_Supplement_for_Mac_OS.tar.bz2 Mobile Testing Supplement for Mac OS (1.2.0)]<br />
:Only a few changes compared to the previous version.<br />
<br />
* expecco 19.2: [http://download.exept.de/transfer/h-expecco-19.2.0/MobileTestingSupplement_for_MacOS.tar.bz2 Mobile Testing Supplement for Mac OS (1.1.98)]<br />
:Appium is updated to version 1.16.0-rc.1 and node 12 is used.<br />
<br />
* expecco 19.1: [http://download.exept.de/transfer/h-expecco-19.1.0/Mobile_Testing_Supplement_for_Mac_OS_1.1.96.tar.bz2 Mobile Testing Supplement for Mac OS (1.1.96)]<br />
:This version contains Appium 1.12.0.<br />
<br />
* expecco 18.1: [http://download.exept.de/transfer/h-expecco-18.1.0/Mobile_Testing_Supplement_for_Mac_OS_1.1.94.tar.bz2 Mobile Testing Supplement for Mac OS (1.1.94)]<br />
:This version contains Appium 1.8.0.<br />
<br />
* expecco 2.11:[http://download.exept.de/transfer/h-expecco-2.11.1/Mobile_Testing_Supplement_for_Mac_OS_1.0.94.tar.bz2 Mobile Testing Supplement for Mac OS (1.0.94)]<br />
:This version contains Appium 1.6.4.<br />
<br />
* expecco 2.10: [http://download.exept.de/transfer/h-expecco-2.10.0/Mobile_Testing_Supplement_for_Mac_OS_1.0.tar.bz2 Mobile Testing Supplement for Mac OS]<br />
:Diese Version entält Appium 1.4.16.<br />
<br />
After you have downloaded the supplement, you can move it to a directory of your choice (e.g. your home directory) and unpack it there. A suitable command in a shell could look like this, adjust the version number accordingly:<br />
<br />
tar -xvpf Mobile_Testing_Supplement_for_Mac_OS_1.1.98.tar.bz2<br />
<br />
If your default Xcode installation is the one you want to use, you can start Appium directly from the file in the ''bin'' directory with the appropriate version number:<br />
<br />
Mobile_Testing_Supplement/bin/start-appium-1.16.0-rc.1<br />
<br />
If you want to use another Xcode than the one configured as default, you have to tell Appium the corresponding path by using the environment variable ''DEVELOPER_DIR''. For example, if you have installed Xcode in ''/Applications/Xcode-11.3.app'', you can start Appium this way:<br />
<br />
DEVELOPER_DIR="/Applications/Xcode-11.3.app/Contents/Developer" Mobile_Testing_Supplement/bin/start-appium-1.16.0-rc.1<br />
<br />
To find out what is set as the default Xcode installation on your system, use this command:<br />
<br />
xcode-select -p<br />
<br />
If Appium cannot find your Xcode installation, a message like this appears:<br />
''<blockquote>org.openqa.selenium.SessionNotCreatedException - A new session could not be created. (Original error: Could not find path to Xcode, environment variable DEVELOPER_DIR set to: /Applications/Xcode.app but no Xcode found)</blockquote>''<br />
In such a case, restart Appium by specifying a valid ''DEVELOPER_DIR''.<br />
<br />
=== Signing ===<br />
To establish a test connection with a device, you need an Apple account. For evaluation you can use a free account. This has the disadvantage that created profiles are only valid for one week and must be recreated afterwards. Also be careful when sharing the account, as certificates may be revoked or invalidated by automatic generation. As a result, apps that have already been signed can no longer be used.<br />
<br />
First, connect the device you want to use to your Mac via USB. Start Xcode and open ''Preferences''. Go to the Accounts page and create an entry with your account. You can then click on ''Manage Certificates...'' to see the certificates that belong to that account. To run tests, you need an iOS Development Certificate and the associated private key. If you do not already have one, create one. If you already have one, but it is not in your keychain (indicated by "Not in Keychain"), you can import it. In any case, open the keychain management on your Mac and select the keychain ''login''. If you want to import a certificate from a PKCS#12-Datei (Endung typischerweise .p12), you can do this via the menu File > ''Import objects''. If you don't know where the certificate is stored, you can also revoke it in Xcode and recreate it in your keychain. However, only do this if you know that the old certificate is no longer in use because it can no longer be used afterwards. Now the keychain should contain an iOS development certificate. From the right-click menu, select Information. Under the details of the certificate you will find the Team ID, which is referred to here as the Organizational Unit. Enter it in the Team ID field of the plug-in's settings, see [[#Plugin_Configuration|Plugin Configuration]].<br />
<br />
Return to Xcode und select ''Open...'' in the menue ''File'', to open the WebDriverAgent project. This is found in the Mobile Testing Supplements folder under<br />
''<nowiki>Mobile_Testing_Supplement/lib/node_modules/appium-1.16.0-rc.1/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj</nowiki>''<br />
<br />
[[Datei:MobileTestingWebDriverAgentXcode.png]]<br />
<br />
Select ''WebDriverAgentLib'' and the page ''Signing & Capabilities''. In the section ''Signing'' set the option ''Automatically manage signing'' and then select a team. Now switch to ''WebDriverAgentRunner'' and do the same there.<br />
<!-- (The following seems to not be relevant anymore.) Here you should see errors indicating that no Provisioning Profiles have been created or found. Therefore, go to the ''Build Settings'' page and look for the entry ''Product Bundle Identifier'' in the ''Packaging'' section. Change this from com.facebook.WebDriverAgentRunner to something Xcode accepts by changing the prefix. Xcode can now generate a matching Provisioning Profile and the errors on the General page should disappear. After that you can quit Xcode. --><br />
By setting the team, the errors showing up for WebDriverAgentRunner should disappear. After that you can quit Xcode.<br />
<br />
If you now connect to your device from expecco, the WebDriverAgent will be installed and started on it and then switch to the app to be tested. On the device, however, the execution of the WebDriverAgent must still be trusted. To do this, open the settings during the connection setup on the device and then the entry Device management under General. This entry is only visible if a developer app is installed on the device. You may therefore have to wait until the WebDriverAgent is installed before the entry appears. Select the entry of your Apple account and trust it. Since the WebDriverAgent will be uninstalled again if the start did not work, you have to do this during the connection setup. If this is too hectic for you, you can also execute the following code:<br />
<br />
''xcodebuild -project Mobile_Testing_Supplement/lib/node_modules/appium-1.16.0-rc.1/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=<udid>' test''<br />
<br />
This installs the WebDriverAgent on the device without deleting it again. Refer to the [https://support.apple.com/en-us/HT204460 Apple documentation] for details on installing and trusting such apps.<br />
<br />
== Plugin Configuration ==<br />
Before you start, please check the settings of the Mobile Testing Plugin and adjust them if necessary. Select the menu item "''Extras''" &#8594; "''Settings''" &#8594; "''Extensions''" &#8594; "''Mobile Testing''" (see fig.). By default, these paths are found automatically (1). To adjust a path manually, deactivate the corresponding check mark at the right. You'll see a drop-down list with some paths to choose from. If an entered path is wrong or cannot be found, the field is marked red and a message appears. Make sure that all paths are specified correctly.<br />
<br />
[[Datei:MobileTestingEinstellungen.png | thumb | 400px | Plugin Configuration]]<br />
<br />
*'''appium''': Enter the path to the executable file with which Appium can be started in the command line. Under Windows this file will usually be called "<code>appium.cmd</code>". This path is used when expecco starts an Appium server.<br />
*'''node''': Enter the path to the executable that starts Node (also called (also called "Node.js"). This path is passed to Appium when a server is started so that Appium can find it independently of the PATH variable. Under Windows this file is usually called "<code>node.exe</code>".<br />
*'''JAVA_HOME''': Enter the path to a JDK (Java Development Kit)here. This path is passed to each Appium server. Leave the field blank to use the value from the environment variable. To specify which Java should be used by expecco, set this path in the Java Bridge settings.<br />
*'''ANDROID_HOME''': Enter the path to an Android SDK here. This path is passed to each Appium server. Leave the field blank to use the value from the environment variable.<br />
*'''adb''': The path to the adb command. Under Windows the file is called "<code>adb.exe</code>". This file is used by expecco, for example, to get the list of connected devices. This path should be selected automatically, if the command is found in the ANDROID_HOME directory. This is also used by Appium. If expecco and Appium use different versions of adb, conflicts may occur.<br />
*'''android.bat''': This file is only needed to start the AVD and the SDK Manager, which deal with phone emulators. The file in the ANDROID_HOME directory will be selected automatically, if present there.<br />
*'''aapt''': The path to the "aapt" command here. Under Windows this file is called "<code>aapt.exe</code>". expecco uses "aapt" only in the connection editor to read the package and activities of an "apk" file. The file in the ANDROID_HOME directory will be selected automatically, if present there.<br />
<br />
[[Datei:MobileTestingJavaBridgeEinstellungen.png | thumb | 400px | JDK Configuration]]<br />
<br />
Starting with expecco 2.11, there is an additional field called ''Team ID''. If you run iOS tests, enter the Team ID of your certificate here. This is used for every iOS connection, unless you change the value in the connection settings in individual cases. For information on how to obtain the team ID, please refer to the section on [[#Signing| signing]] for installations on Mac OS. With expecco 2.10 and older, you can only enter the Team ID as capability for each connection setting separately. However, you must use the [[#Extended_View|extended view]] to do this. Enter the capability ''xcodeOrgId'' here and set the Team ID of the certificate as value.<br />
<br />
The server address setting at the bottom of the page refers to the behavior of the connection editor. It checks at the end whether the server address ends in ''/wd/hub'' as this is the usual form. If not, a dialog asks how to react. The defined behavior can be viewed and changed here.<br />
<br />
Also switch to the entry ''Java Bridge'' (see figure). Here you have to specify the path to your Java installation, which is used by expecco. Enter a JDK here. If you want to use the one from the Mobile Testing Supplement under Windows, the path is<br />
<nowiki>C:\Program Files (x86)\exept\Mobile Testing Supplement\jdk</nowiki><br />
You can also use the system settings.<br />
<br />
== Prepare Android Device ==<br />
If you connect an Android device under Windows, you may still need an adb driver for the device. You can usually find a suitable driver on the manufacturer's website. If you have installed the universal driver from the Mobile Testing Supplement, everything should already work for most devices. In some cases, Windows will automatically try to install a driver when you connect the device for the first time. <br><br />
'''Attention''': Before you can control a mobile device with the Appium plugin, you have to allow this debugging!<br />
<br />
For Android devices, you can find this option in the settings under ''[https://developer.android.com/studio/debug/dev-options Developer Options]'' called ''USB-Debugging''. If the developer options are not displayed, you can unlock them by tapping Build Number seven times in About the Phone.<br />
<br />
Also enable the ''Stay awake'' feature to prevent the device from turning off the screen during test creation or execution.<br />
<br />
For security reasons, USB debugging must be allowed for each computer individually. When connecting the device to the PC via USB, you must agree to the connection on the device. If you haven't done this for your computer yet, but no corresponding dialog appears on the device, it may help to unplug and reconnect the device. This can happen especially if you have installed the ADB driver while the device was already connected via USB. If this doesn't help either, open the notifications by dragging them from the top of the screen. There you will find the USB connection and you can open the options. Select another type of connection; usually MTP or PTP should work.<br />
<br />
You can also test on an emulator. It does not need to be prepared separately, as it is already designed for USB debugging. It is even possible to start an emulator at the beginning of the test.<br />
<br />
To check if a device you have connected to your computer can be used, open the [[#Connection_Editor|connection editor]]. The device should be displayed there.<br />
<br />
=== Connection via WLAN ===<br />
It is possible to connect to Android devices via Wireless LAN. To prepare and enable this, you have to connect initially via USB. Open a command window (terminal window) and enter:<br />
<nowiki>adb tcpip 5555</nowiki><br />
The device listens for a TCP/IP connection on port 5555. If you have several devices connected or emulators running, you have to specify which device you mean. Enter in this case:<br />
<nowiki>adb devices -l</nowiki><br />
to get a list of all devices, where the first column gives the device's ID.<br />
Then, enter:<br />
<nowiki>adb -s <deviceID> tcpip 5555</nowiki><br />
with the device identification of the desired device. You can now disconnect the USB connection.<br>Now you have to find out the IP address of your device. You can usually find it somewhere in the device's settings, for example in the Status or WLAN settings of the phone. Then type in:<br />
<nowiki>adb connect <IP address of device></nowiki><br />
The device should now be connected via WLAN and can be used in the same way as with a USB connection. You can check this by entering "<code>adb devices -l</code>" again or open the connection dialog in expecco. In the list, the device appears with its IP address and port. Remember that the WLAN connection no longer exists when the ADB server or the device is restarted.<br />
<br />
== Preparing an iOS-Device and App ==<br />
Control of iOS devices is only possible via a Mac. Please also read the section [[#Mac_OS|Installation under Mac OS]].<br />
<br />
Before you can control a mobile device with the Mobile Testing Plugin, you must allow debugging for iOS devices with iOS 8 or higher. Activate the option "''Enable UI Automation''" under the "''Developer''" menu in the device settings.<br>If you cannot find the "''Developer''" entry in the settings, proceed as follows: Connect the device to the Mac via USB. If necessary, you must still agree to the connection on the device. Start Xcode and then select "''Devices''" from the menu bar at the top of the screen in the "''Window''" menu. A window opens in which a list of the connected devices is displayed. Select your device there. Then the entry "''Developer''" should appear in the settings on the device. You may have to exit the settings and restart.<br />
<br />
[[Datei:Alert.png | thumb | 270px | Alert unter iOS]]<br />
It is not possible to establish a connection to the device as long as it shows certain alerts. Such an alert may appear if FaceTime is activated (by displaying a message about SMS charges as shown in the screenshot). Be sure to configure the device so that it does not show such alerts when idle.<br />
<br />
=== expecco 2.11 and later ===<br />
You can test any app which is executable or already installed on the device used. If the app is available as a development build, the UDID of the device must be stored in the app. In any case, the WebDriverAgent must be signed for the device. Please read the section about [[#Signing|signing]] under Mac OS.<br />
<br />
If you want to use the Home button in a test, you must activate "AssistiveTouch" on the device. You will find this option in the settings under "''General''" > "''Operating Help''" > "''AssistiveTouch''". Then place the menu in the middle of the upper edge of the screen. You can then record pressing the Home button with the corresponding menu entry in the recorder or use the "''Press Home Button''" block directly.<br />
<br />
=== expecco 2.10 ===<br />
The app you want to use must be available as a development build. The UDID of the device must also be stored in the app.<br />
<br />
=== Sign the development build ===<br />
A development build of an app is only allowed for a limited number of devices and cannot be started on other devices. However, it is possible to exchange the certificate and the usable devices in a development build.<br />
<br />
* Evaluation with demo app of eXept:<br />
:We will be happy to provide you with a demo app which is available as a development build and which we can sign for your device. Please send the UDID of your device to your eXept contact person. How to determine the UDID of your device is described in the following section.<br />
<br />
* Using your own app for your test device:<br />
:If you receive a development build (IPA file) from the app developers that is approved for your test device, you can use it directly. To do this, you must tell the developers the UDID of your device so they can enter it. '''You can use Xcode to read the UDID of a device'''. Start Xcode and select ''Devices'' from the menu bar at the top of the screen in the ''Window'' menu. A window opens in which a list of the connected devices is displayed. Select your device and search for the ''Identifier'' entry in Properties. The UDID is a 40-digit hexadecimal number.<br />
<br />
* Externally developed app for your test device:<br />
:You can also re-sign apps to make them run on other devices. However, this process is complicated and requires access to an Apple Developer account. A documentation on the procedure is currently in preparation.<br />
<br />
:For the evaluation we will gladly support you with the re-signing of your app..<br />
<!--<br />
Log in to the [https://developer.apple.com/ Apple-Webinterface]. Navigate to ''Certificates, IDs & Profiles''. If necessary, create a Developer Certificate and a Provisioning Profile for your device here and download both. If you don't have a Developer Account yet, create one here: https://developer.apple.com/enroll/. For this you have to register with an Apple-ID.<br />
<br />
# Find out Team ID (''Membership'' -> ''Team ID'')<br />
# Under ''Certificates, IDs & Profiles'' select development certificate (under ''+'' create, if not available) and download<br />
# Under ''App ID'' create Wildcard App ID, if not present. Note App ID (AppID = Prefix.ID)<br />
# Add device, find out UDID (or ''Identifier'') of the device (''Xcode'' -> ''Window'' (above in menu bar) -> ''Devices'')<br />
# Create commission profiles: ''iOS App Development'' -> Select ''AppID'' -> Select certificate -> Select device -> Create profile name -> Download provisioning profiles.<br />
# Import the downloaded certificate (''Downloads'' -> Certificate (.cer)<br />
# Copy SHA1 fingerprint. Right click on Certificate -> ''Information'', then scroll to the bottom of the page).<br />
# Create Entitlements.plist (''Open Terminal' -> Downloads/Mobile_Testing_Supplement/bin/gen-entitlements_plist 'Team-ID' 'App ID' Downloads/Mobile_Testing_Supplement/bin/re-sign-ipa <path to ipa (z.B. Downloads/expeccoMobileDemo.ipa)> \<br />
"<Zertifikat (SHA1-Fingerabdruck, z.B. 76 E8 4B E8 78 D5 D7 F9 2E 09 8B D7 E8 FB CE 30 0C F5 D0 EF)>" \<br />
<Path to Commission Profile (e.g. /Users/exept_test/Downloads/dut.mobileprovision)> \<br />
<Path for the result ipa (z.B. Downloads/expeccoMobileDemo_re-signed.ipa)> \<br />
[Pfad zur entitlements.plist] (z.B. /Users/exept_test/entitlements.plist)<br />
<br />
To re-sign, you can use the corresponding script from the Mobile Testing Supplement for Mac OS or any other tool (e.g. isign).<br />
--><br />
<br />
For more information about using iOS devices, see also the <br />
[http://appium.io/slate/en/master/?java#appium-on-real-ios-devices Appium documentation].<br />
<br />
=== Native iOS-Apps ===<br />
You can also use apps that are already natively present on the device. To do this, you must know their bundle ID and then enter it in the connection settings. Here is a small selection of common apps:<br />
{| style="text-align:left"<br />
! App<br />
!<br />
! Bundle-ID<br />
|-<br />
| App Store<br />
| <br />
| com.apple.AppStore<br />
|-<br />
| Calculator<br />
| <br />
| com.apple.calculator<br />
|-<br />
| Calendar<br />
| <br />
| com.apple.mobilecal<br />
|-<br />
| Camera<br />
| <br />
| com.apple.camera<br />
|-<br />
| Contacts<br />
| <br />
| com.apple.MobileAddressBook<br />
|-<br />
| iTunes Store<br />
| <br />
| com.apple.MobileStore<br />
|-<br />
| Mail<br />
| <br />
| com.apple.mobilemail<br />
|-<br />
| Maps<br />
| <br />
| com.apple.Maps<br />
|-<br />
| Messages<br />
| <br />
| com.apple.MobileSMS<br />
|-<br />
| Phone<br />
| <br />
| com.apple.mobilephone<br />
|-<br />
| Photos<br />
| <br />
| com.apple.mobileslideshow<br />
|-<br />
| Settings<br />
| <br />
| com.apple.Preferences<br />
|}<br />
<br />
You can find further Bundle-IDs [https://github.com/joeblau/apple-bundle-identifiers here].<br />
<br />
= Examples =<br />
In the demo test suites for expecco you will also find examples for tests with the Mobile Testing Plugin. To do this, select the option "''Example from File''" on the start screen and open the folder named "''mobile''".<br />
<br />
==<span id="TestsuiteMobileTestingDemo"><!-- Referenced by m01_MobileTestingDemo.ets --></span> ''m01_MobileTestingDemo.ets'' ==<br />
The test suite contains two simple test plans: "''Simple CalculatorTest''" and "''Complex Calculator and Messaging Test''". Both tests use an Android emulator, which you must start before starting. The apps used in the test are part of the basic equipment of the emulator and therefore no longer need to be installed. Since the apps may differ under every Android version, it is important that your emulator runs under Android 6.0. In addition, the language must be set to English.<br />
<br />
; Simple CalculatorTest<br />
: This test connects to the calculator and enters the formula ''2+3''. The result of the calculator is compared with the expected value ''5''.<br />
<br />
; Complex Calculator and Messaging Test<br />
: This test connects to the calculator and then opens the message service. There it waits for an incoming message from the number ''15555215556'', in which a formula to be calculated is sent. The message is generated before via a socket at the emulator. When the message arrives, it is opened by the test and its contents are read. Then the calculator is opened again, the received formula is entered and the result is read. The test then switches back to the message service and sends the result as an answer.<br />
<br />
== ''m02_expeccoMobileDemo.ets'' und ''m03_expeccoMobileDemoIOS.ets'' ==<br />
These are part of the tutorial for the Mobile Testing Plugin. The included test case is incomplete and will be added during the tutorial. Please read the section [[#Tutorial|Tutorial]].<br />
<br />
= Tutorial =<br />
This tutorial describes the basic procedure for creating tests with the Mobile Testing Plugin. The basis for this is a supplied example consisting of a simple app and an expecco test suite.<br />
<br />
The ''expecco Mobile Demo'' app calculates and checks various everyday codes: the IBAN from European payment transactions, the international GTIN 13 product codes found in retail bar codes, and the serial numbers on euro banknotes.<br />
<br />
The test-suite contains test cases for individual functions of the app. Not all functions are covered yet, but will be added in the course of the tutorial.<br />
<br />
There are two versions of these Tutorials:<br />
*'''[[#First_steps_with_Android|First steps with Android]]'''<br />
*'''[[#First_steps_with_iOS|First steps with iOS]]'''<br />
<br />
The procedure is almost identical in both versions, only the connection configurations are created differently. The finished tests then differ essentially in the paths for addressing the elements used, since these are technology-dependent.<br />
<br />
==<span id="FirstStepsAndroid"><!-- Referenced by m02_expeccoMobileDemo.ets --></span> First steps with Android ==<br />
It is assumed that you have already read the chapter [[#Installation_and_Setup|Installation and Setup]] and completed the necessary preparations for for using iOS devices under Mac OS. Connect the device you want to use to your Mac. Download the iOS version of the [http://download.exept.de/transfer/h-expecco-2.11.0-pre/expeccoMobileDemo.ipa expeccoMobileDemo-App] to your Mac. Since the app is a debug build, you still need to sign it for your device (see [[#Preparing an iOS-Device_and_App|Preparing an iOS-Device and App]]). Now start an Appium server on your Mac.<br />
<br />
=== Step 1: Run Demo ===<br />
Start expecco and open the test-suite ''m02_expeccoMobileDemo.ets'' via the button ''Example from file'' (fig. 1). As of expecco 2.11 this is located in the subfolder ''mobile''. Otherwise download the test-suite [http://download.exept.de/transfer/h-expecco-2.10.0/m03_expeccoMobileDemoIOS.ets m03_expeccoMobileDemoIOS.ets] to the computer where your expecco installation is located and open it. In this test-suite there is already a ready-made test plan with some test cases for this app.<br />
<br />
[[Datei:MobileTestingBeispielÖffnen.png | frame | left | Abb. 1: Beispiel-Testsuite öffnen]]<br />
<br clear="all"><br />
In the test suite the package of the demo app is included as an attachment ''(expeccoMobileDemo-debug.apk)''. With the provided module Export Demo App you can export the file to any location on your computer. Select the device (1) and click on the green play button (2) to execute the device (fig. 2). The block opens a file dialog in which you specify where the package should be saved.<br />
<br />
[[Datei:MobileTestingExportApp.png | frame | left | Abb. 2: App exportieren]]<br />
<br clear="all"><br />
Before we get into the rest of the test-suite, first configure the connection and which device you want to use. To do this, connect a device to your computer via USB or start an emulator.<br />
<br />
[[Datei:MobileTestingVerbinden.png | frame | left | Abb. 3: Verbindungseditor öffnen]]<br />
<br clear="all"><br />
Now open the GUI browser (1) and select the entry ''Mobile Testing'' (3) under ''Connect'' (2) (Fig. 3) to open the connection dialog.<br />
<br />
You will see a list of all connected Android devices (1) (Fig. 3). If your device does not appear in the list, make sure it is turned on and connected via USB. Otherwise read the section [[#Prepare_Android_Device|Prepare Android Device]]<br />
<br />
[[Datei:MobileTestingGerätAuswählen.png | frame | left | Abb. 4: Gerät im Verbindungsdialog auswählen]]<br />
<br clear="all"><br />
Once you have found your device in the list, select it and click ''Next'' (2).<br />
<br />
Next, specify which app you want to use (Fig. 5). You can choose if you want to start an app that is already installed on the device (''App on the device'') or if you want to install and start an app (''Install app''). In case you want to use an already installed app, you will get a list of all packages installed on the device (1), which are divided into system packages and foreign packages (2), as well as their activities (3). You can then simply select these in the respective fields.<br />
<br />
[[Datei:MobileTestingAppAuswählen.png | frame | left | Abb. 5: Auf dem Gerät installierte App angeben]]<br />
<br clear="all"><br />
For this tutorial the app you just exported from the test-suite should be installed. Select ''Install App'' and enter the appropriate path in App (1) (Fig. 6). You can use the button on the left (2) to open a file dialog where you can navigate to the file to enter it. The package (3) and the activity (4) of the app will be entered automatically. If the app has multiple activities, you can select the one you want. Now click on ''Next'' (5).<br />
<br />
[[Datei:MobileTestingAppInstallieren.png | frame | left | Abb. 6: App angeben, die auf dem Gerät installiert werden soll]]<br />
<br clear="all"><br />
On the last page you can see an overview of all previous data (1) (Fig. 7). Below, you can enter a name for the connection under which it will be displayed in the GUI browser (2). In addition, a connection can be identified by this name and used in blocks; the name must therefore be unique. If you do not specify a name, one is generated generically. Enter ''expeccoMobileDemo'' as the name. Enter the address for the Appium server in the field below (3). Appium is the interface, via which the connected devices are controlled. For this tutorial expecco manages the instances of the Appium server. Enter the local default address ''<nowiki>http://localhost:4723/wd/hub</nowiki>''. This is always the lowest entry in the proposal list. In addition the option ''Start if necessary'' is activated (4). expecco then checks if an Appium server is already running at the address and starts and ends it automatically if necessary. If the port ''4723'' is already occupied or if you want to use several connections at the same time, use a different port at this point. It is common to use the odd port numbers above ''4723'', i.e. ''4725'', ''4727'' and so on. Of course you can also use remote servers, but the automatic start and stop of a server can only be done locally by expecco.<br />
<br />
[[Datei:MobileTestingServerkonfiguration.png | frame | left | Abb. 7: Verbindungsnamen und Appium-Server konfigurieren]]<br />
<br clear="all"><br />
Now click on ''Save'' (5) to save the settings for the test execution. Settings can be saved as an attachment to an execution definition or to an external file (Fig. 8). If you have several projects open at the same time, you can select the project in which the attachment is to be created from the list. Click on ''Save'' in the ''Save settings in attachment'' area and enter ''expeccoMobileDemo'' as the name. Now click on ''Start server and connect'' (6) to establish a connection with the specified configuration.<br />
<br />
[[Datei:MobileTestingEinstellungenSpeichern.png | frame | left | Abb. 8: Einstellungen speichern]]<br />
<br clear="all"><br />
It may take a while to establish the connection. Wait until the connection is established and displayed in the GUI browser. You will see that the app is started on the device. Now you know that the configuration works. The saved settings should now be used for the test, which then establishes the same connection. Select the connection in the GUI browser, right-click and select 'Close Connection' from the context menu to avoid any conflict. Then switch back to the test-suite tab.<br />
<br />
In the test suite, the settings were created as an appendix ''expeccoMobileDemo'' (Fig 9). Select the ''Connect'' block (1) and switch to the ''Network'' view on the right (2). Drag and drop the settings into the network of the block (3). Connect the output pin ''pathName'' with the input pin ''stringOrFilename[1]'' of the block ''Connect from File'' (4). Confirm the changes with ''Apply'' (5). This block will establish the connection to the app at the beginning of the test.<br />
<br />
[[Datei:MobileTestingConnectblock.png | frame | left | Abb. 9: Verbindungsbaustein editieren]]<br />
<br clear="all"><br />
Now switch to the test plan ''Demo Test'' (1) (Fig. 10). This test plan already contains some finished test cases. Before and after the execution (2) one block is also entered: The just edited block ''Connect'' for the setup and the block ''Disconnect'' for the disconnection. By entering the two blocks at this point, the connection is terminated, especially if the test is aborted prematurely, e.g. because one of the test cases fails.<br />
<br />
[[Datei:MobileTestingTestplan.png | frame | left | Abb. 10: Testplanausführung]]<br />
<br clear="all"><br />
Now you can start the test plan ''Demo Test'' by clicking on the green Play button (3). The test plan should run without errors.<br />
<br />
=== Step 2: Creating a Block with the Recorder ===<br />
With the help of the integrated recorder, you can easily record execution sequences and store them in a block. This requires a connection to a test device, which is used to create the test.<br />
<br />
To establish a connection, switch back to the GUI browser. The connection that you created previously is still entered here. Since the same name was used for the connection in the test run, the settings were overwritten (in our case, the settings were identical anyway). The connection is currently not active, since it was terminated at the end of the execution. However, the settings are still entered there. To reestablish the connection with this configuration, select it, right-click it, and then ''Connect''.<br />
<br />
Wait until the connection is established (1), then press the record button (2) to start recording (Fig. 11).<br />
<br />
[[Datei:MobileTestingRecorderStarten.png | frame | left | Abb. 11: Recorder starten]]<br />
<br clear="all"><br />
A window opens with the Mobile Testing Recorder (Fig. 12). This shows a screenshot of the connected device. This screen allows you to control the device remotely. Every action you perform is recorded in the background.<br />
<br />
In the upper menu bar you can select the tool (1) with which you want to enter an action. The Auto tool is selected by default. You can use it to record certain actions by making gestures on the display with the mouse pointer. For example, if you left-click for a long time, this corresponds to a long tap on the element at this point. Instead of specifying the desired action with the corresponding gesture, you can also select it manually.<br />
<br />
A new test for the recognition of correct GTIN-13 codes should now be recorded. First click briefly on the button ''GTIN-13 (EAN-13)'' (2) of the app in the display to trigger a corresponding click on the device. During the execution of this action, the frame of the recorder will briefly turn red. If the recorder does not display the current view of the app afterwards, click on the update icon (3) in the recorder.<br />
<br />
[[Datei:MobileTestingRecorder1.png | frame | left | Abb. 12: Über Recorder zur GTIN-13-Activity wechseln]]<br />
<br clear="all"><br />
Then enter a correct GTIN-13 in the input field of the new page. To do this, right-click on the input field (1) and select the action ''Set text'' (2) in the context menu (Fig. 13). Enter any valid article number in GTIN-13 format, e.g. ''4006381333986'' (3). This text is now set in the app.<br />
<br />
[[Datei:MobileTestingRecorder2.png | frame | left | Abb. 13: GTIN-13-Code über Recorder eingeben]]<br />
<br clear="all"><br />
Now click on ''Verify'' (1) (Fig. 14). The app now displays ''OK'' (2) as the result. The test should determine whether this result is actually displayed. After a right click you can select the action ''Assure attribute'' (3) in the context menu. In the dialog that opens, select the property ''text'' (4) and confirm with ''OK'' (5). This time, no action is triggered on the device, but only a block is recorded that fails if the result deviates from the expected value ''OK''.<br />
<br />
[[Datei:MobileTestingRecorder3.png | frame | left | Abb. 14: Antwort der App über Recorder auslesen]]<br />
<br clear="all"><br />
Now close the recorder. In the ''workspace'' of the GUI browser you can see that a block has been created for each of the recorded actions (Fig. 15). You can now test whether the recorded action can be played back. To do this, you must first return the app on your device to its initial state by using the ''HOME'' button on the top right of the device. Then click in expecco on the green Play button (1). If everything turns green, the execution was successful. Now create a new block in the test-suite by clicking on the block symbol (2) in the upper right corner. Give it the name ''GTIN_Verify_OK'' (3) and confirm (4).<br />
<br />
[[Datei:MobileTestingArbeitsbereich.png | frame | left | Abb. 15: Neuen Baustein aus Arbeitsbereich exportieren]]<br />
<br clear="all"><br />
Now close the connection by selecting the connection, right-clicking and selecting ''Close connection'' from the context menu.<br />
<br />
Switch back to the Testsuite tab. The new block was created there. Again select the test plan ''Demo-Test'' and add the recorded test case ''GTIN_Verify_OK'' by drag-and-drop at the end of the test plan. Apply the change and restart. The test plan should run again without errors.<br />
<br />
=== Step 3: Customizing XPath Using the GUI Browser ===<br />
Your new device may not work on other devices. The elements used are addressed via an XPath and this cannot be correct on other devices. See the [[#XPath_Customizing_using_the_GUI-Browsers|Customizing XPath Using the GUI-Browser]] section for more information. If you have another device available, you can now try to generalize the paths in your created devices. You can also skip this step.<br />
<br />
If you find it difficult to find shortened paths, follow the paths of the existing blocks. Start the test again. If the test now fails, check the paths again in the GUI browser.<br />
To run the test on a second device, open in the menu ''Extensions'' > ''Mobile Testing'' > ''Create connection settings''. You will get a dialog similar to the connection dialog. However, you can only create and save settings but not establish a connection. However, you have the option to save individual aspects of the settings, such as only the device. Select the new device and click on the Save icon in the attachment until the delayed menu opens (Fig. 16). Select ''Save device settings'' here. It is best to name the attachment after the device. You can then close the dialog again.<br />
<br />
[[Datei:MobileTestingGerätSpeichern.png | frame | left | Abb. 16: Einstellungen für ein Gerät speichern]]<br />
<br clear="all"><br />
Select the ''Connect'' block and drag the settings for the new device into its network. Now connect its output pin ''pathName'' with the input pin ''stringOrFilename[2]'' of the block ''Connect from File''. The block Connect from File reads the information at the input pins from top to bottom, multiple properties are replaced. In this case, the settings for the device used are replaced, while the other settings remain the same. If you have chosen the paths skilfully, the test will now also run successfully on the other device.<br />
<br />
=== Step 4: Create another block ===<br />
If the same procedures are repeated in the test, you can reuse or modify blocks that have already been created for this purpose. The block created in step 2 checks the recognition of correct GTIN 13 codes. A test is still missing which, conversely, checks the detection of a wrong GTIN-13 code. The structure of the two tests is identical, they only differ in their parameters. Therefore, copy the block ''GTIN_Verify_OK'' and rename the copy to ''GTIN_Verify_NOT_OK''. Change the input of the GTIN-13 to a wrong code, for example by changing the last digit (''4006381333987'') and set the check value of the output to ''NOT OK'' (Fig. 17).<br />
<br />
[[Datei:MobileTestingGTIN_Verify_NOT_OK.png | frame | left | Abb. 17: Baustein editieren]]<br />
<br clear="all"><br />
Add this new test to the Test Plan Demo Test as well and place it at the end. Run the test plan, but don't forget to disconnect in the GUI browser first.<br />
<br />
The new test will fail because the device you added does not return to the start page of the app, but the tests start from there. This is already considered in the other blocks; they always execute the block ''Back to main menu'' at the end. You can see this by selecting one of the other blocks, e.g. ''GTIN_Calculate'', and switching to its schematic view. There the block ''Back to main menu'' is displayed in the field ''After execution'' (Fig. 18). As with the corresponding field in the test plan, this block is always executed at the end, regardless of whether the test is successful or aborted. Now add this entry to your blocks ''GTIN_Verify_OK'' and ''GTIN_Verify_NOT_OK''. Select the block and drag the block ''Back to main menu'' in the schema view to the input field ''After execution''. Now you can start the test plan and all tests should be executed again without any problems.<br />
<br />
[[Datei:AppiumDemo Nach Ausführung.png | frame | left | Abb. 18: Nach-Ausführungs-Baustein setzen]]<br />
<br clear="all"><br />
<br />
=== Step 5: Complete Test ===<br />
For the Activity IBAN all answer possibilities of the app are already covered with test cases. In the GTIN-13-Activity a correct and a faulty code are tested and a check digit is calculated, but the behaviour of the app in case of input of wrong length is not tested yet (With Verify '''Input must be exactly 13 digits''. and ''...12 digits''. for Calculate). The activity for checking the serial numbers of euro banknotes is not yet tested. As with the IBAN, three cases can occur here: a correct serial number was entered (answer: ''OK''), an incorrect serial number was entered (answer: ''NOT OK'') or the specification does not correspond to the format (answer: ''A serial number consists of 12 characters with the first one or two being capital letters (A-Z).''). You can now extend the test coverage by creating test cases. You can create the blocks for this with the recorder as in step 2 and generalize the XPaths if necessary. If you are familiar with the basic handling of expecco, you can of course also create blocks without recorder by manually assembling them from existing blocks of the library. You can also combine both approaches as you wish.<br />
<br />
Note that the test cases presented here only check individual entries. If you write test cases for your own apps, you will probably want to test more closely by entering more different values, including edge cases.<br />
<br />
==<span id="FirstStepsIOS"><!-- Referenced by m03_expeccoMobileDemoIOS.ets --></span> First steps with iOS ==<br />
It is assumed that you have already read the chapter [[#Installation_and_Setup|Installation and Setup]] and completed the necessary preparations for using iOS devices under Mac OS. Connect the device you want to use to your Mac. Download the iOS version of the [http://download.exept.de/transfer/h-expecco-2.11.0-pre/expeccoMobileDemo.ipa expeccoMobileDemo-App] to your Mac. Since the app is a debug build, you still need to sign it for your device (see [[#iOS-Ger.C3.A4t_und_App_vorbereiten|iOS-Device and App preparing]]). Now start an Appium server on your Mac.<br />
<br />
=== Step 1: Run Demo ===<br />
Start expecco and open the test-suite ''m03_expeccoMobileDemoIOS.ets'' via the button ''Example from file'' (Fig. 1). As of expecco 2.11 this is located in the subfolder ''mobile''. Otherwise download the test-suite [http://download.exept.de/transfer/h-expecco-2.10.0/m03_expeccoMobileDemoIOS.ets m03_expeccoMobileDemoIOS.ets] to the computer on which your expecco installation is located and open it. In this test-suite there is already a ready-made test plan with some test cases for this app. <br />
<br />
[[Datei:MobileTestingIOSBeispielÖffnen.png | frame | left | Abb. 1: Beispiel-Testsuite öffnen]]<br />
<br clear="all"><br />
Before we get into the rest of the test-suite, first configure the connection and which device you want to use. Now open the GUI browser (1) and select the entry ''Mobile Testing'' (3) under ''Connect'' (2) (Fig. 2) to open the connection dialog.<br />
[[Datei:MobileTestingVerbinden.png | frame | left | Abb. 2: Verbindungseditor öffnen]]<br />
<br clear="all"><br />
<br />
Here you can enter an iOS device only by hand. Select ''Enter iOS device'' (Fig. 3). The name and iOS version of the device can be found in its properties. To find out the device ID of the device, open the Devices (Command-Shift-2) window in Xcode on the Mac. All connected devices and the available simulators are displayed there. Here you can also see the device ID (udid) of your device and which apps have been installed. After you have entered the device in the connection editor, select it in the list and click Next.<br />
<br />
[[Datei:MobileTestingIOSGerät.png | frame | left | Abb. 3: Hinzufügen eines iOS-Geräts]]<br />
<br clear="all"><br />
<br />
Next, specify which app you want to use. You can choose whether you want to start an app that is already installed on the device (''App on the device'') or if you want to install and start an app (''Install app''). In case you want to use an already installed app, you have to specify its bundle ID. You will also find this in the Devices window of Xcode. For the demo app it is ''de.exept.expeccoMobileDemo''.<br />
<br />
For this tutorial the demo app has to be installed first. Select ''Install App'' and enter the path to the file on your Mac (fig. 4). If you are using expecco 2.11, you can also specify the Team-ID on this page, which specifies which certificate should be used for iOS connections. If you have already specified an ID in [[#Configuration_of_Plugins|Plugin Settings]], it will be used. It will be grayed out unless you specify another value. Now click on ''Next''.<br />
<br />
[[Datei:MobileTestingIOSAppInstallieren.png | frame | left | Abb. 4: App angeben, die auf dem Gerät installiert werden soll]]<br />
<br clear="all"><br />
<br />
On the last page you can see an overview of all previous data (1) (Fig. 5). Below the Capabilities list, you can enter a name for the connection under which it is displayed in the GUI browser (2). In addition, a connection can be identified by this name and used in blocks; the name must therefore be unique. If you do not specify a name, one is generated generically. Enter ''expeccoMobileDemo'' as the name. Enter the address for the Appium server in the field below (3). If you have started the Appium server with default settings, you only have to replace ''localhost'' in the default address (lowest entry of the suggestion list) with the IP address of the Mac (in the picture ''172.23.1.49''). To make sure which port the Appium server is listening on, see its output. At the beginning there is the line<br />
<nowiki>info: Appium REST http interface listener started on 0.0.0.0:4723</nowiki><br />
If the default port ''4723'' does not appear at the end, change this value accordingly in the configuration.<br />
<br />
If the option ''Start on demand'' (4) is activated, expecco checks if an Appium server is already running at the address and starts and stops it automatically if necessary. However, this is only possible for local server addresses, so deactivate this option.<br />
<br />
[[Datei:MobileTestingServerkonfigurationIOS.png | frame | left | Abb. 5: Verbindungsnamen und Appium-Server konfigurieren]]<br />
<br clear="all"><br />
<br />
Now click on ''Save'' (5) to save the settings for the test execution. Settings can be saved as an attachment to an execution definition or to an external file (Fig. 6). If you have several projects open at the same time, you can select the project in which the attachment is to be created from the list. Click on ''Save'' in the ''Save settings in attachment'' area and enter ''expeccoMobileDemo'' as the name. Now click on ''Connect'' (6) to establish a connection with the specified configuration.<br />
<br />
[[Datei:MobileTestingEinstellungenSpeichern.png | frame | left | Abb. 6: Einstellungen speichern]]<br />
<br clear="all"><br />
<br />
It may take a while to establish the connection. If you have entered the correct server address, you should see the connection attempt in the Appium server output. The app should be started on your iOS device. If nothing happens on the device, either the device or the app may not be found. If Appium tries to start the app and this fails, the app is probably signed incorrectly. In this case, uninstall the app so that it can be reinstalled with a new signature.<br />
<br />
Wait until the connection is established and displayed in the GUI browser. Now you know that the configuration works. The saved settings should now be used for the test, which then establishes the same connection. Select the connection in the GUI browser, right-click and select 'Close Connection' from the context menu to avoid any conflict. Then switch back to the test-suite tab.<br />
<br />
In the test suite, the settings were created as an appendix ''expeccoMobileDemo'' (Fig 7). Select the ''Connect'' block (1) and switch to the ''Network'' view on the right (2). Drag and drop the settings into the network of the block (3). Connect the output pin ''pathName'' with the input pin ''stringOrFilename[1]'' of the block ''Connect from File'' (4). Confirm the changes with ''Apply'' (5). This block will establish the connection to the app at the beginning of the test.<br />
<br />
[[Datei:MobileTestingConnectblock.png | frame | left | Abb. 7: Verbindungsbaustein editieren]]<br />
<br clear="all"><br />
<br />
Now switch to the test plan ''Demo Test'' (1) (Fig. 8). This test plan already contains some finished test cases. Before and after the execution (2) one block is also entered: The just edited block ''Connect'' for the setup and the block ''Disconnect'' for the disconnection. By entering the two blocks at this point, the connection is terminated, especially if the test is aborted prematurely, e.g. because one of the test cases fails.<br />
<br />
[[Datei:MobileTestingTestplan.png | frame | left | Abb. 8: Testplanausführung]]<br />
<br clear="all"><br />
Now you can start the test plan ''Demo Test'' by clicking on the green Play button (3). The test plan should run without errors.<br />
<br />
=== Step 2: Creating a block with the Recorder ===<br />
With the help of the integrated recorder, you can easily record execution sequences and store them in a block. This requires a connection to a test device, which is used to create the test.<br />
<br />
To establish a connection, switch back to the GUI browser. The connection that you created previously is still entered in this browser. Since the same name was used for the connection in the test run, the settings were overwritten with it (in our case, the settings were identical anyway). The connection is currently not active, since it was terminated at the end of the execution. However, the settings are still entered there. To reestablish the connection with this configuration, select it, right-click it, and then ''Connect''.<br />
<br />
Wait until the connection is established (1) and then press the record button (2) to start recording (Fig. 9).<br />
<br />
[[Datei:MobileTestingRecorderStarten.png | frame | left | Abb. 9: Recorder starten]]<br />
<br clear="all"><br />
A window opens with the Mobile Testing Recorder (Fig. 10). This shows a screenshot of the connected device. This screen allows you to control the device remotely. Every action you perform is recorded in the background.<br />
<br />
In the upper menu bar, you can select the tool (1) with which you want to enter an action. The tool ''Auto'' is selected by default. You can use it to record certain actions by making gestures on the display with the mouse pointer. For example, if you left-click for a long time, this corresponds to a long tap on the element at this point. Instead of specifying the desired action with the corresponding gesture, you can also select it manually.<br />
<br />
Now a new test for the recognition of correct GTIN-13 codes shall be recorded. First click briefly on the button ''GTIN-13 (EAN-13)'' (2) of the app in the display to trigger a corresponding click on the device. During the execution of this action, the frame of the recorder will briefly turn red. If the recorder does not display the current view of the app afterwards, click on the update icon (3) in the recorder.<br />
<br />
[[Datei:MobileTestingRecorder1iOS.png | frame | left | Abb. 10: Über Recorder zur GTIN-13-Activity wechseln]]<br />
<br clear="all"><br />
Then enter a correct GTIN-13 in the input field of the new page. To do this, right-click on the input field (1) and select the action ''Set text'' (2) in the context menu (Fig. 11). Enter any valid article number in GTIN-13 format, e.g. ''4006381333986'' (3). This text is now set in the app.<br />
<br />
[[Datei:MobileTestingRecorder2iOS.png | frame | left | Abb. 11: GTIN-13-Code über Recorder eingeben]]<br />
<br clear="all"><br />
Now click on ''Verify'' (1) (Fig. 12). The app now displays ''OK'' (2) as the result. The test should determine whether this result is actually displayed. After a right click you can select the action ''Assure attribute'' (3) in the context menu. In the dialog that opens, select the property ''value'' (4) and confirm with ''OK'' (5). This time, no action is triggered on the device, but only a block is recorded that fails if the result deviates from the expected value ''OK''.<br />
<br />
[[Datei:MobileTestingRecorder3iOS.png | frame | left | Abb. 12: Antwort der App über Recorder auslesen]]<br />
<br clear="all"><br />
Now close the recorder. In the ''workspace'' of the GUI browser you can see that a block has been created for each of the recorded actions (Fig. 13). You can now test whether the recorded action can be played back. To do this, you must first return the app on your device to its initial state by using the ''Home'' button on the top left of the device. Then click in expecco on the green Play button (1). If everything turns green, the execution was successful. Now create a new block in the test-suite by clicking on the block symbol (2) in the upper right corner. Give it the name ''GTIN_Verify_OK'' (3) and confirm (4).<br />
<br />
[[Datei:MobileTestingArbeitsbereich.png | frame | left | Abb. 13: Neuen Baustein aus Arbeitsbereich exportieren]]<br />
<br clear="all"><br />
Now close the connection by selecting the connection, right-clicking and selecting ''Close connection'' from the context menu.<br />
<br />
Switch back to the Testsuite tab. The new module was created there. Again select the test plan ''Demo-Test'' and add the recorded test case ''GTIN_Verify_OK'' by drag-and-drop at the end of the test plan. Apply the change and restart. The test plan should run again without errors.<br />
<br />
=== Step 3: Customizing XPath Using the GUI Browser ===<br />
Your new device may not work on other devices. The elements used are addressed via an XPath and this cannot be correct on other devices. See the [[#XPath_Customizing_using_the_GUI_Browser|Customizing_XPath using the GUI Browser]] section for more information. If you have another device available, you can now try to generalize the paths in your created devices. You can also skip this step.<br />
<br />
If you find it difficult to find shortened paths, follow the paths of the existing blocks. Start the test again. If the test now fails, check the paths again in the GUI browser.<br />
To run the test on a second device, open in the menu ''Extensions'' > ''Mobile Testing'' > ''Create connection settings''. You will get a dialog similar to the connection dialog. However, you can only create and save settings but not establish a connection. However, you have the option to save individual aspects of the settings, such as only the device. Enter the new device and select it. Click longer on the symbol for saving in the attachment until the delayed menu opens and select ''Save device settings'' here (Fig. 14). It is best to name the attachment after the device. You can then close the dialog again.<br />
<br />
[[Datei:MobileTestingGerätSpeichern.png | frame | left | Abb. 14: Einstellungen für ein Gerät speichern]]<br />
<br clear="all"><br />
Select the ''Connect'' block and drag the settings for the new device into its network. Now connect its output pin ''pathName'' with the input pin ''stringOrFilename[2]'' of the block ''Connect from File''. The block Connect from File reads the information at the input pins from top to bottom, multiple properties are replaced. In this case, the settings for the device used are replaced, while the other settings remain the same. If you have chosen the paths skilfully, the test will now also run successfully on the other device.<br />
<br />
=== Step 4: Create another block ===<br />
If the same procedures are repeated in the test, you can reuse or modify modules that have already been created for this purpose. The block created in step 2 checks the recognition of correct GTIN 13 codes. A test is still missing which, conversely, checks the detection of a wrong GTIN-13 code. The structure of the two tests is identical, they only differ in their parameters. Therefore copy the block ''GTIN_Verify_OK'' and rename the copy to ''GTIN_Verify_NOT_OK''. Change the input of the GTIN-13 to a wrong code, for example by changing the last digit (''4006381333987'') and set the check value of the output to ''NOT OK'' (Fig. 15).<br />
<br />
[[Datei:MobileTestingGTIN_Verify_NOT_OK_iOS.png | frame | left | Abb. 15: Baustein editieren]]<br />
<br clear="all"><br />
Add this new test to the Test Plan Demo Test as well and place it at the end. Run the test plan, but don't forget to disconnect in the GUI browser first.<br />
<br />
The new test will fail because the device you added does not return to the start page of the app, but the tests start from there. This is already considered in the other blocks; they always execute the block ''Back to main menu'' at the end. You can see this by selecting one of the other blocks, e.g. ''GTIN_Calculate'', and switching to its schematic view. There the block ''Back to main menu'' is displayed in the field ''After execution'' (Fig. 16). As with the corresponding field in the test plan, this block is always executed at the end, regardless of whether the test is successful or aborted. Now add this entry to your blocks ''GTIN_Verify_OK'' and ''GTIN_Verify_NOT_OK''. Select the block and drag the block ''Back to main menu'' in the schema view to the input field ''After execution''. Now you can start the test plan and all tests should be executed again without any problems.<br />
<br />
[[Datei:AppiumDemo Nach Ausführung.png | frame | left | Abb. 16: Nach-Ausführungs-Baustein setzen]]<br />
<br clear="all"><br />
<br />
=== Step 5: Complete test ===<br />
For the Activity IBAN all answer possibilities of the app are already covered with test cases. In the GTIN-13-Activity a correct and a faulty code are tested and a check digit is calculated, but the behaviour of the app in case of input of wrong length is not tested yet (With Verify '''Input must be exactly 13 digits''. and ''...12 digits''. for Calculate). The activity for checking the serial numbers of euro banknotes is not yet tested. As with the IBAN, three cases can occur here: a correct serial number was entered (answer: ''OK''), an incorrect serial number was entered (answer: ''NOT OK'') or the specification does not correspond to the format (answer: ''A serial number consists of 12 characters with the first one or two being capital letters (A-Z).''). You can now extend the test coverage by creating test cases. You can create the blocks for this with the recorder as in step 2 and generalize the XPaths if necessary. If you are familiar with the basic handling of expecco, you can of course also create blocks without recorder by manually assembling them from existing blocks of the library. You can also combine both approaches as you wish.<br />
<br />
Note that the test cases presented here only check individual entries. If you write test cases for your own apps, you probably want to test more closely by entering more different values, including edge cases.<br />
<br />
= Dialogs of the Mobile Testing Plugin =<br />
== Connection Editor ==<br />
You can use the Connection Editor to quickly define, change, or establish connections. Depending on the task, the dialog has small differences and is opened differently:<br />
*If you want to establish a connection, access the dialog in the GUI browser by clicking on ''Connect'' and then selecting ''Mobile Testing''.<br />
*To change or copy an existing connection in the GUI browser, select it, right-click and select ''Edit Connection'' or ''Copy Connection'' from the context menu.<br />
*If you do not want to create connection settings for the GUI browser but for use in a test, choose ''Create Connection Settings'' from the Mobile Testing Plugin menu.... This only allows you to create the settings for a connection without creating a connection in the GUI browser.<br />
<br />
The Connection Editor menu has several buttons, some of which are only visible when creating connection settings:<br />
[[Datei:MobileTestingVerbindungseditorMenu.png]]<br />
#''Delete Settings'': Resets all entries. (Only visible when creating settings.)<br />
#''Load settings from file'': Allows to open a saved settings file (*.csf). Its settings are transferred to the dialog. Entries already made without conflict are retained.<br />
#''Load settings from attachment'': Allows you to open an attachment with connection settings from an open project. These settings are applied to the dialog. Entries already made without conflict are retained.<br />
#''Save settings to file'' and<br />
#''Save settings to attachment'': Here you can save the entered settings to a file (*.csf) or create them as an attachment in an open project. Both options have a delayed menu in which you can choose to save only a certain part of the settings. (Only visible when creating settings.)<br />
#''Advanced View'': Allows you to switch to the advanced view to make additional settings. Read more about this at the end of this chapter. (Only visible when creating settings.)<br />
#''Help'': A help text for the respective step is shown or hidden on the right side.<br />
<br />
<br />
The dialog is divided into three steps. In the first step you select the device you want to use, in the second step you select which App should be used and in the last step the settings for the Appium server are made.<br />
<br />
===<span id="AppiumConnectionEditorStep1"><!-- Referenced by AppiumConnectionEditor in Mobile Testing Plugin --></span>Step 1: Select Device ===<br />
In the upper part you will see a list of all connected Appium devices that are detected. With the checkbox below you can hide devices that are detected but not ready. If you want to enter a device that is not connected, you can create it with the corresponding button ''Enter Android device'' or ''Enter iOS device''. However, you need to know the required properties of your device. The device is then created in a second device list and can be selected there. If no list with connected elements can be displayed, various messages are displayed instead:<br />
*No devices found<br />
*:expecco could not find any Android devices.<br />
*:To automatically configure a connection to a device, make sure<br />
*:*it is connected<br />
*:*it is turned on<br />
*:*that it has an appropriate adb driver installed<br />
*:*it is enabled for debugging (see below).<br />
*No available devices found<br />
*:expecco could not find any available Android devices. But not available ones were found, e.g. with the status "unauthorized".<br />
*:To configure a connection to a device automatically, make sure that <br />
*:*it is connected<br />
*:*it is turned on<br />
*:*that it has an appropriate adb driver installed<br />
*:*it is enabled for debugging (see below).<br />
*:To view unavailable devices, enable this option below.<br />
*Connection lost<br />
*:expecco has lost the connection to the adb server. Try to re-establish the connection by clicking on the button.<br />
*Connection failed<br />
*:expecco could not connect to the adb server. Possibly it is not running or the specified path is not correct.<br />
*:Check the adb configuration in the settings and try to start the adb server and establish a connection by clicking on the button.<br />
*Connect ...<br />
*:expecco connects to the adb server. This may take a few seconds.<br />
*Start adb-Server ...<br />
*:expecco starts the adb-Server. This may take a few seconds.<br />
<br />
<!--With ''Automation by'' you can specify, which automation engine is to be used. If you leave the setting at ''(Default)'' the corresponding capability is not set at all. Otherwise Appium, Selendroid and from expecco 2.11 XCUITest are available. Selendroid is usually only used for Android devices prior to version 4.1.-->With ''Next'' you get to the next step. If you enter settings for the GUI browser, this is only possible once a device has been selected.<br />
<br />
<span id="UnlockingDeveloperOptions">Note on unlocking</span>: In newer Android versions the developer options are no longer offered in the settings at first. If your Android device does not show an entry for "''Developer options''" in the settings, first select the entry "''Phone info''", then "''SoftwareVersionsInfo''" and click on the entry "''BuildVersion''" several times.<br />
<br />
===<span id="AppiumConnectionEditorStep2"><!-- Referenced by AppiumConnectionEditor in Mobile Testing Plugin --></span>Step 2: Select App===<br />
Here you can enter information about the app to be tested. You can decide if you want to use an app that is already installed on the device or if you want to install an app for the test. Select the appropriate tab above. Depending on whether you selected an Android or an iOS device in the previous step, the required input will change.<br />
<br />
*'''Android'''<br />
**''App on Device''<br />
**:If you have selected a connected device in the first step, the packages of all installed apps are automatically retrieved and you can select from the drop-down lists. The installed apps are divided into third-party packages and system packages; select the appropriate package list. This selection does not belong to the settings, but only provides the corresponding package list. You can use the filter to further narrow down the list and then select the desired package. The activities of the selected package are also automatically retrieved and made available as a drop-down list. Select the activity you want to start. As a rule, an activity is automatically entered from the list. If you are not using a connected device, you must enter the package and the activity manually.<br />
**''Install App''<br />
**:Under ''App'', enter the path to an app. The path must be valid for the Appium server being used. You can also specify a URL. If you are using a local Appium server, you can use the right button to navigate to the App installation file and enter this path. If possible, the corresponding package and the activity are also entered in the fields below. However, this entry is not necessary.<br />
<br />
*'''iOS'''<br />
**''App on Device''<br />
**:Specify the bundle ID of an installed app. You can find out the IDs of the installed apps using Xcode, for example. Start Xcode and select ''Devices'' from the menu bar at the top of the screen in the ''Window'' menu. A window will open displaying a list of connected devices. If you select your device, you will see a list of the apps you have installed in the overview.<br />
**''Install App''<br />
**:Under ''App'', enter the path to an app. The path must be valid for the Appium server being used. You can also specify a URL. For the requirements of apps for real devices, please read the section [[#iOS-Ger.C3.A4t_and_App_Preparing|Preparing an iOS-Device and App]].<br />
<br />
In the lower part you can specify whether the app should be reset or uninstalled when the connection is terminated, and whether it should be reset initially. Again, the corresponding capability is not set if you select ''(Default)''. With ''Next'' you get to the next step.<br />
<br />
===<span id="AppiumConnectionEditorStep3"><!-- Referenced by AppiumConnectionEditor in Mobile Testing Plugin --></span>Step 3: Server Settings===<br />
In the last step, a list of all the capabilities that result from your entries in the previous steps is first displayed in the upper part. If you are familiar with Appium and want to set additional capabilities that are not covered by the connection editor, you can click on ''Edit'' to open the extended view. See the section below for more information.<br />
<br />
If you enter settings for the GUI browser, you can enter the ''Connection name'' with which the connection is displayed. This is also the name under which devices can use this connection when it is established. If you leave the field blank, a name will be generated. To specify the address for the Appium server, you get the local default address and addresses already used for selection. If you check the box for ''Start on demand'', expecco tries to start an Appium server at the given address when connecting, if none is running there yet. This server will then also be shut down when the connection is terminated. This only works for local addresses. Make sure that you only use port numbers that are free. It is best to only use odd port numbers from the standard port 4723. The following port number is also used when establishing a connection, which could otherwise lead to conflicts.<br />
<br />
Depending on how you opened the dialog, there are now different buttons to close it. In any case you have the option to save. This opens a dialog where you can either select an open project to save the settings there as an attachment, or choose to save it to a file that you can then specify. Saving does not close the dialog, allowing you to select another option.<br />
<br />
If you have opened the editor for establishing a connection, you can finally click on ''Connect'' or ''Start and connect server'', depending on whether the check mark for server start is set. For changing or copying a connection in the GUI Browser, this option is called ''Apply'', since in this case only the connection entry is changed or created, but the connection setup is not started. If necessary, you can do this afterwards via the context menu. If you have changed capabilities of an existing connection, a dialog then prompts you to decide whether these changes should be applied directly by closing the connection and establishing the new connection or not. In this case, the changes only take effect after you reestablish the connection.<br />
<br />
To use the connection editor, also read the corresponding section in the respective tutorial in step 1. (Android: [[#Step_1:_Demo_Run|Run Demo]], iOS: [[#Step_1:_Demo_Run_2|Run Demo]]).<br />
<br />
===Extended View===<br />
The extended view of the connection editor can be obtained either by clicking on ''Edit'' in the third step or at any time via the corresponding menu item if you have started the editor via the plugin menu. This view displays a list of all configured Appium Capabilities. You can add, change or remove further entries to this list. To add a capability, select it from the drop-down list of the input field. In this list all known capabilities are sorted into the categories ''Common'', ''Android'' and ''iOS''. If you have selected a capability, a short information text is displayed. You can also enter a capability manually in the field. Then click on ''Add'' to add the capability to the list. There you can set the value in the right column. To delete an entry, select it and click on ''Remove''. With ''Back'' you leave the extended view.<br />
<br />
[[Datei:MobileTestingErweiterteAnsicht.png]]<br />
<br />
== Running Appium Servers ==<br />
In the menu of the Mobile Testing Plugin you will find the entry ''Appium-Server...''. This opens a window with an overview of all Appium servers started by expecco and on which port they are running. By clicking on the icon in the column ''Show Log'' you can view the logfile of the corresponding server. This is deleted when the server is shut down. With the icons in the column ''Exit'' the corresponding server can be terminated. However, this is prevented if expecco still has an open connection via this server.<br />
<br />
You can also start servers here. Use the input fields to configure the server address. You can also leave the fields blank to use the default values. Please note that servers can only be started locally and the selected port must not be occupied. Typically the odd port numbers from 4723 are used. The following port number is also required when connecting to a device, which could lead to conflicts with the even numbers.<br />
<br />
[[Datei:MobileTestingAppiumServer.png]]<br />
<br />
In the menu of the Mobile Testing Plugin you will also find the entry ''Close all Connections and Servers''. This is intended for cases where connections or servers cannot be terminated in any other way. If possible, always terminate connections in the GUI browser or by executing a corresponding block. Servers that you have started in the server overview should be terminated there; servers that were started with a connection are automatically terminated with this connection.<br />
<br />
Note that only servers started and managed by expecco are listed in the overview. Possible other Appium servers that were started in a different way are not recognized.<br />
<br />
== Recorder ==<br />
If the GUI browser is connected to a device, the integrated recorder can be used to record a test section with that device. To start the recorder, select the appropriate connection in the GUI browser and click the Record button. A new window opens for the recorder. The recorded actions are created in the GUI browser work area. It is therefore possible to edit the recorded data in parallel.<br />
<br />
[[Datei:MobileTestingRecorder.png|caption|]]<br />
<br />
;Components of the Recorder Window<br />
#'''Update''': Gets the current image and element tree from the device. This is necessary if the device takes longer to execute an action or if something changes without being triggered by the recorder. <br />
#'''Follow Mouse''': Select the element under the mouse pointer in the GUI browser.<br />
#'''Element Highlighting''': The element under the mouse is outlined in red.<br />
#'''Show Elements''': Show the borders of all elements in the view.<br />
#'''Tools''': Selection, which tool is used for recording. The selected action is triggered with each click on the view. The following actions are available:<br />
#*Element Actions:<br />
#**Click: Short click on the element under cursor. Kurzer Klick auf das Element über dem der Cursor steht. To determine more precisely which element is used, use the Follow Mouse or Element Highlighting function.<br />
#**Tap Element: Similar to click, exept that the duration of the click will be recorded as well. This allows the recording of long clicks.<br />
#**Set Text: Allows to set the text of an input field.<br />
#**Clear Text: Clears the text of an input field.<br />
#*Device Actions:<br />
#**Tap: Triggers a click at the screen position, which also considers the duration<br />
#**Swipe: Swipe in a straight line from the point where you press the mouse button until you release it. The duration is also recorded.<br />
#:Please note for this actions that the result may differ on different devices, e.g. with different screen resolutions.<br />
#*Test Flow Blocks<br />
#**Check Attribute: Compares the value of a specified attribute of the element with a predefined value. The result triggers the corresponding output.<br />
#**Assert Attribut: Compares the value of a specified attribute of the element with a predefined value. If the values are not equal, the test fails.<br />
#*Auto<br />
#:If the Auto tool is selected, you can use all actions by specific input methods: ''Click'', ''Tap Element'' and ''Swipe'' still work by clicking, but are distinguished by the duration and movement of the cursor. To trigger a ''Tap'', hold down Ctrl while clicking. The remaining actions are available in a context menu by right-clicking on the element.<br />
#'''Softkeys''': Only for Android. Simulates pressing the buttons Back, Home, Menu and Power.<br />
#'''Home Button''': Only for iOS since expecco 2.11. Allows pressing the Home button.Prior to expecco 19.2, it only works if AssistiveTouch is activated and the menu is located in the middle of the upper screen border. From expecco 19.2 on, the function no longer uses AssistiveTouch.<br />
#'''View''': Shows a screenshot of the device. Actions are triggerd by mouse depending on the selected tool. If a new action can be recorded, the window has a green frame, else it is red.<br />
#'''Resize Window to Image''': Resizes the recorder window so that the screenshot can be displayed completely.<br />
#'''Resize Image to Window''': Scales the screenshot to a size that makes use of the full size of the window.<br />
#'''Correct Orientation''': Corrects the image if it is upside down. Using the arrow to the right, the image can also be rotated by 90°, if this should ever be necessary. The orientation of the image is irrelevant for the functionality of the recorder, it only works on the elements it receives.<br />
#'''Scaling''': Changes the scaling of the screenshots.<br />
#'''Control''': Shows the state of the recorder<br />
#:''green'': The recorder is ready<br />
#:''red'': The recorder is locked because the display and the element list are updated<br />
#:''gray'': The recorder can no longer be used because the connection to the device has been lost<br />
<br />
;Usage<br />
Each click in the window triggers an action and is recorded in the workspace of the GUI browser. There you can run, edit, or create a new block from what you have recorded. On how to use the recorder, see also step 2 in the tutorial ([[#Step_2:_Creating_a_Block_with_the_Recorder|Android]] resp. [[#Step_2:_Creating_a_block_with_the_Recorder_2|iOS]]).<br />
<br />
== AVD Manager und SDK Manager ==<br />
AVD Manager und SDK Manager sind beides Anwendungen von Android. Im Menü des Mobile Testing Plugins bietet expecco die Möglichkeit, diese zu starten. Ansonsten finden Sie diese Programme bei Ihrer Android-Installation. Mit dem AVD Manager können Sie AVDs, also Konfigurationen für Emulatoren, erstellen, bearbeiten und starten. Mit dem SDK Manager erhalten Sie einen Überblick über Ihre Android-Installation und können diese bei Bedarf erweitern.<br />
<br />
= Hybrid Apps and WebViews =<br />
!!!IMPORTANT NOTICE - If you have problems switching to the webview, please set the "Default Application - Browser App" in Android Settings to "Chrome" !!!<br />
<br />
Hybrid apps contain platform native elements as well as other elements that are integrated in a WebView. These elements can also be used, but you first have to switch to the corresponding context. With the block ''Get Current Context'' you get the current context. Initially this is ''NATIVE_APP'', i.e. the context of the native elements. With the block ''Get Context Handles'' you get a collection of all existing contexts. If there is a WebView context, it is called ''WEBVIEW_1'' or ''WEBVIEW_<package>'' with the package of the WebView. Several WebView contexts are also possible. For each WebView context, there is a corresponding WebView element in the native context. You can use the ''Switch to Context'' block to switch to such a context and from now on only have access to the elements in this context.<br />
<br />
In the GUI browser, the existing contexts are displayed at the top of the tree as well as the tree of a context is inserted below the corresponding WebView element.<br />
<br />
=<span id="Customizing XPath using the GUI Browsers"><!-- name before 01.10.2020--></span>Customizing XPath using the GUI Browser=<br />
Bausteine, die auf einem Gerät fehlerfrei funktionieren, tun dies auf anderen Geräten möglicherweise nicht. Auch können kleine Änderungen der App dazu führen, dass ein Baustein nicht mehr den gewünschten Effekt hat. Man sollte einen Baustein daher so robust formulieren, dass er für eine Vielzahl von Geräten verwendet werden kann und kleine Anpassungen an der App verkraftet. Dazu muss man das grundlegende Funktionsprinzip der Adressierung verstehen. Dies wird im Folgenden am Beispiel der App aus dem Tutorial erläutert.<br />
<br />
Die Ansicht der App setzt sich aus einzelnen Elementen zusammen. Dazu gehören die Schaltflächen ''GTIN-13 (EAN-13)'' und ''Verify'', das Eingabefeld der Zahl ''4006381333986'' und das Ergebnisfeld, in dem OK erscheint, wie auch alle anderen auf der Anzeige sichtbaren Dinge. Diese sichtbaren Elemente sind in unsichtbare Strukturelemente eingebettet. Alle Elemente zusammen sind in einer zusammenhängenden Hierarchie, dem Elementbaum, organisiert.<br />
<br />
[[Datei:MobileTestingGUIBrowser.png | frame | left | Abb. 1: Funktionen des GUI-Browsers]]<br />
<br clear="all"><br />
Sie können sich diesen Baum im GUI-Browser ansehen. Wechseln Sie dazu in den GUI-Browser (Abb. 1) und starten Sie eine beliebige Verbindung. Sobald die Verbindung aufgebaut ist, können Sie den gesamten Baum aufklappen (1) (Klick bei gedrückter Strg-Taste). Er enthält alle Elemente der aktuellen Seite der App.<br />
<br />
Ein Baustein, der nun ein bestimmtes Element verwendet, muss dieses eindeutig angeben, indem er dessen Position im Elementbaum mit einem Pfad im XPath-Format beschreibt. Dieses Format ist ein verbreiteter Web-Standard für XML-Dokumente und -Datenbanken, eignet sich aber genauso für Pfade im Elementbaum.<br />
<br />
Wenn Sie ein Element im Baum auswählen, wird unten der von expecco automatisch generierte XPath (2) für das Element angezeigt, der auch beim Aufzeichnen verwendet wird. Oberhalb davon in der Mitte des Fensters befindet sich eine Liste der Eigenschaften (3) des ausgewählten Elements. Man nennt diese Eigenschaften auch Attribute. Sie beschreiben das Element näher wie beispielsweise seinen Typ, seinen Text oder andere Informationen zu seinem Zustand. Links unten können Sie zur besseren Orientierung im Baum die ''Vorschau'' (4) aktivieren, um sich den Bildausschnitt des Elements anzeigen zu lassen.<br />
<br />
Der Elementbaum für gleiche Ansicht einer App kann sich je nach Gerät unterscheiden. Es sind diese Unterschiede, die verhindern, eine Aufnahme von einem Gerät unverändert auch auf allen anderen Geräten abzuspielen: Ein XPath, der im einen Elementbaum ein bestimmtes Element identifiziert, beschreibt nicht unbedingt das gleiche Element im Elementbaum auf einem anderen Gerät. Es kann stattdessen passieren, dass der XPath auf kein Element, auf ein falsches Element oder auf mehrere Elemente passt. Dann schlägt der Test fehl oder er verhält sich unerwartet.<br />
<br />
Man könnte natürlich für jedes Gerät einen eigenen Testfall schreiben. Das brächte aber unverhältnismäßigen Aufwand bei Testerstellung und -wartung mit sich. Das Problem lässt sich auch anders lösen, da ein jeweiliges Element nicht nur durch genau einen XPath beschrieben wird. Vielmehr erlaubt der Standard mithilfe verschiedener Merkmale unterschiedliche Beschreibungen für ein und dasselbe Element zu formulieren. Das Ziel ist daher, einen Pfad zu finden, der auf allen für den Test verwendeten Geräten funktioniert und überall eindeutig zum richtigen Element führt.<br />
<br />
Im Beispiel besteht die Verbindung zur Android-App aus dem Tutorial und der Eintrag des GTIN-13-Buttons ist ausgewählt (5). Dessen automatisch generierter XPath (2) kann beispielsweise so aussehen:<br />
<br />
<blockquote>//hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout[@resource id='android:id/content']/android.widget.RelativeLayout/android.widget.Button[@resource-id='de.exept.expeccomobiledemo:id/gtin_13']</blockquote><br />
<br />
Er ist offensichtlich lang und unübersichtlich. Der sehr viel kürzere Pfad<br />
<br />
<blockquote>//*[@text='GTIN-13 (EAN-13)']</blockquote><br />
<br />
führt zum selben Element.<br />
<br />
Für die iOS-App lautet der automatisch generierte XPath für diesen Button beispielsweise<br />
<br />
<blockquote>//AppiumAUT/XCUIElementTypeApplication/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeButton[2]</blockquote><br />
bzw.<br />
<blockquote>//AppiumAUT/UIAApplication/UIAWindow[1]/UIAButton[2]</blockquote><br />
<br />
und kann kürzer als<br />
<br />
<blockquote>//*[@name='GTIN-13 (EAN-13)']</blockquote><br />
<br />
geschrieben werden.<br />
<br />
Sie können den Pfad entsprechend im GUI-Browser ändern und durch ''Pfad überprüfen'' (6) feststellen, ob er weiterhin auf das ausgewählte Element zeigt, was expecco mit ''Verify Path: OK'' (7) bestätigen sollte. Der erste, sehr viel längere Pfad, beschreibt den gesamten Weg vom obersten Element des Baumes bis hin zum gesuchten Button. Der zweite Pfad hingegen wählt mit * zunächst sämtliche Elemente des Baumes und schränkt die Auswahl dann auf genau die Elemente ein, die ein ''text''- bzw. ''name''-Attribut mit dem Wert ''GTIN-13 (EAN-13)'' besitzen, in unserem Fall also genau der eine Button, den wir suchen.<br />
<br />
Im folgenden werden Android-ähnliche Pfade zur Veranschaulichung verwendet. Die Elemente in iOS-Apps heißen zwar anders, wodurch andere Pfade entstehen; das Prinzip ist jedoch das gleiche.<br />
<br />
[[Datei:MobileTestingBaum1.png | frame | Abb. 2: Elementbaum einer fiktiven App]]<br />
<br />
Sie können solche Pfade mit Hilfe weniger Regeln selbst formulieren. Sehen Sie sich den einfachen Baum einer fiktiven Android-App in Abb. 2 an: Die Einrückungen innerhalb des Baumes geben die Hierarchie der Elemente wieder. Ein Element ist ein ''Kind'' eines anderen Elementes, wenn jenes andere Element das nächsthöhere Element mit einem um eins geringeren Einzug ist. Jenes Element ist das ''Elternelement'' des Kindes. Sind mehrere untereinander stehende Elemente gleich eingerückt, so sind sie also alle Kinder desselben Elternelements.<br />
<br />
Ein Pfad durch alle Ebenen der Hierarchie zum TextView-Element ist nun:<br />
<br />
<blockquote>//hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.TextView</blockquote><br />
<br />
Die Elemente sind mit Schrägstrichen voneinander getrennt. Es fällt auf, dass der Name des ersten Elements nicht mit dem im Baum übereinstimmt. Das oberste Element in der Hierarchie heißt immer ''hierarchy'' (für iOS wäre es ''AppiumAUT''), expecco zeigt im Baum stattdessen den Namen der Verbindung an, damit man mehrere Verbindungen voneinander unterscheiden kann. Die weiteren Elemente tragen jeweils das Präfix ''android.widget.'', das im Baum zur besseren Übersicht nicht angezeigt wird. Bei IOS gibt es kein Präfix, das durch einen Punkt abgetrennt wäre, expecco 2.11 blendet aber entsprechend ''XCUIElementType'' am Anfang aus. Mit jedem Schrägstrich führt der Pfad über eine Eltern-Kind-Beziehung in eine tiefere Hierarchie-Ebene, d. h. ''FrameLayout'' ist ein Kindelement von ''hierarchy'', ''LinearLayout'' ist ein Kind von ''FrameLayout'' usw. Die in eckigen Klammern geschriebenen Wörter dienen nur als Orientierungshilfe im Baum. Sie gehören nicht zum Typ.<br />
<br />
Ein Pfad muss nicht beim Element ''hierarchy'' beginnen. Man kann den Pfad beginnend mit einem beliebigen Element des Baumes bilden. Man kann also verkürzt auch<br />
<br />
<blockquote>//android.widget.TextView</blockquote><br />
<br />
schreiben. Der Pfad führt zum selben ''TextView''-Element, da es nur ein Element dieses Typs gibt. Anders verhält es sich bei dem Pfad<br />
<br />
<blockquote>//android.widget.Button.</blockquote><br />
<br />
Da es zwei Elemente vom Typ ''Button'' gibt, passt dieser Pfad auf zwei Elemente, nämlich den Button, der mit "''An''" markiert ist, und den ''Button'', der mit "''Aus''" markiert ist. Es würde an dieser Stelle aber auch nicht helfen den langen Pfad von ''hierarchy'' aus beginnend anzugeben. Um einen mehrdeutigen Pfad weiter zu differenzieren, kann man explizit ein Element aus einer Menge wählen, indem man den numerischen Index in eckigen Klammern dahinter schreibt. Der Pfad aus dem obigen Beispiel lässt sich damit so anpassen, dass er eindeutig auf den ''Button'' mit der Markierung "''Aus''" weist:<br />
<br />
<blockquote>//android.widget.Button[1].</blockquote><br />
<br />
Ihnen fällt sicher auf, dass der Index eine 1 ist obwohl das zweite Element gemeint ist. Das kommt daher, dass die Zählung bei 0 beginnt. Der Button mit der Markierung "An" hat also die Nummer 0 und der ''Button'' mit der Markierung "''Aus''" hat die Nummer 1.<br />
<br />
Dieser Ansatz, einen expliziten Index zu verwenden, hat zwei Nachteile: Zum einen lässt sich an dem Pfad nur schwer ablesen welches Element gemeint ist, zum andern ist der Pfad sehr empfindlich schon gegenüber kleinsten Änderungen, wie zum Beispiel dem Vertauschen der beiden ''Button''-Elemente oder dem Einfügen eines weiteren ''Button''-Elements in der App.<br />
<br />
Es wäre daher wünschenswert, das gemeinte Element über eine ihm charakteristische Eigenschaft wie einen Attributwert, zu adressieren. Für Android-Apps eignet sich hierfür häufig das Attribut ''resource-id''. Im Idealfall muss bei der Entwicklung der App darauf geachtet werden, dass jedes Element eine eindeutige Id erhält. Die ''resource-id'' hat den großen Vorteil, dass sie unabhängig vom Text des Elements oder der Spracheinstellung des Geräts ist. Für iOS-Apps kann entsprechend das Attribut ''name'' verwendet werden, wenn es von der App sinnvoll gesetzt wird. Der XPath-Standard erlaubt solche Auswahlbedingungen zu einem Element anzugeben. Angenommen, der ''Button'' mit der Markierung "''Aus''" hat die Eigenschaft ''resource-id'' mit dem Wert ''off'' und der ''Button'' mit der Markierung "''An''" hat als ''resource-id'' den Wert ''on'', dann kann man als eindeutigen Pfad für den "Aus"-''Button''<br />
<br />
<blockquote>//android.widget.Button[@resource-id='off']</blockquote><br />
<br />
formulieren. Wie an dem Beispiel zu sehen werden solche Bedingungen wie ein Index in eckigen Klammern an den Elementtyp angehängt. Der Name eines Attributes wird mit einem @ eingeleitet und der Wert mit einem = in Anführungszeichen angehängt. Ist der Attributwert global eindeutig, kann man den vorausgehenden Pfad sogar durch den globalen Platzhalter * ersetzen, der auf jedes Element passt. Das obige Beispiel mit dem GTIN-13-''Button'' war ein solcher Fall.<br />
<br />
[[Datei:MobileTestingBaum2.png | frame | Abb. 3: Elementbaum einer fiktiven App mit Erweiterungen]]<br />
<br />
Abb. 3 zeigt eine Erweiterung des Beispiels aus Abb. 2. Die App hat nun ein weiteres, nahezu identisches ''LinearLayout'' bekommen. Die ''Buttons'' sind in ihren Attributen jeweils ununterscheidbar. Deshalb funktioniert der vorige Ansatz nicht, einen eindeutigen Pfad nur mithilfe eines Attributwerts zu formulieren. Offensichtlich unterscheiden sich aber ihre benachbarten ''TextViews''. Es ist möglich die jeweilige ''TextView'' in den Pfad mit aufzunehmen, um einen ''Button'' dennoch eindeutig zu adressieren. Ein Pfad zum ''Button'' mit der Markierung "''An''" unterhalb der ''TextView'' mit der Markierung "''Druckschalter''" kann dabei wie folgt aussehen:<br />
<br />
<blockquote>//android.widget.TextView[@resource-id='push']/../android.widget.Button[@resource-id='on']</blockquote><br />
<br />
Der erste Teil beschreibt den Pfad zu der ''TextView'' mit der Markierung "''Druckschalter''" und der ''resource-id'' mit dem Wert ''push''. Danach folgt ein Schrägstrich gefolgt von zwei Punkten. Die zwei Punkte sind eine spezielle Elementbezeichnung, die nicht ein Kindelement benennt, sondern zum Elternelement wechselt, in diesem Fall also das ''LinearLayout'', in dem die ''TextView'' eingebettet ist. Im Kontext dieses ''LinearLayout'' ist der restliche Pfad, nämlich der ''Button'' mit der ''resource-id'' mit dem Wert ''on'', eindeutig.<br />
<br />
Der XPath-Standard bietet noch sehr viel mehr Ausdrucksmittel. Mit der hier knapp vorgestellten Auswahl ist es aber bereits möglich für die meisten praktischen Testfälle gute Pfade zu formulieren. Eine vollständige Einführung in XPath ginge über den Umfang dieser Einführung weit hinaus. Sie finden zahlreiche weiterführende Dokumentationen im Web und in Büchern.<br />
<br />
Eine universelle Strategie zum Erstellen guter XPaths gibt es nicht, da sie von den Testanforderungen abhängt. In der Regel ist es sinnvoll, den XPath kurz und dennoch eindeutig zu halten. Häufig lassen sich Elemente über Eigenschaften identifizieren wie beispielsweise ihren Text. Will man aber gerade den Text eines Elements auslesen, kann dieser natürlich nicht im Pfad verwendet werden, da er vorher nicht bekannt ist. Ebenso wird der Text variieren, wenn die App mit verschiedenen Sprachen gestartet wird.<br />
<br />
Jeder Baustein, der auf einem Element arbeitet, hat einen Eingangspin für den XPath. Im GUI-Browser finden Sie in der Mitte oben eine Liste von Bausteinen mit Aktionen, die Sie auf das ausgewählte Element anwenden können. Suchen Sie den Baustein ''Click'' (8) im Ordner Elements und wählen Sie ihn aus (Abb. 1). Er wird im rechten Teil unter ''Test'' eingefügt, der Pin für den XPath ist mit dem automatisch generierten Pfad des Elements vorbelegt (9). Sie können den Baustein hier auch ausführen. Die Ansicht wechselt dann auf ''Lauf''. Ändert sich durch die Aktion der Zustand Ihrer App, müssen Sie den Baum anschließend aktualisieren (10).<br />
<br />
Wenn Sie in der unteren Liste eine Eigenschaft auswählen, wechselt die Anzeige der Bausteine zu ''Eigenschaften'', wo Sie die eigenschaftsbezogenen Bausteine finden. Wie bei den Aktionen können Sie auch hier einen Baustein auswählen, der dann rechts in Test mit dem Pfad des Elements und der ausgewählten Eigenschaft eingetragen wird, sodass Sie ihn direkt ausführen können.<br />
<br />
=<span id="troubleshooting"><!-- Referenced by error dialog on connection error --></span>Problems and Solutions=<br />
== General Remarks==<br />
*If an Android device connected via USB does not appear in the connection dialog, try changing the USB connection type. Usually MTP or PTP should work. See also [[#Prepare_Android_Device|Prepare Android Device]].<br />
*In some cases, when connecting an iOS device via USB, a message appears indicating that the cable used is not certified. In this case, replacing the respective cable is the only solution.<br />
*Note that the [[#Recorder|Recorder]] also considers items that you cannot see on the screen. Therefore, turn on element highlighting or use the follow mouse function and the element tree in the GUI browser to determine if the correct element is used.<br />
*Make sure that no alerts are open when connecting to an iOS device. Otherwise the connection will fail because the app cannot be brought to the foreground. See also [[#Preparing_an_iOS-Device_and_App|Preparing an iOS-Device and App]].<br />
*Note that on iOS simulators no ''.ipa'' files can be installed but only ''.app'' files.<br />
*For Android devices that automatically show and hide softkeys, the recorder may cut off elements in the lower area that would be hidden by the softkeys, even if they are not displayed at this time. In this case it is advisable to set the softkeys so that they are permanently displayed.<br />
<br />
==Connecting Fails==<br />
If the connection to the Appium server fails, you will receive an error message in expecco similar to the one shown below.<br />
<br />
[[File:MobileTestingVerbindungsfehler.png]]<br />
<br />
Here you can see the type of error that has occurred. Click on "''Details''" to get more information. Possible errors are:<br />
*''org.openqa.selenium.remote.UnreachableBrowserException''<br />
:The specified server is not running or is not reachable. Check the server address.<br />
*''org.openqa.selenium.WebDriverException''<br />
:Read the message after ''Original Error'' in the first line of the details:<br />
:*''Unknown device or simulator UDID''<br />
::Either the device is not connected properly or the udid is not correct.<br />
:*''Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65''<br />
::This error can have various causes. Either the WebDriverAgent could actually not be built because the signing settings are wrong or the appropriate provisioning profile is missing. Please read the section about [[#Signing|Signing]]. It is also possible that the WebDriverAgent cannot be started on the device, for example because an alert is in the foreground or you did not trust the developer.<br />
:*''Could not install app: 'Command 'ios-deploy [...] exited with code 253'''<br />
::The specified app cannot be installed on the iOS device because it is not entered in the app's Provisioning Profile.<br />
:*''Bad app: [...] App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name.''<br />
::The path to the app is wrong. Make sure that the file is located in the specified path on your Mac.<br />
:*''packageAndLaunchActivityFromManifest failed.''<br />
::The specified ''apk'' file is probably broken.<br />
:*''Could not find app apk at [...]''<br />
::The path to the app is wrong. Make sure that the ''apk'' file is located in the specified path.<br />
<br />
<br />
If the error is not due to one of the causes listed above, the automation applications on the device may no longer function properly. In this case it helps to uninstall them from the mobile device. They are then automatically reinstalled the next time a connection is established.<br />
<br />
*For iOS devices, this is the WebDriverAgent, which you can simply uninstall from the home screen. This usually solves problems caused by changing the used Mac or the Xcode version.<br />
<br />
*For Android devices, it is the UIAutomator2; here, a problem occurs sporadically on some devices, the cause is currently unknown to us. To uninstall, on the device, navigate to "''Settings''" > "''Applications''"<sup>*</sup> and search the list for the following entries:<br />
Appium Settings<br />
io.appium.uiautomator2.server<br />
io.appium.uiautomator2.server.test<br />
:Click on the respective application and then on "''Uninstall''".<br />
<sup>*</sup>''The corresponding entry may have a slightly different name on some devices.''<br />
<br />
<br />
If this doesn't help, check the output of the Appium server. For a server started by expecco, you can find the log in the list of [[#Running_Appium_Servers|Running Appium Servers]].<br />
<br />
==Problems==<br />
*''The block to click on an element is successful, but no action was performed on the device.''<br />
:This can happen if the element is hidden by another element and therefore clicking on the element is not possible. In this case, Appium does not throw an error, but simply nothing happens. If you would like to make a click at the position of the element anyways, even if it is hidden, use the block ''Tap'' instead and pass the location of the element to it (''Get Location''). If instead you want to check before a click whether the element is hidden at this moment, try whether the properties ''Is Displayed'' or ''Is Enabled'' might help you.</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=WindowsAutomation_Reference_2.0/en&diff=18902WindowsAutomation Reference 2.0/en2020-02-11T09:12:46Z<p>Mb: /* DevExpress Controls are not vissible in the GUI Browser */</p>
<hr />
<div>This is the documentation for the Windows Automation 2.0 plugin.<br />
It provides facilities to automate tests incorporating applications with a GUI based on Windows Presentation Foundation (WPF), WinForms, and the old Win32 API.<br />
<br />
Notice:<br>The vsn2 replaces the previous vsn1 plugin, which is no longer maintained.<br />
The change was necessary due to changes in the Windows operating system, and features which were discontinued by Microsoft.<br />
The vsn2 plugin uses Microsoft's UI-Automation2 API to interact with the application.<br />
This API was not avaliable in Windows-XP, Vista and other older OS versions, and many features used by the previous version are no longer supported in newer OS versions, or need different parameters. <br />
<br />
=Features=<br />
*Automated GUI testing of WPF, WinForms, and Win32 applications.<br />
*Contains an expecco block library and tools which help to model tests and inspect the GUI of the application.<br />
*Parallel remote test-execution on multiple systems.<br />
*Performs tests against already built executables. No source code changes / recompilation of the application is required.<br />
*Access to GUI components using XPath locators.<br />
*Access objects of the application live at execution time.<br />
*Full access to keyboard and mouse of the target system.<br />
*Lots of additional features such as screen capturing, taking screenshots, highlighting GUI elements, mouse tracking, ...<br />
<br />
= Known issues in the current Release 19.1.0 =<br />
* The WindowsAutomation2.ets library has got a new functional id. When reimporting the library in existing Pre-19.1.0 test suites (which is mandatory), a warning about a changed functional id is shown once. It is ok to accept this dialog.<br />
* Instant follow mouse is very expensive in Windows and is therefore disabled. Use ''HotKeys'' to select a GUI element in the tree at the current pointer position or to update the element tree. HotKeys can be configured in the settings. The HotKey-service has to be started. Take care that the keys have not already been grabbed by another application. If that is the case, a warning will be shown, and you should either make sure that expecco is started before the other application, or that you use other hotkey combinations (in either expecco or the application).<br />
<br />
=Installation and Connection=<br />
The WindowsAutomation testing plugin uses the expecoo ".NET-Bridge" which consists of two parts: A plugin for expecco, and a server executable using the .NET framework running on the remote computer to connect to.<br />
<br />
==Requirements==<br />
On the machine running the system under test:<br />
*.NET Framework 4.6.2 [https://www.microsoft.com/net/download/all] or higher.<br />
* One of the following operation systems:<br />
::- Windows 7 SP1<br />
::- Windows 8<br />
::- Windows 8.1<br />
::- Windows 10<br />
<br />
::- Windows Server 2008 R2 SP1<br />
::- Windows Server 2012<br />
::- Windows Server 2012 R2<br />
::- Windows Server 2016<br />
::- Windows Server, version 1709<br />
<br />
==Plugin Components==<br />
The plugin consists of the following parts:<br />
* The [[GUI Browser]], used to interactively explore your application.<br />
* The Windows Automation Library, which provides blocks that you can use in your test cases.<br />
* The .NET-Bridge server, which provides an interface between the application under test and expecco.<br />
<br />
==Installing and Configuring the Plugin in Expecco==<br />
The plugin is usually installed automatically by the installer; either included in the main expecco installation or provided as a separate installable add-on package. Its files are stored in the "<code>plugin</code>" subfolder of the expecco installation folder. You can also copy those files manually to that folder, if required. Expecco detects the plugin automatically during startup. You may have to restart your expecco session, if the plugin is installed later.<br />
<br />
==Preparing a local system for test execution==<br />
To automate applications running on the SAME host as expecco, there is no need to set up anything - it should work out of the box.<br />
<br />
Try to connect to an application via the GUIBrowser's ''WindowsAutomation''-connect dialog:<br />
<br />
[[Datei:WindowsAutomation2Connect.png]]<br />
<br />
==Preparing a remote system for test execuction==<br />
<br />
===Security Considerations===<br />
Please make sure, that remote access is only possible from inside a secure local network.<br />
Under no circumstances should you grant access to the DotNetBridgeServer from untrusted hosts.<br />
<br />
===DotNet Bridge Server===<br />
<br />
The remote system has to run the "''.Net-Bridge server''" which in turn either actively connects to expecco or passively waits for an incoming connection from expecco.<br />
<br />
For this, copy "<code>DotNetBridgeServer.exe</code>" (in the "<code>packages/exept/bridgeFramework/dotNetBridge/dotNetBin</code>" folder under the expecco installation directory) to the computer where your system under test is running (you can copy it into any folder). No further installation is needed.<br />
<br />
To start the bridge, navigate to the executable in a shell/cmd/console and start it with the following arguments<br />
("<code>DotNetBridgeServer.exe --help</code>" outputs a list of valid options):<br />
{| class="wikitable"<br />
|-<br />
! Arguments !! Required !! Description<br />
|-<br />
| -s || Yes || "''server mode''". Tells the executable to run in server mode (it will wait for expecco to connect to it, as opposed to client mode,<br>where it actively connects to the partner).<br />
|-<br />
| -k || Yes || "''keepalive''". Tells the client to keep the connection open after a connection has been terminated.<br>This saves you the hassle to restart it every time a test finishes.<br />
|-<br />
| -a&nbsp;<ip/hostname>|| Yes || "''accepted hosts''". The IP-address or hostname from which it will accept connections (in server mode) or to which it connects.<br>To ensure that in slave mode no other machine connects to the server, set this to the IP of the machine your expecco is running on.<br>To allow any machine (i.e. to have it listen on any IP-address), set it to 0.0.0.0. Allowing any host should only be done, if you are inside a secure network.<br />
|-<br />
| -p <int> || No || "''port''". The port the server should listen on (in server mode) or to which is should connect (default is 34318).<br />
|-<br />
| -L <string> || No || "''assembly''". Load a .NET assembly on startup. Omit the .dll extension (so use "WindowsAutomation" but not "WindowsAutomation.dll").<br>You can repeat this option to load multiple assemblies. <br />
Note: this is not normally needed, as expecco loads the required assemblies automatically into the bridge.<br>However, if security settings forbid external assemblies, you have to copy them to the target machine, and load them via command line option.<br />
|}<br />
<br />
So you may execute on the remote host:<br />
<br />
DotNetBridgeServer.exe -s -k -a 0.0.0.0<br />
<br />
=Settings=<br />
There are currently no configurable settings.<br />
<br />
=GUI Browser=<br />
The GUI browser is used to explore a running application. You can browse the application, inspect element properties and execute actions. See "[[GUI Browser| Expecco GUI Tests Extension Reference]]" for details.<br />
<br />
=Library=<br />
This article gives a short overview over the design philosophy of the library. You can find more detailed documentation and examples attached to the blocks itself.<br />
<br />
== Connect to Application vs. Connect to Screen ==<br />
You can either "connect to a single application", or "connect to the screen".<br />
The first provides faster access to the components, but will not work, if the app creates subprocesses with a GUI (eg. for dialogs or additional windows). There exist also applications which always create a subprocess, even for the main GUI.<br />
<br />
For such applications, you have to "connect to the screen", and provide an additional window-reference in the XPath locator.<br />
<br>You must also use a screen connection, if your test contains interactions between multiple top-level windows, for example a drag&drop between windows.<br />
<br />
== Connecting to an Application ==<br />
To automate an application, you first have to connect to it or to its screen. You can do this with the<br />
blocks from the "''Connecting''" group.<br />
[[Bild:WindowsAutomation2_Library_ConnectingBlocks.PNG|frame|The Library's Connection Blocks (old picture without screen connection blocks).]]<br />
<br />
You can connect to an individual application by its ''executable name'', or by its ''process id''. <br />
If you use the executable name, expecco will attach to the main process of the specified executable.<br />
Be careful as this is not necessarily the process drawing the GUI! <br />
Use the process id if an application spawns more than one process and you need to make sure you connect to the GUI process and not some background process.<br />
<br />
All connection blocks also require you to specify a ''name'' by which the connection should be known in future.<br />
This is needed when you automate multiple applications at the same time and need to change<br />
''connection contexts'' during test execution.<br />
Please note that the application to connect to has to be started before the corresponding connection block is executed.<br />
You can change in context of which connection a block is executed with the [''Set Active Connection''] block.<br />
This allows you, for example, to automate and compare the state of applications running on multiple systems in one test case.<br />
<br />
=== Establishing a Local Connection === <br />
To automate an application running on the same host as expecco, there is no need to set up anything. <br />
Use "[''Create Local Connection'']" with the above mentioned parameters.<br />
<br />
=== Establishing a Remote Connection ===<br />
Make sure that the DotNet-Bridge server ("<code>DotNetBridgeServer.exe</code>") is running on the remote system, as explained in the chapter [[#Preparing a remote system for test execuction|"''Preparing a remote system for test execuction''"]]<br />
When the bridge is running, you can connect to it with the "[''Create Remote Connection'']" block using the hostname and IP-Address you specified when you started the bridge.<br />
<br />
Notice, that the DotNet-Bridge server only accepts local connections by default.<br />
This is done for security reasons. Use the "-a x.x.x.x" command line argument to specify, which hosts are allowed<br />
to connect. With "-a 0.0.0.0", any host is allowed. Do NOT use this, if the remote host is reachable from untrusted hosts.<br />
<br />
=== Closing a Connection ===<br />
Remember to always close a connection when it is no longer needed, as it otherwise needlessly consumes resources.<br />
One simple way to do this is to setup your connection in the "''Before Execution''" (pre-action) part of the test suite or test case,<br />
and put the "[''Close All Connections'']" action block in the "''After exeuction''" (post-action) part.<br />
<br />
<br clear=all><br />
<br />
== Accessing GUI Elements ==<br />
[[Bild:WindowsAutomation_Library_AccessBlocks.PNG|frame|The Library's GUI Element Access Blocks.]]<br />
[[Bild:WindowsAutomation_Library_AccessBlocksExamples.PNG|frame|A Few Examples on How to Access Elements in Notepad.]]<br />
[[Bild:WindowsAutomation_Library_AccessBlocksModes.PNG|frame|Different Ways to Reference a GUI Element.]]<br />
All Windows applications are built as a '' tree'' of '' GUI elements''.<br />
Some elements act as container of other element - their children. Tables, for example, are containers<br />
for their cell elements which themselves might contain text labels.<br />
At the root of the tree are one or more ''windows'' . When you connect to an application, you get access to<br />
all windows at the tree's root.<br />
To manipulate any of the system under test's GUI element, you first have to gain access to it.<br />
The group named "''GUI Element Access''" provides action blocks to access elements. The actions are further categorized into sub-groups named "'' Access By XPath''" , "''Access By Property''", "''Existence Test''" etc. <br />
For each category, blocks with the same interface exist. The only difference is the method of retrieval.<br />
<br />
;Get GUI Element : returns a ''single'' GUI element matching the search condition. If multiple elements match the condition, an ''arbitrary'' element matching the condition is returned.<br />
:To make sure that there is only one single element matching, set ''ensureExclusive'' to true. You can also enforce this globally by setting the environment variable "''ensureExclusive''" in your environment. <br />
:If ensureExclusive is set and more than one element is found, the block will fail and notify about the ambiguity. This is disabled by default, as checking for uniqueness is a very costly (ie. slow) operation.<br />
:You can also specify a ''timeout'' after which the search is aborted. This is useful if you know an element should be there already (or soon but might currently be loading).<br />
<br />
;Get GUI Elements: returns ''all'' GUI elements matching the search condition. If no element is found, it returns an empty list ''Timeout'' and ''cacheXPath'' are also applicable.<br />
<br />
;Exists: Works exactly the same as ''Get GUI Element'' but does not fail if no element is found. Additionally provides an output pin specifying if an element has been found.<br />
<br />
Both of these blocks are also available in the "''Relative To Anchor''" variety. Those blocks also take a GUI Element as ''anchor'' in relation to which they search. <br />
<br />
<br />
=== Using XPaths ===<br />
<br />
'''XPath''' is the query language used to select GUI elements in the application's element tree.<br />
You can find the XPath of an element with the [[Expecco GUI Tests Extension Reference/en|Gui Browser]] or with third-party applications like "Inspect.exe" [https://msdn.microsoft.com/en-us/library/dd318521(v=vs.85).aspx] or "FlaUInspect" [https://github.com/FlauTech/FlaUInspect].<br />
<br>As an example, the full ''XPath'' of the scroll button on the <br />
vertical scrollbar in the german Windows "Notepad.exe" application looks like this:<br />
<br />
<code>/Window[@Name='Unbenannt - Editor']/Document[@Name='Text-Editor']/ScrollBar[@Name='Vertikale Bildlaufleiste']/Button[@Name='Bildlauf nach unten'] </code><br />
<br />
For each level in the GUI tree, a new ''Location Step'' containing the child element's ''Control Type'' was added in the above XPath.<br />
<br>You do not have to use any predicates, the following XPath is valid as well:<br />
<br />
<code>/Window/Document/ScrollBar/Button </code><br />
<br />
but might lead to issues if multiple GUI Elements match this path.<br />
<br />
You can select by three predicates (which can be mixed and matched in the same query):<br />
<br />
; Name: the name the application developer has given an element. Be careful as this name might change during programm execution (See for example Notepad's window name which always begins with the name of the currently opened file).<br />
: <code>/Window[@Name='Unbenannt - Editor'] </code> <br />
<br />
; AutomationId: An ID the application developer has given an element. It is meant to be unique between siblings but that is not enforced on lazy or incompetent programmers.<br />
: Many lazy developers leave the ID empty or reuse it, making it useless.<br />
: You should use this ID wherever applicable as it is static and meant for this exact purpose.<br />
: <code>/Window/Document[@AutomationId='15'] </code> <br />
<br />
;List Index: If there are multiple siblings with the same Control Type, you can select one of them by (1-based) list index.<br />
: <code>/Window[1]/Document[1] </code><br />
: <code>/Window[1]/Document[last()] </code> <br />
<br />
=== Warning there are XPath Limitations ===<br />
'''Please Note''': You can ONLY use the three predicates above in your XPaths.<br />
<br>Other predicates '''DO NOT''' work! <br />
<br>To search for an element by another property (e.g. its help text), use the '''By Property''' variant of the block instead. <br />
If the property is not unique, you can select a unique ancestor of the target by property or XPath relative to which the property is unique.<br />
You can then use that ancestor as anchor in the [''Get GUI Element By Property (Relative to Anchor)''] block.<br />
<br />
=== Using Wildcards in XPaths ===<br />
<br />
XPath also supports '''wildcards'''. You can:<br />
* replace '''one tree level''' with a "*" wildcard: <br />
: <code>/Window/Document[@AutomationId='15']/*/Button[1]</code> <br /><br />
: <code>/*/*/*/Button[1] </code> <br />
<br />
* replace a '''control type''' with a "*" wildcard:<br />
: <code>/Window/*[@AutomationId='15'] </code> <br />
<br />
* replace '''an arbitrary amount of levels''' with a "//" wildcard:<br />
: <code>//Button </code> <br /><br />
: <code>/Window//Button[1] </code><br />
<br />
Especially the last option is useful as it makes your tests more readable, in that the reader can easily focus on the relevant parts of the xpath.<br />
<br />
But be careful: using wildcards comes at a steep performance cost (due to the implementation inside the Windows API). <br />
If your test runs unacceptably slow, first try to remove wildcards where they are not needed.<br />
<br />
=== Using Properties===<br />
<br />
You can also search for elements by property; i.e. by specifying a value an element's property with the given name must have. <br />
<br />
For a list of properties a GUI element might have, take a look at Microsoft's documentation [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces].<br />
<br />
=== XPath Resolution in Action Blocks ===<br />
<br />
Xpath resolution may be slow in the Windows Automation API, depending on the number of windows/elements which have to be checked.<br />
<br />
To speed up test execution, you should reuse a resolved XPath if possible.<br />
For this, use the "Get Element by XPath" action, and feed the "element handle" to multiple actions.<br />
All action- and property access blocks can take either an XPath or an element handle as locator input.<br />
<br />
The image on the right shows this mode in action. Variants 1 and 2 are functionally equivalent.<br />
While Variant 2 is more concise, Variant 1 is the right choice in most cases. While it has an additional block, you have control over the other input parameters. <br />
You also can recycle the GUI element reference as seen in 3). This is invaluable as the XPath only has to be resolved once. This speeds up test execution by a lot as XPath resolution is very expensive operation.<br />
<br />
'''Rule of thumb''': Always use Variant 1 except if you need the reference to the GUI element only once, or if the application replaces the element dynamically.<br />
<br />
=== Separating Path Definitions ===<br />
<br />
It is highly recommended to add definitions for element-lathes into an environment (typically the project environment), and use "Environment Value" references as input to the steps. This gives two benefits:<br />
<br />
* the paths are hidden and the values at the steps become more readable<br />
* your tests are easier to maintain: in case of a changed window layout/structure, only the variable definitions need to be changed at one place.<br />
* you can import those definitions from a CSV or XML file, and thus separate the locators from the actual test suite. In case of changed UI-layout / UI-hierarchy after a revision change of the tested application, all you need is a new excel or xml file containing those definitions. <br />
<br />
If the development team of the application can provide the paths of the UI components in a machine readable form (i.e. CVS/excel or XML file), you may even let expecco read and parse those path definitions at test start time, and let it automatically adapt to any change. <br />
<br />
<br clear=all><br />
<br />
== Interacting with GUI Elements ==<br />
Once you retrieved a GUI element, you can interact with it by making use of the library's blocks located in the groups '''Elements''', '''Patterns''', and '''Properties'''. <br />
Blocks in those categories take a GUI Element (and sometimes additional data) as input and manipulate it or query for its properties in some way.<br />
<br />
[[Bild:WindowsAutomation_Library_ElementsPatternsProperties.png|600px|The Library's Blocks for Interacting With Elements.]]<br />
<br />
<br />
=== The 'Elements' Group ===<br />
<br />
This group contains blocks that are applicable to blocks that only work on GUI elements of a specific type. For a block's detailed description with examples ,<br />
take a look at the block's documentation in expecco.<br />
<br />
Even though not only Checkboxes can be 'checked', the [''Check''] block in the "''Checkbox group''" only works for checkboxes and not e.g. for radio buttons. <br />
Because of this limitation there are not that many blocks targeting specific elements. Most blocks target a specific ''pattern'' instead and are therefore in the "''Patterns''" group.<br />
<br />
=== The 'Patterns' Group ===<br />
<br />
This group contains blocks that are applicable to GUI elements supporting a certain ''pattern''. <br />
Patterns describe how a GUI element ''behaves'' rather than what it ''is''. An element can also support multiple patterns at the same time. <br />
You can find out which patterns an element supports with the [''Get Supported Patterns''] block or by taking a look at Microsoft's documentation about patterns [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview].<br />
<br />
Pattern blocks can therefore be ''re-used'' between GUI elements of different types. <br />
For example, the [''Expand''] block in "''ExpandCollapse pattern''", can be used to expand Comboboxes, Menus, Submenus, or Trees.<br />
<br />
=== The 'Properties' Group ===<br />
<br />
Blocks in the "''Patterns''" and "''Elements''" group already allow you to query the value of properties pertaining to that element or pattern. Blocks in the "''Properties''" group allow you to query both properties which all elements share as well as arbitrary properties. If you try to retrieve a property an element does not support, the block will fail.<br />
<br />
Please note that the [''Get Arbitrary Property''] block can only query for properties that belong to a pattern. You cannot, for example, query "Text" from a textfield as this is not a property, use "Value" of the value pattern instead. Microsoft's documentation has a list of patterns and the properties they provide [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]<br />
<br />
<br clear=all><br />
<br />
== Automating Keyboard and Mouse ==<br />
[[Bild:WindowsAutomation_Library_KeyboardMouse.png|400px|The Library's Blocks for Interacting With Keyboard and Mouse.]]<br />
<br />
You can control keyboard and mouse with action blocks in the "''Keyboard''" and "''Mouse''" groups, as shown on the right. In contrast to the blocks above, which work in context of a GUI element, the keyboard and mouse blocks work on a global level. You therefore do not need to provide a GUI element when using them. <br />
<br />
You might want to execute some blocks in context of a GUI elemenet nontheless (e.g. enter a number into a text field instead of just pressing keys while the application is running). You can achieve this by selecting the element with the mouse beforehand as you would do when using the application normally (use the [''Left/Double/Right Click On Element''] blocks for this).<br />
If you do not want to wait for the mouse to move, you can also use the [''Set Focus''] block instead.<br />
<br />
=== Keyboard ===<br />
The plugin provides blocks to interact with the keyboard on different abstraction levels. The most versatile block is [''Type With Control Keys Pressed''] where you can specify a string of characters to be typed while any number of control keys (e.g. "esc", "alt", "shift", "ctrl", ...) are held down. All other blocks are specializations of this block.<br />
<br />
[''Press Control Keys''] e.g. allows you to enter key commands such as renaming files ("ALT+F2"), starting the task manager ("CTRL+ALT+DEL"), or closing a window ("ALT+F4"). [''Press Control Key''] makes it easy to just press a single key (e.g. "RETURN" to start a new line in an edit box). The "''Shortcuts''" group provides an assorted collection of often used key combinations for your convenience.<br />
<br />
Use the [''Type''] action to just type some text, or if you just need some throwaway demo text, use [''Type Random Phrase''].<br />
<br />
If you need more fine grained control over the keyboard, you can make use of ''Scan Codes''. The keyboard sends a scan code to the operating system whenever a key is pressed or released. <br />
Microsoft provides a list of the scan codes it supports [https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-6.0/aa299374(v=vs.60)].<br />
[''Press Key By Scan Code''] sends a signal to Windows that a key with a given scan code has been pressed (and is held down). The matching [''Release Key By Scan Code''] sends Windows the adverse signal.<br />
Please note that a key that is pressed, stays pressed until it is explicitly released. If you want to just press and release a key by scan code, use [''Type Key By Scan Code''].<br />
<br />
=== Mouse ===<br />
The plugin provides blocks manipulating the mouse in three ways: ''Clicking'', ''Moving'', and interacting with its ''Buttons''.<br />
<br />
<br />
<br clear=all><br />
<br />
== Recording and Taking Screenshots ==<br />
<br />
= Frequently Asked Questions =<br />
<br />
== What is the difference between Click/Invoke/Select/Toggle? ==<br />
<br />
== My element supports a certain pattern but blocks of that pattern don't work? ==<br />
<br />
== I have designed custom elements, how can I automate them? ==<br />
<br />
== I have extended my GUI elements to have custom properties, how can I query them? ==<br />
<br />
== Hotkey "Get hovered element" selects the wrong element in the tree ==<br />
<br />
Sometimes there are elements which overlap or hide other elements. This element is then selected in the tree. In this case, you can use the Hotkey "Get focused element" to select the element in the tree<br />
<br />
== DevExpress controls are not vissible in the GUI Browser ==<br />
<br />
DevExpress has some possibilities to disable UIAutomation support, which is also used by expecco.If you can't see one or some controls, please check e.g. https://supportcenter.devexpress.com/ticket/details/bc4069/devexpress-controls-now-clear-ui-automation-peers-for-the-application and other information on the DevExpress Support Site.</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=WindowsAutomation_Reference_2.0/en&diff=18901WindowsAutomation Reference 2.0/en2020-02-11T09:12:24Z<p>Mb: </p>
<hr />
<div>This is the documentation for the Windows Automation 2.0 plugin.<br />
It provides facilities to automate tests incorporating applications with a GUI based on Windows Presentation Foundation (WPF), WinForms, and the old Win32 API.<br />
<br />
Notice:<br>The vsn2 replaces the previous vsn1 plugin, which is no longer maintained.<br />
The change was necessary due to changes in the Windows operating system, and features which were discontinued by Microsoft.<br />
The vsn2 plugin uses Microsoft's UI-Automation2 API to interact with the application.<br />
This API was not avaliable in Windows-XP, Vista and other older OS versions, and many features used by the previous version are no longer supported in newer OS versions, or need different parameters. <br />
<br />
=Features=<br />
*Automated GUI testing of WPF, WinForms, and Win32 applications.<br />
*Contains an expecco block library and tools which help to model tests and inspect the GUI of the application.<br />
*Parallel remote test-execution on multiple systems.<br />
*Performs tests against already built executables. No source code changes / recompilation of the application is required.<br />
*Access to GUI components using XPath locators.<br />
*Access objects of the application live at execution time.<br />
*Full access to keyboard and mouse of the target system.<br />
*Lots of additional features such as screen capturing, taking screenshots, highlighting GUI elements, mouse tracking, ...<br />
<br />
= Known issues in the current Release 19.1.0 =<br />
* The WindowsAutomation2.ets library has got a new functional id. When reimporting the library in existing Pre-19.1.0 test suites (which is mandatory), a warning about a changed functional id is shown once. It is ok to accept this dialog.<br />
* Instant follow mouse is very expensive in Windows and is therefore disabled. Use ''HotKeys'' to select a GUI element in the tree at the current pointer position or to update the element tree. HotKeys can be configured in the settings. The HotKey-service has to be started. Take care that the keys have not already been grabbed by another application. If that is the case, a warning will be shown, and you should either make sure that expecco is started before the other application, or that you use other hotkey combinations (in either expecco or the application).<br />
<br />
=Installation and Connection=<br />
The WindowsAutomation testing plugin uses the expecoo ".NET-Bridge" which consists of two parts: A plugin for expecco, and a server executable using the .NET framework running on the remote computer to connect to.<br />
<br />
==Requirements==<br />
On the machine running the system under test:<br />
*.NET Framework 4.6.2 [https://www.microsoft.com/net/download/all] or higher.<br />
* One of the following operation systems:<br />
::- Windows 7 SP1<br />
::- Windows 8<br />
::- Windows 8.1<br />
::- Windows 10<br />
<br />
::- Windows Server 2008 R2 SP1<br />
::- Windows Server 2012<br />
::- Windows Server 2012 R2<br />
::- Windows Server 2016<br />
::- Windows Server, version 1709<br />
<br />
==Plugin Components==<br />
The plugin consists of the following parts:<br />
* The [[GUI Browser]], used to interactively explore your application.<br />
* The Windows Automation Library, which provides blocks that you can use in your test cases.<br />
* The .NET-Bridge server, which provides an interface between the application under test and expecco.<br />
<br />
==Installing and Configuring the Plugin in Expecco==<br />
The plugin is usually installed automatically by the installer; either included in the main expecco installation or provided as a separate installable add-on package. Its files are stored in the "<code>plugin</code>" subfolder of the expecco installation folder. You can also copy those files manually to that folder, if required. Expecco detects the plugin automatically during startup. You may have to restart your expecco session, if the plugin is installed later.<br />
<br />
==Preparing a local system for test execution==<br />
To automate applications running on the SAME host as expecco, there is no need to set up anything - it should work out of the box.<br />
<br />
Try to connect to an application via the GUIBrowser's ''WindowsAutomation''-connect dialog:<br />
<br />
[[Datei:WindowsAutomation2Connect.png]]<br />
<br />
==Preparing a remote system for test execuction==<br />
<br />
===Security Considerations===<br />
Please make sure, that remote access is only possible from inside a secure local network.<br />
Under no circumstances should you grant access to the DotNetBridgeServer from untrusted hosts.<br />
<br />
===DotNet Bridge Server===<br />
<br />
The remote system has to run the "''.Net-Bridge server''" which in turn either actively connects to expecco or passively waits for an incoming connection from expecco.<br />
<br />
For this, copy "<code>DotNetBridgeServer.exe</code>" (in the "<code>packages/exept/bridgeFramework/dotNetBridge/dotNetBin</code>" folder under the expecco installation directory) to the computer where your system under test is running (you can copy it into any folder). No further installation is needed.<br />
<br />
To start the bridge, navigate to the executable in a shell/cmd/console and start it with the following arguments<br />
("<code>DotNetBridgeServer.exe --help</code>" outputs a list of valid options):<br />
{| class="wikitable"<br />
|-<br />
! Arguments !! Required !! Description<br />
|-<br />
| -s || Yes || "''server mode''". Tells the executable to run in server mode (it will wait for expecco to connect to it, as opposed to client mode,<br>where it actively connects to the partner).<br />
|-<br />
| -k || Yes || "''keepalive''". Tells the client to keep the connection open after a connection has been terminated.<br>This saves you the hassle to restart it every time a test finishes.<br />
|-<br />
| -a&nbsp;<ip/hostname>|| Yes || "''accepted hosts''". The IP-address or hostname from which it will accept connections (in server mode) or to which it connects.<br>To ensure that in slave mode no other machine connects to the server, set this to the IP of the machine your expecco is running on.<br>To allow any machine (i.e. to have it listen on any IP-address), set it to 0.0.0.0. Allowing any host should only be done, if you are inside a secure network.<br />
|-<br />
| -p <int> || No || "''port''". The port the server should listen on (in server mode) or to which is should connect (default is 34318).<br />
|-<br />
| -L <string> || No || "''assembly''". Load a .NET assembly on startup. Omit the .dll extension (so use "WindowsAutomation" but not "WindowsAutomation.dll").<br>You can repeat this option to load multiple assemblies. <br />
Note: this is not normally needed, as expecco loads the required assemblies automatically into the bridge.<br>However, if security settings forbid external assemblies, you have to copy them to the target machine, and load them via command line option.<br />
|}<br />
<br />
So you may execute on the remote host:<br />
<br />
DotNetBridgeServer.exe -s -k -a 0.0.0.0<br />
<br />
=Settings=<br />
There are currently no configurable settings.<br />
<br />
=GUI Browser=<br />
The GUI browser is used to explore a running application. You can browse the application, inspect element properties and execute actions. See "[[GUI Browser| Expecco GUI Tests Extension Reference]]" for details.<br />
<br />
=Library=<br />
This article gives a short overview over the design philosophy of the library. You can find more detailed documentation and examples attached to the blocks itself.<br />
<br />
== Connect to Application vs. Connect to Screen ==<br />
You can either "connect to a single application", or "connect to the screen".<br />
The first provides faster access to the components, but will not work, if the app creates subprocesses with a GUI (eg. for dialogs or additional windows). There exist also applications which always create a subprocess, even for the main GUI.<br />
<br />
For such applications, you have to "connect to the screen", and provide an additional window-reference in the XPath locator.<br />
<br>You must also use a screen connection, if your test contains interactions between multiple top-level windows, for example a drag&drop between windows.<br />
<br />
== Connecting to an Application ==<br />
To automate an application, you first have to connect to it or to its screen. You can do this with the<br />
blocks from the "''Connecting''" group.<br />
[[Bild:WindowsAutomation2_Library_ConnectingBlocks.PNG|frame|The Library's Connection Blocks (old picture without screen connection blocks).]]<br />
<br />
You can connect to an individual application by its ''executable name'', or by its ''process id''. <br />
If you use the executable name, expecco will attach to the main process of the specified executable.<br />
Be careful as this is not necessarily the process drawing the GUI! <br />
Use the process id if an application spawns more than one process and you need to make sure you connect to the GUI process and not some background process.<br />
<br />
All connection blocks also require you to specify a ''name'' by which the connection should be known in future.<br />
This is needed when you automate multiple applications at the same time and need to change<br />
''connection contexts'' during test execution.<br />
Please note that the application to connect to has to be started before the corresponding connection block is executed.<br />
You can change in context of which connection a block is executed with the [''Set Active Connection''] block.<br />
This allows you, for example, to automate and compare the state of applications running on multiple systems in one test case.<br />
<br />
=== Establishing a Local Connection === <br />
To automate an application running on the same host as expecco, there is no need to set up anything. <br />
Use "[''Create Local Connection'']" with the above mentioned parameters.<br />
<br />
=== Establishing a Remote Connection ===<br />
Make sure that the DotNet-Bridge server ("<code>DotNetBridgeServer.exe</code>") is running on the remote system, as explained in the chapter [[#Preparing a remote system for test execuction|"''Preparing a remote system for test execuction''"]]<br />
When the bridge is running, you can connect to it with the "[''Create Remote Connection'']" block using the hostname and IP-Address you specified when you started the bridge.<br />
<br />
Notice, that the DotNet-Bridge server only accepts local connections by default.<br />
This is done for security reasons. Use the "-a x.x.x.x" command line argument to specify, which hosts are allowed<br />
to connect. With "-a 0.0.0.0", any host is allowed. Do NOT use this, if the remote host is reachable from untrusted hosts.<br />
<br />
=== Closing a Connection ===<br />
Remember to always close a connection when it is no longer needed, as it otherwise needlessly consumes resources.<br />
One simple way to do this is to setup your connection in the "''Before Execution''" (pre-action) part of the test suite or test case,<br />
and put the "[''Close All Connections'']" action block in the "''After exeuction''" (post-action) part.<br />
<br />
<br clear=all><br />
<br />
== Accessing GUI Elements ==<br />
[[Bild:WindowsAutomation_Library_AccessBlocks.PNG|frame|The Library's GUI Element Access Blocks.]]<br />
[[Bild:WindowsAutomation_Library_AccessBlocksExamples.PNG|frame|A Few Examples on How to Access Elements in Notepad.]]<br />
[[Bild:WindowsAutomation_Library_AccessBlocksModes.PNG|frame|Different Ways to Reference a GUI Element.]]<br />
All Windows applications are built as a '' tree'' of '' GUI elements''.<br />
Some elements act as container of other element - their children. Tables, for example, are containers<br />
for their cell elements which themselves might contain text labels.<br />
At the root of the tree are one or more ''windows'' . When you connect to an application, you get access to<br />
all windows at the tree's root.<br />
To manipulate any of the system under test's GUI element, you first have to gain access to it.<br />
The group named "''GUI Element Access''" provides action blocks to access elements. The actions are further categorized into sub-groups named "'' Access By XPath''" , "''Access By Property''", "''Existence Test''" etc. <br />
For each category, blocks with the same interface exist. The only difference is the method of retrieval.<br />
<br />
;Get GUI Element : returns a ''single'' GUI element matching the search condition. If multiple elements match the condition, an ''arbitrary'' element matching the condition is returned.<br />
:To make sure that there is only one single element matching, set ''ensureExclusive'' to true. You can also enforce this globally by setting the environment variable "''ensureExclusive''" in your environment. <br />
:If ensureExclusive is set and more than one element is found, the block will fail and notify about the ambiguity. This is disabled by default, as checking for uniqueness is a very costly (ie. slow) operation.<br />
:You can also specify a ''timeout'' after which the search is aborted. This is useful if you know an element should be there already (or soon but might currently be loading).<br />
<br />
;Get GUI Elements: returns ''all'' GUI elements matching the search condition. If no element is found, it returns an empty list ''Timeout'' and ''cacheXPath'' are also applicable.<br />
<br />
;Exists: Works exactly the same as ''Get GUI Element'' but does not fail if no element is found. Additionally provides an output pin specifying if an element has been found.<br />
<br />
Both of these blocks are also available in the "''Relative To Anchor''" variety. Those blocks also take a GUI Element as ''anchor'' in relation to which they search. <br />
<br />
<br />
=== Using XPaths ===<br />
<br />
'''XPath''' is the query language used to select GUI elements in the application's element tree.<br />
You can find the XPath of an element with the [[Expecco GUI Tests Extension Reference/en|Gui Browser]] or with third-party applications like "Inspect.exe" [https://msdn.microsoft.com/en-us/library/dd318521(v=vs.85).aspx] or "FlaUInspect" [https://github.com/FlauTech/FlaUInspect].<br />
<br>As an example, the full ''XPath'' of the scroll button on the <br />
vertical scrollbar in the german Windows "Notepad.exe" application looks like this:<br />
<br />
<code>/Window[@Name='Unbenannt - Editor']/Document[@Name='Text-Editor']/ScrollBar[@Name='Vertikale Bildlaufleiste']/Button[@Name='Bildlauf nach unten'] </code><br />
<br />
For each level in the GUI tree, a new ''Location Step'' containing the child element's ''Control Type'' was added in the above XPath.<br />
<br>You do not have to use any predicates, the following XPath is valid as well:<br />
<br />
<code>/Window/Document/ScrollBar/Button </code><br />
<br />
but might lead to issues if multiple GUI Elements match this path.<br />
<br />
You can select by three predicates (which can be mixed and matched in the same query):<br />
<br />
; Name: the name the application developer has given an element. Be careful as this name might change during programm execution (See for example Notepad's window name which always begins with the name of the currently opened file).<br />
: <code>/Window[@Name='Unbenannt - Editor'] </code> <br />
<br />
; AutomationId: An ID the application developer has given an element. It is meant to be unique between siblings but that is not enforced on lazy or incompetent programmers.<br />
: Many lazy developers leave the ID empty or reuse it, making it useless.<br />
: You should use this ID wherever applicable as it is static and meant for this exact purpose.<br />
: <code>/Window/Document[@AutomationId='15'] </code> <br />
<br />
;List Index: If there are multiple siblings with the same Control Type, you can select one of them by (1-based) list index.<br />
: <code>/Window[1]/Document[1] </code><br />
: <code>/Window[1]/Document[last()] </code> <br />
<br />
=== Warning there are XPath Limitations ===<br />
'''Please Note''': You can ONLY use the three predicates above in your XPaths.<br />
<br>Other predicates '''DO NOT''' work! <br />
<br>To search for an element by another property (e.g. its help text), use the '''By Property''' variant of the block instead. <br />
If the property is not unique, you can select a unique ancestor of the target by property or XPath relative to which the property is unique.<br />
You can then use that ancestor as anchor in the [''Get GUI Element By Property (Relative to Anchor)''] block.<br />
<br />
=== Using Wildcards in XPaths ===<br />
<br />
XPath also supports '''wildcards'''. You can:<br />
* replace '''one tree level''' with a "*" wildcard: <br />
: <code>/Window/Document[@AutomationId='15']/*/Button[1]</code> <br /><br />
: <code>/*/*/*/Button[1] </code> <br />
<br />
* replace a '''control type''' with a "*" wildcard:<br />
: <code>/Window/*[@AutomationId='15'] </code> <br />
<br />
* replace '''an arbitrary amount of levels''' with a "//" wildcard:<br />
: <code>//Button </code> <br /><br />
: <code>/Window//Button[1] </code><br />
<br />
Especially the last option is useful as it makes your tests more readable, in that the reader can easily focus on the relevant parts of the xpath.<br />
<br />
But be careful: using wildcards comes at a steep performance cost (due to the implementation inside the Windows API). <br />
If your test runs unacceptably slow, first try to remove wildcards where they are not needed.<br />
<br />
=== Using Properties===<br />
<br />
You can also search for elements by property; i.e. by specifying a value an element's property with the given name must have. <br />
<br />
For a list of properties a GUI element might have, take a look at Microsoft's documentation [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces].<br />
<br />
=== XPath Resolution in Action Blocks ===<br />
<br />
Xpath resolution may be slow in the Windows Automation API, depending on the number of windows/elements which have to be checked.<br />
<br />
To speed up test execution, you should reuse a resolved XPath if possible.<br />
For this, use the "Get Element by XPath" action, and feed the "element handle" to multiple actions.<br />
All action- and property access blocks can take either an XPath or an element handle as locator input.<br />
<br />
The image on the right shows this mode in action. Variants 1 and 2 are functionally equivalent.<br />
While Variant 2 is more concise, Variant 1 is the right choice in most cases. While it has an additional block, you have control over the other input parameters. <br />
You also can recycle the GUI element reference as seen in 3). This is invaluable as the XPath only has to be resolved once. This speeds up test execution by a lot as XPath resolution is very expensive operation.<br />
<br />
'''Rule of thumb''': Always use Variant 1 except if you need the reference to the GUI element only once, or if the application replaces the element dynamically.<br />
<br />
=== Separating Path Definitions ===<br />
<br />
It is highly recommended to add definitions for element-lathes into an environment (typically the project environment), and use "Environment Value" references as input to the steps. This gives two benefits:<br />
<br />
* the paths are hidden and the values at the steps become more readable<br />
* your tests are easier to maintain: in case of a changed window layout/structure, only the variable definitions need to be changed at one place.<br />
* you can import those definitions from a CSV or XML file, and thus separate the locators from the actual test suite. In case of changed UI-layout / UI-hierarchy after a revision change of the tested application, all you need is a new excel or xml file containing those definitions. <br />
<br />
If the development team of the application can provide the paths of the UI components in a machine readable form (i.e. CVS/excel or XML file), you may even let expecco read and parse those path definitions at test start time, and let it automatically adapt to any change. <br />
<br />
<br clear=all><br />
<br />
== Interacting with GUI Elements ==<br />
Once you retrieved a GUI element, you can interact with it by making use of the library's blocks located in the groups '''Elements''', '''Patterns''', and '''Properties'''. <br />
Blocks in those categories take a GUI Element (and sometimes additional data) as input and manipulate it or query for its properties in some way.<br />
<br />
[[Bild:WindowsAutomation_Library_ElementsPatternsProperties.png|600px|The Library's Blocks for Interacting With Elements.]]<br />
<br />
<br />
=== The 'Elements' Group ===<br />
<br />
This group contains blocks that are applicable to blocks that only work on GUI elements of a specific type. For a block's detailed description with examples ,<br />
take a look at the block's documentation in expecco.<br />
<br />
Even though not only Checkboxes can be 'checked', the [''Check''] block in the "''Checkbox group''" only works for checkboxes and not e.g. for radio buttons. <br />
Because of this limitation there are not that many blocks targeting specific elements. Most blocks target a specific ''pattern'' instead and are therefore in the "''Patterns''" group.<br />
<br />
=== The 'Patterns' Group ===<br />
<br />
This group contains blocks that are applicable to GUI elements supporting a certain ''pattern''. <br />
Patterns describe how a GUI element ''behaves'' rather than what it ''is''. An element can also support multiple patterns at the same time. <br />
You can find out which patterns an element supports with the [''Get Supported Patterns''] block or by taking a look at Microsoft's documentation about patterns [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview].<br />
<br />
Pattern blocks can therefore be ''re-used'' between GUI elements of different types. <br />
For example, the [''Expand''] block in "''ExpandCollapse pattern''", can be used to expand Comboboxes, Menus, Submenus, or Trees.<br />
<br />
=== The 'Properties' Group ===<br />
<br />
Blocks in the "''Patterns''" and "''Elements''" group already allow you to query the value of properties pertaining to that element or pattern. Blocks in the "''Properties''" group allow you to query both properties which all elements share as well as arbitrary properties. If you try to retrieve a property an element does not support, the block will fail.<br />
<br />
Please note that the [''Get Arbitrary Property''] block can only query for properties that belong to a pattern. You cannot, for example, query "Text" from a textfield as this is not a property, use "Value" of the value pattern instead. Microsoft's documentation has a list of patterns and the properties they provide [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]<br />
<br />
<br clear=all><br />
<br />
== Automating Keyboard and Mouse ==<br />
[[Bild:WindowsAutomation_Library_KeyboardMouse.png|400px|The Library's Blocks for Interacting With Keyboard and Mouse.]]<br />
<br />
You can control keyboard and mouse with action blocks in the "''Keyboard''" and "''Mouse''" groups, as shown on the right. In contrast to the blocks above, which work in context of a GUI element, the keyboard and mouse blocks work on a global level. You therefore do not need to provide a GUI element when using them. <br />
<br />
You might want to execute some blocks in context of a GUI elemenet nontheless (e.g. enter a number into a text field instead of just pressing keys while the application is running). You can achieve this by selecting the element with the mouse beforehand as you would do when using the application normally (use the [''Left/Double/Right Click On Element''] blocks for this).<br />
If you do not want to wait for the mouse to move, you can also use the [''Set Focus''] block instead.<br />
<br />
=== Keyboard ===<br />
The plugin provides blocks to interact with the keyboard on different abstraction levels. The most versatile block is [''Type With Control Keys Pressed''] where you can specify a string of characters to be typed while any number of control keys (e.g. "esc", "alt", "shift", "ctrl", ...) are held down. All other blocks are specializations of this block.<br />
<br />
[''Press Control Keys''] e.g. allows you to enter key commands such as renaming files ("ALT+F2"), starting the task manager ("CTRL+ALT+DEL"), or closing a window ("ALT+F4"). [''Press Control Key''] makes it easy to just press a single key (e.g. "RETURN" to start a new line in an edit box). The "''Shortcuts''" group provides an assorted collection of often used key combinations for your convenience.<br />
<br />
Use the [''Type''] action to just type some text, or if you just need some throwaway demo text, use [''Type Random Phrase''].<br />
<br />
If you need more fine grained control over the keyboard, you can make use of ''Scan Codes''. The keyboard sends a scan code to the operating system whenever a key is pressed or released. <br />
Microsoft provides a list of the scan codes it supports [https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-6.0/aa299374(v=vs.60)].<br />
[''Press Key By Scan Code''] sends a signal to Windows that a key with a given scan code has been pressed (and is held down). The matching [''Release Key By Scan Code''] sends Windows the adverse signal.<br />
Please note that a key that is pressed, stays pressed until it is explicitly released. If you want to just press and release a key by scan code, use [''Type Key By Scan Code''].<br />
<br />
=== Mouse ===<br />
The plugin provides blocks manipulating the mouse in three ways: ''Clicking'', ''Moving'', and interacting with its ''Buttons''.<br />
<br />
<br />
<br clear=all><br />
<br />
== Recording and Taking Screenshots ==<br />
<br />
= Frequently Asked Questions =<br />
<br />
== What is the difference between Click/Invoke/Select/Toggle? ==<br />
<br />
== My element supports a certain pattern but blocks of that pattern don't work? ==<br />
<br />
== I have designed custom elements, how can I automate them? ==<br />
<br />
== I have extended my GUI elements to have custom properties, how can I query them? ==<br />
<br />
== Hotkey "Get hovered element" selects the wrong element in the tree ==<br />
<br />
Sometimes there are elements which overlap or hide other elements. This element is then selected in the tree. In this case, you can use the Hotkey "Get focused element" to select the element in the tree<br />
<br />
== DevExpress Controls are not vissible in the GUI Browser ==<br />
<br />
DevExpress has some possibilities to disable UIAutomation support, which is also used by expecco.If you can't see one or some controls, please check e.g. https://supportcenter.devexpress.com/ticket/details/bc4069/devexpress-controls-now-clear-ui-automation-peers-for-the-application and other information on the DevExpress Support Site.</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=WindowsAutomation_Reference_2.0/en&diff=16016WindowsAutomation Reference 2.0/en2019-05-24T13:58:22Z<p>Mb: /* Hotkey "Get hovered element" selects the wrong element in the tree */</p>
<hr />
<div>This is the documentation for the Windows Automation 2.0 plugin.<br />
<br />
It provides facilities to automate tests incorporating applications with a GUI based on Windows Presentation Foundation (WPF), WinForms, and the old Win32 API.<br />
<br />
=Features=<br />
*Automated GUI testing of WPF, WinForms, and Win32 applications.<br />
*Contains an expecco block library and tools which help to model tests and inspect the GUI of the application.<br />
*Parallel remote test-execution on multiple systems.<br />
*Performs tests against already built executables. No source code changes / recompilation of the application is required.<br />
*Access to GUI components using XPath locators.<br />
*Access objects of the application live at execution time.<br />
*Full access to keyboard and mouse of the target system.<br />
*Lots of additional features such as screen capturing, taking screenshots, highlighting GUI elements, mouse tracking, ...<br />
<br />
= Known issues in the current Release (August 2018) =<br />
* The WindowsAutomation2.ets library has got a new functional id. When reimporting the library in existing test suites (which is mandatory), a warning about a changed functional id is shown once. It is ok to accept this dialog.<br />
* Instant follow mouse is very expensive in Windows and is therefore disabled. Use ''HotKeys'' to select a GUI element in the tree at the current pointer position or to update the element tree. HotKeys can be configured in the settings. The HotKey-service has to be started. Take care that the keys have not already been grabbed by another application. If that is the case, a warning will be shown, and you should either make sure that expecco is started before the other application, or that you use other hotkey combinations (in either expecco or the application). <br />
* Recording is still in Beta State. Recording of Button clicks and Keystrokes work well.<br />
* ContextMenus cannot be recorded in the current version (but replay is possible).<br />
* When doing a click the first submenu entry of the first pulldown menu, a wrong element is clicked. All other menu entries are correctly selected. To get it working you can "Invoke" the submenu entry instead of using "Click on Element"<br />
<br />
=Installation and Connection=<br />
The WindowsAutomation testing plugin uses the expecoo ".NET-Bridge" which consists of two parts: A plugin for expecco, and a server executable using the .NET framework running on the remote computer to connect to.<br />
<br />
==Requirements==<br />
On the machine running the system under test:<br />
*.NET Framework 4.6.2 [https://www.microsoft.com/net/download/all] or higher.<br />
* One of the following operation systems:<br />
::- Windows 7 SP1<br />
::- Windows 8<br />
::- Windows 8.1<br />
::- Windows 10<br />
<br />
::- Windows Server 2008 R2 SP1<br />
::- Windows Server 2012<br />
::- Windows Server 2012 R2<br />
::- Windows Server 2016<br />
::- Windows Server, version 1709<br />
<br />
==Plugin Components==<br />
The plugin consists of the following parts:<br />
* The GUI Browser, used to interactively explore your application.<br />
* The Windows Automation Library, which provides blocks that you can use in your test cases.<br />
* The .NET-Bridge server, which provides an interface between the application under test and your tests running in expecco.<br />
<br />
==Installing and Configuring the Plugin in Expecco==<br />
The plugin is usually installed automatically by the installer; either included in the main expecco installation or provided as a separate installable add-on package. Its files are stored in the "<code>plugin</code>" subfolder of the expecco installation folder. You can also copy those files manually to that folder, if required. Expecco detects the plugin automatically during startup. You might need to restart your expecco session.<br />
<br />
==Preparing a local system for test execution==<br />
If you want to automate an application running on the same host as expecco, there is no need to set up anything. Everything should work out of the box.<br />
<br />
Try to connect to an application via the GUIBrowser's ''WindowsAutomation''-connect dialog:<br />
<br />
[[Datei:WindowsAutomation2Connect.png]]<br />
<br />
==Preparing a remote system for test execuction==<br />
<br />
===Security Considerations===<br />
Please make sure, that remote access is only possible from inside a secure local network.<br />
Under no circumstances should you grant access to the DotNetBridgeServer from untrusted hosts.<br />
<br />
===DotNet Bridge Server===<br />
<br />
The remote system has to run the "''.Net-Bridge server''" which in turn either actively connects to expecco or passively waits for an incoming connection from expecco.<br />
<br />
For this, copy "<code>DotNetBridgeServer.exe</code>" (in the "<code>packages/exept/bridgeFramework/dotNetBridge/dotNetBin</code>" folder under the expecco installation directory) to the computer where your system under test is running (you can copy it into any folder). No further installation is needed.<br />
<br />
To start the bridge, navigate to the executable in a shell/cmd/console and start it with the following arguments<br />
("DotNetBridgeServer.exe --help" outputs a list of valid options):<br />
{| class="wikitable"<br />
|-<br />
! Arguments !! Required !! Description<br />
|-<br />
| -s || Yes || "''server mode''". Tells the executable to run in server mode (it will wait for expecco to connect to it, as opposed to client mode, where it actively connects to the partner).<br />
|-<br />
| -k || Yes || "''keepalive''". Tells the client to keep the connection open after a connection has been terminated.<br>This saves you the hassle to restart it every time a test finishes.<br />
|-<br />
| -a&nbsp;<ip/hostname>|| Yes || "''accepted hosts''". The IP-address or hostname from which it will accept connections (in server mode) or to which it connects. To ensure that in slave mode no other machine connects to the server, set this to the IP of the machine your expecco is running on. To allow any machine (i.e. to have it listen on any IP-address), set it to 0.0.0.0.<br />
|-<br />
| -p <int> || No || "''port''". The port the server should listen on (in server mode) or to which is should connect (default is 34318).<br />
|}<br />
<br />
So you may execute on the remote host:<br />
<br />
DotNetBridgeServer.exe -s -k -a 0.0.0.0<br />
<br />
=Settings=<br />
There are currently no configurable settings.<br />
<br />
=GUI Browser=<br />
The GUI browser allows you to explore a running application. You can browse the application, inspect element properties and execute actions. For a more detailed description also see [[Expecco GUI Tests Extension Reference|Gui Browser]].<br />
<br />
=Library=<br />
This article gives a short overview over the design philosophy of the library. You can find more detailed documentation and examples attached to the blocks itself.<br />
<br />
== Connecting to an Application ==<br />
To automate an application, you first have to connect to it. You can do this with the<br />
blocks from the "''Connecting''" group.<br />
[[Bild:WindowsAutomation2_Library_ConnectingBlocks.PNG|frame|The Library's Connection Blocks.]]<br />
<br />
You can connect to an application by its ''executable name'', or by its ''process id''. <br />
If you use the executable name, expecco will attach to the main process of the specified executable. Be careful as this is not necessarily the process <br />
drawing the GUI! Use the process id if an application spawns more than one process and you need to make sure you connect to the GUI process and not some background process.<br />
<br />
All connection blocks also require you to specify a ''name'' by which the connection should be known in future.<br />
This is needed when you automate multiple applications at the same time and need to change<br />
''connection contexts'' during test execution.<br />
Please note that the application to connect to has to be started before the corresponding connection block is executed.<br />
You can change in context of which connection a block is executed with the [''Set Active Connection''] block.<br />
This allows you, for example, to automate and compare the state of applications running on multiple systems in one test case.<br />
<br />
=== Establishing a Local Connection === <br />
If you want to automate an application running on the same host as expecco, there is no need to set up anything. <br />
Use the [''Create Local Connection''] with the above mentioned parameters.<br />
<br />
=== Establishing a Remote Connection ===<br />
Make sure that the DotNet-Bridge server (DotNetBridgeServer.exe) is running on the remote system, as explained in the chapter [[#Preparing a remote system for test execuction|"''Preparing a remote system for test execuction''"]]<br />
When the bridge is running, you can connect to it with the [''Create Remote Connection''] block using the hostname and IP-Address you specified when you started the bridge.<br />
<br />
Notice, that the DotNet-Bridge server only accepts local connections by default.<br />
This is done for security reasons. Use the "-a x.x.x.x" command line argument to specify, which hosts are allowed<br />
to connect to the Bridge server. With "-a 0.0.0.0", any host is allowed. Do NOT use this, if the remote host is reachable from untrusted hosts.<br />
<br />
=== Closing a Connection ===<br />
Remember to always close a connection when it is no longer needed, as it otherwise needlessly consumes resources.<br />
One simple way to do this is to setup your connections in the ''Before Execution'' (pre-action) part of the test suite or test case,<br />
and put the [''Close All Connections''] block in the ''After exeuction'' (post-action) part.<br />
<br />
<br clear=all><br />
<br />
== Accessing GUI Elements ==<br />
[[Bild:WindowsAutomation_Library_AccessBlocks.PNG|frame|The Library's GUI Element Access Blocks.]]<br />
[[Bild:WindowsAutomation_Library_AccessBlocksExamples.PNG|frame|A Few Examples on How to Access Elements in Notepad.]]<br />
[[Bild:WindowsAutomation_Library_AccessBlocksModes.PNG|frame|Different Ways to Reference a GUI Element.]]<br />
All Windows applications are built as a '' tree'' of '' GUI elements''.<br />
Some elements act as container of other element - their children. Tables, for example, are containers<br />
for their cell elements which themselves might contain text labels.<br />
At the root of the tree are one or more ''windows'' . When you connect to an application, you get access to<br />
all windows at the tree's root.<br />
To manipulate any of the system under test's GUI element, you first have to gain access to it.<br />
The group named "''GUI Element Access''" provides action blocks to access elements. The actions are further categorized into sub-groups named "'' Access By XPath''" , "''Access By Property''", "''Existence Test''" etc. <br />
For each category, blocks with the same interface exist. The only difference is the method of retrieval.<br />
<br />
;Get GUI Element : returns a ''single'' GUI element matching the search condition. If multiple elements match the condition, an ''arbitrary'' element matching the condition is returned.<br />
:To make sure that there is only one single element matching, set ''ensureExclusive'' to true. You can also enforce this globally by setting the environment variable "''ensureExclusive''" in your environment. <br />
:If ensureExclusive is set and more than one element is found, the block will fail and notify about the ambiguity. This is disabled by default, as checking for uniqueness is a very costly (ie. slow) operation.<br />
:You can also specify a ''timeout'' after which the search is aborted. This is useful if you know an element should be there already (or soon but might currently be loading).<br />
<br />
;Get GUI Elements: returns ''all'' GUI elements matching the search condition. If no element is found, it returns an empty list ''Timeout'' and ''cacheXPath'' are also applicable.<br />
<br />
;Exists: Works exactly the same as ''Get GUI Element'' but does not fail if no element is found. Additionally provides an output pin specifying if an element has been found.<br />
<br />
Both of these blocks are also available in the "''Relative To Anchor''" variety. Those blocks also take a GUI Element as ''anchor'' in relation to which they search. <br />
<br />
<br />
=== Using XPaths ===<br />
<br />
'''XPath''' is the query language used for selecting GUI elements in the application's element tree.<br />
You can find the XPath of an element with the [[Expecco GUI Tests Extension Reference/en|Gui Browser]] or with third-party applications like "Inspect.exe" [https://msdn.microsoft.com/en-us/library/dd318521(v=vs.85).aspx] or FlaUInspect [https://github.com/FlauTech/FlaUInspect].<br />
As an example, the ''XPath'' of the scroll button on the <br />
vertical scrollbar in the German Windows Notepad.exe application looks like this:<br />
<br />
<code>/Window[@Name='Unbenannt - Editor']/Document[@Name='Text-Editor']/ScrollBar[@Name='Vertikale Bildlaufleiste']/Button[@Name='Bildlauf nach unten'] </code><br />
<br />
For each level in the GUI tree, a new ''Location Step'' containing the child elements ''Control Type'' has to be added.<br />
You do not have to use any predicates, the following XPath is valid as well:<br />
<br />
<code>/Window/Document/ScrollBar/Button </code><br />
<br />
but might lead to issues as there might be multiple GUI Elements matching this path.<br />
You can select by three predicates that can be mixed and matched in the same query:<br />
<br />
; Name: the name the application developer has given an element. Be careful as this name might change during programm execution (See for example Notepad's window name which always begins with the name of the currently opened file.<br />
: <code>/Window[@Name='Unbenannt - Editor'] </code> <br />
<br />
; AutomationId: An ID the application developer has given an element. It is meant to be unique between siblings but that is not enforced on lazy or incompetent programmers.<br />
: Many lazy developers leave the ID empty or reuse it, making it useless. You should nontheless use this ID wherever applicable as it is static<br />
: and meant for this exact purpose.<br />
: <code>/Window/Document[@AutomationId='15'] </code> <br />
<br />
;List Index: If there are multiple siblings with the same Control Type, you can select one of them by (1-based) list index.<br />
: <code>/Window[1]/Document[1] </code><br />
: <code>/Window[1]/Document[last()] </code> <br />
<br />
'''Please Note''': You can only use the three predicates above in your XPaths. Other predicates '''DO NOT''' work! If you want to search<br />
an element by another property (e.g. its help text), use the '''By Property''' variant of the block instead. <br />
If the property is not unique, you can select a unique ancestor of the target by property or XPath relative to which the property is unique.<br />
You can then use that ancestor as anchor in the [''Get GUI Element By Property (Relative to Anchor)''] block.<br />
<br />
=== Using Wildcards in XPaths ===<br />
<br />
XPath also supports '''wildcards'''. You can:<br />
* replace '''one tree level''' with a "*" wildcard: <br />
<code>/Window/Document[@AutomationId='15']/*/Button[1]</code> <br /><br />
<code>/*/*/*/Button[1] </code> <br />
<br />
* replace a '''control type''' with a "*" wildcard:<br />
<code>/Window/*[@AutomationId='15'] </code> <br />
<br />
* replace '''an arbitrary amount of levels''' with a "//" wildcard:<br />
<code>//Button </code> <br /><br />
<code>/Window//Button[1] </code><br />
<br />
Especially the last option is useful as it makes your tests more readable as the reader can easily focus on the relevant parts of the xpath.<br />
But be careful. Using wildcards comes at a steep performance cost. If your tests run unacceptably slow, first try to remove wildcards where they are not needed.<br />
<br />
=== Using Properties===<br />
<br />
You can also search for elements by property by specifying a value an element's property with the given name must have. For a list of properties a GUI element might have, take a look at Microsoft's documentation [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]. It specifies the supported properties for each pattern an element can support.<br />
<br />
=== XPath Resolution in Action Blocks ===<br />
<br />
Getting a reference to the GUI Element everytime you need to manipulate it in any way can make for very unclean looking test suites as two blocks are needed to perform any action - one for getting a reference to the element and another one for perform the action. The library therefore also allows you to directly feed an xpath into every block that would take a reference to a GUI Element.<br />
<br />
The image on the right shows this mode in action. Variants 1 and 2 are functionally equivalent.<br />
While Variant 2 is more concise, Variant 1 is the right choice in most cases. While it has an additional block, you have control over the other input parameters. <br />
You also can recycle the GUI element reference as seen in 3). This is invaluable as the XPath only has to be resolved once. This speeds up test execution by a lot as XPath resolution is very expensive operation.<br />
<br />
'''Rule of thumb''': Always use Variant 1 except if you need the reference to the GUI element only once.<br />
<br />
=== Separating Path Definitions ===<br />
<br />
It is highly recommended to add definitions for element-lathes into an environment (typically the project environment), and use "Environment Value" references as input to the steps. This gives two benefits:<br />
<br />
* the paths are hidden and the values at the steps become more readable<br />
* your tests are easier to maintain: in case of a changed window layout/structure, only the variable definitions need to be changed at one place.<br />
* you can import those definitions from a CSV or XML file, and thus separate the locators from the actual test suite. In case of changed UI-layout / UI-hierarchy after a revision change of the tested application, all you need is a new excel or xml file containing those definitions. <br />
<br />
If the development team of the application can provide the paths of the UI components in a machine readable form (i.e. CVS/excel or XML file), you may even let expecco read and parse those path definitions at test start time, and let it automatically adapt to any change. <br />
<br />
<br clear=all><br />
<br />
== Interacting with GUI Elements ==<br />
Once you retrieved a GUI element, you can interact with it by making use of the library's blocks located in the groups '''Elements''', '''Patterns''', and '''Properties'''. <br />
Blocks in those categories take a GUI Element (and sometimes additional data) as input and manipulate it or query for its properties in some way.<br />
<br />
[[Bild:WindowsAutomation_Library_ElementsPatternsProperties.png|600px|The Library's Blocks for Interacting With Elements.]]<br />
<br />
<br />
=== The 'Elements' Group ===<br />
<br />
This group contains blocks that are applicable to blocks that only work on GUI elements of a specific type. For a block's detailed description with examples ,<br />
take a look at the block's documentation in expecco.<br />
<br />
Even though not only Checkboxes can be 'checked', the [''Check''] block in the "''Checkbox group''" only works for checkboxes and not e.g. for radio buttons. <br />
Because of this limitation there are not that many blocks targeting specific elements. Most blocks target a specific ''pattern'' instead and are therefore in the "''Patterns''" group.<br />
<br />
=== The 'Patterns' Group ===<br />
<br />
This group contains blocks that are applicable to GUI elements supporting a certain ''pattern''. <br />
Patterns describe how a GUI element ''behaves'' rather than what it ''is''. An element can also support multiple patterns at the same time. <br />
You can find out which patterns an element supports with the [''Get Supported Patterns''] block or by taking a look at Microsoft's documentation about patterns [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview].<br />
<br />
Pattern blocks can therefore be ''re-used'' between GUI elements of different types. <br />
For example, the [''Expand''] block in "''ExpandCollapse pattern''", can be used to expand Comboboxes, Menus, Submenus, or Trees.<br />
<br />
=== The 'Properties' Group ===<br />
<br />
Blocks in the "''Patterns''" and "''Elements''" group already allow you to query the value of properties pertaining to that element or pattern. Blocks in the "''Properties''" group allow you to query both properties which all elements share as well as arbitrary properties. If you try to retrieve a property an element does not support, the block will fail.<br />
<br />
Please note that the [''Get Arbitrary Property''] block can only query for properties that belong to a pattern. You cannot, for example, query "Text" from a textfield as this is not a property, use "Value" of the value pattern instead. Microsoft's documentation has a list of patterns and the properties they provide [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]<br />
<br />
<br clear=all><br />
<br />
== Automating Keyboard and Mouse ==<br />
[[Bild:WindowsAutomation_Library_KeyboardMouse.png|400px|The Library's Blocks for Interacting With Keyboard and Mouse.]]<br />
<br />
You can control keyboard and mouse with action blocks in the "''Keyboard''" and "''Mouse''" groups, as shown on the right. In contrast to the blocks above, which work in context of a GUI element, the keyboard and mouse blocks work on a global level. You therefore do not need to provide a GUI element when using them. <br />
<br />
You might want to execute some blocks in context of a GUI elemenet nontheless (e.g. enter a number into a text field instead of just pressing keys while the application is running). You can achieve this by selecting the element with the mouse beforehand as you would do when using the application normally (use the [''Left/Double/Right Click On Element''] blocks for this).<br />
If you do not want to wait for the mouse to move, you can also use the [''Set Focus''] block instead.<br />
<br />
=== Keyboard ===<br />
The plugin provides blocks to interact with the keyboard on different abstraction levels. The most versatile block is [''Type With Control Keys Pressed''] where you can specify a string of characters to be typed while any number of control keys (e.g. "esc", "alt", "shift", "ctrl", ...) are held down. All other blocks are specializations of this block.<br />
<br />
[''Press Control Keys''] e.g. allows you to enter key commands such as renaming files ("ALT+F2"), starting the task manager ("CTRL+ALT+DEL"), or closing a window ("ALT+F4"). [''Press Control Key''] makes it easy to just press a single key (e.g. "RETURN" to start a new line in an edit box). The "''Shortcuts''" group provides an assorted collection of often used key combinations for your convenience.<br />
<br />
Use the [''Type''] action to just type some text, or if you just need some throwaway demo text, use [''Type Random Phrase''].<br />
<br />
If you need more fine grained control over the keyboard, you can make use of ''Scan Codes''. The keyboard sends a scan code to the operating system whenever a key is pressed or released. <br />
Microsoft provides a list of the scan codes it supports [https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-6.0/aa299374(v=vs.60)].<br />
[''Press Key By Scan Code''] sends a signal to Windows that a key with a given scan code has been pressed (and is held down). The matching [''Release Key By Scan Code''] sends Windows the adverse signal.<br />
Please note that a key that is pressed, stays pressed until it is explicitly released. If you want to just press and release a key by scan code, use [''Type Key By Scan Code''].<br />
<br />
=== Mouse ===<br />
The plugin provides blocks manipulating the mouse in three ways: ''Clicking'', ''Moving'', and interacting with its ''Buttons''.<br />
<br />
<br />
<br clear=all><br />
<br />
== Recording and Taking Screenshots ==<br />
<br />
<br />
= Frequently Asked Questions =<br />
<br />
== What is the difference between Click/Invoke/Select/Toggle? ==<br />
<br />
== My element supports a certain pattern but blocks of that pattern don't work? ==<br />
<br />
== I have designed custom elements, how can I automate them? ==<br />
<br />
== I have extended my GUI elements to have custom properties, how can I query them? ==<br />
<br />
== Hotkey "Get hovered element" selects the wrong element in the tree ==<br />
<br />
Sometimes there are elements which overlap or hide other elements. This element is then selected in the tree. In this case, you can use the Hotkey "Get focused element" to select the element in the tree</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=WindowsAutomation_Reference_2.0/en&diff=16015WindowsAutomation Reference 2.0/en2019-05-24T13:57:39Z<p>Mb: </p>
<hr />
<div>This is the documentation for the Windows Automation 2.0 plugin.<br />
<br />
It provides facilities to automate tests incorporating applications with a GUI based on Windows Presentation Foundation (WPF), WinForms, and the old Win32 API.<br />
<br />
=Features=<br />
*Automated GUI testing of WPF, WinForms, and Win32 applications.<br />
*Contains an expecco block library and tools which help to model tests and inspect the GUI of the application.<br />
*Parallel remote test-execution on multiple systems.<br />
*Performs tests against already built executables. No source code changes / recompilation of the application is required.<br />
*Access to GUI components using XPath locators.<br />
*Access objects of the application live at execution time.<br />
*Full access to keyboard and mouse of the target system.<br />
*Lots of additional features such as screen capturing, taking screenshots, highlighting GUI elements, mouse tracking, ...<br />
<br />
= Known issues in the current Release (August 2018) =<br />
* The WindowsAutomation2.ets library has got a new functional id. When reimporting the library in existing test suites (which is mandatory), a warning about a changed functional id is shown once. It is ok to accept this dialog.<br />
* Instant follow mouse is very expensive in Windows and is therefore disabled. Use ''HotKeys'' to select a GUI element in the tree at the current pointer position or to update the element tree. HotKeys can be configured in the settings. The HotKey-service has to be started. Take care that the keys have not already been grabbed by another application. If that is the case, a warning will be shown, and you should either make sure that expecco is started before the other application, or that you use other hotkey combinations (in either expecco or the application). <br />
* Recording is still in Beta State. Recording of Button clicks and Keystrokes work well.<br />
* ContextMenus cannot be recorded in the current version (but replay is possible).<br />
* When doing a click the first submenu entry of the first pulldown menu, a wrong element is clicked. All other menu entries are correctly selected. To get it working you can "Invoke" the submenu entry instead of using "Click on Element"<br />
<br />
=Installation and Connection=<br />
The WindowsAutomation testing plugin uses the expecoo ".NET-Bridge" which consists of two parts: A plugin for expecco, and a server executable using the .NET framework running on the remote computer to connect to.<br />
<br />
==Requirements==<br />
On the machine running the system under test:<br />
*.NET Framework 4.6.2 [https://www.microsoft.com/net/download/all] or higher.<br />
* One of the following operation systems:<br />
::- Windows 7 SP1<br />
::- Windows 8<br />
::- Windows 8.1<br />
::- Windows 10<br />
<br />
::- Windows Server 2008 R2 SP1<br />
::- Windows Server 2012<br />
::- Windows Server 2012 R2<br />
::- Windows Server 2016<br />
::- Windows Server, version 1709<br />
<br />
==Plugin Components==<br />
The plugin consists of the following parts:<br />
* The GUI Browser, used to interactively explore your application.<br />
* The Windows Automation Library, which provides blocks that you can use in your test cases.<br />
* The .NET-Bridge server, which provides an interface between the application under test and your tests running in expecco.<br />
<br />
==Installing and Configuring the Plugin in Expecco==<br />
The plugin is usually installed automatically by the installer; either included in the main expecco installation or provided as a separate installable add-on package. Its files are stored in the "<code>plugin</code>" subfolder of the expecco installation folder. You can also copy those files manually to that folder, if required. Expecco detects the plugin automatically during startup. You might need to restart your expecco session.<br />
<br />
==Preparing a local system for test execution==<br />
If you want to automate an application running on the same host as expecco, there is no need to set up anything. Everything should work out of the box.<br />
<br />
Try to connect to an application via the GUIBrowser's ''WindowsAutomation''-connect dialog:<br />
<br />
[[Datei:WindowsAutomation2Connect.png]]<br />
<br />
==Preparing a remote system for test execuction==<br />
<br />
===Security Considerations===<br />
Please make sure, that remote access is only possible from inside a secure local network.<br />
Under no circumstances should you grant access to the DotNetBridgeServer from untrusted hosts.<br />
<br />
===DotNet Bridge Server===<br />
<br />
The remote system has to run the "''.Net-Bridge server''" which in turn either actively connects to expecco or passively waits for an incoming connection from expecco.<br />
<br />
For this, copy "<code>DotNetBridgeServer.exe</code>" (in the "<code>packages/exept/bridgeFramework/dotNetBridge/dotNetBin</code>" folder under the expecco installation directory) to the computer where your system under test is running (you can copy it into any folder). No further installation is needed.<br />
<br />
To start the bridge, navigate to the executable in a shell/cmd/console and start it with the following arguments<br />
("DotNetBridgeServer.exe --help" outputs a list of valid options):<br />
{| class="wikitable"<br />
|-<br />
! Arguments !! Required !! Description<br />
|-<br />
| -s || Yes || "''server mode''". Tells the executable to run in server mode (it will wait for expecco to connect to it, as opposed to client mode, where it actively connects to the partner).<br />
|-<br />
| -k || Yes || "''keepalive''". Tells the client to keep the connection open after a connection has been terminated.<br>This saves you the hassle to restart it every time a test finishes.<br />
|-<br />
| -a&nbsp;<ip/hostname>|| Yes || "''accepted hosts''". The IP-address or hostname from which it will accept connections (in server mode) or to which it connects. To ensure that in slave mode no other machine connects to the server, set this to the IP of the machine your expecco is running on. To allow any machine (i.e. to have it listen on any IP-address), set it to 0.0.0.0.<br />
|-<br />
| -p <int> || No || "''port''". The port the server should listen on (in server mode) or to which is should connect (default is 34318).<br />
|}<br />
<br />
So you may execute on the remote host:<br />
<br />
DotNetBridgeServer.exe -s -k -a 0.0.0.0<br />
<br />
=Settings=<br />
There are currently no configurable settings.<br />
<br />
=GUI Browser=<br />
The GUI browser allows you to explore a running application. You can browse the application, inspect element properties and execute actions. For a more detailed description also see [[Expecco GUI Tests Extension Reference|Gui Browser]].<br />
<br />
=Library=<br />
This article gives a short overview over the design philosophy of the library. You can find more detailed documentation and examples attached to the blocks itself.<br />
<br />
== Connecting to an Application ==<br />
To automate an application, you first have to connect to it. You can do this with the<br />
blocks from the "''Connecting''" group.<br />
[[Bild:WindowsAutomation2_Library_ConnectingBlocks.PNG|frame|The Library's Connection Blocks.]]<br />
<br />
You can connect to an application by its ''executable name'', or by its ''process id''. <br />
If you use the executable name, expecco will attach to the main process of the specified executable. Be careful as this is not necessarily the process <br />
drawing the GUI! Use the process id if an application spawns more than one process and you need to make sure you connect to the GUI process and not some background process.<br />
<br />
All connection blocks also require you to specify a ''name'' by which the connection should be known in future.<br />
This is needed when you automate multiple applications at the same time and need to change<br />
''connection contexts'' during test execution.<br />
Please note that the application to connect to has to be started before the corresponding connection block is executed.<br />
You can change in context of which connection a block is executed with the [''Set Active Connection''] block.<br />
This allows you, for example, to automate and compare the state of applications running on multiple systems in one test case.<br />
<br />
=== Establishing a Local Connection === <br />
If you want to automate an application running on the same host as expecco, there is no need to set up anything. <br />
Use the [''Create Local Connection''] with the above mentioned parameters.<br />
<br />
=== Establishing a Remote Connection ===<br />
Make sure that the DotNet-Bridge server (DotNetBridgeServer.exe) is running on the remote system, as explained in the chapter [[#Preparing a remote system for test execuction|"''Preparing a remote system for test execuction''"]]<br />
When the bridge is running, you can connect to it with the [''Create Remote Connection''] block using the hostname and IP-Address you specified when you started the bridge.<br />
<br />
Notice, that the DotNet-Bridge server only accepts local connections by default.<br />
This is done for security reasons. Use the "-a x.x.x.x" command line argument to specify, which hosts are allowed<br />
to connect to the Bridge server. With "-a 0.0.0.0", any host is allowed. Do NOT use this, if the remote host is reachable from untrusted hosts.<br />
<br />
=== Closing a Connection ===<br />
Remember to always close a connection when it is no longer needed, as it otherwise needlessly consumes resources.<br />
One simple way to do this is to setup your connections in the ''Before Execution'' (pre-action) part of the test suite or test case,<br />
and put the [''Close All Connections''] block in the ''After exeuction'' (post-action) part.<br />
<br />
<br clear=all><br />
<br />
== Accessing GUI Elements ==<br />
[[Bild:WindowsAutomation_Library_AccessBlocks.PNG|frame|The Library's GUI Element Access Blocks.]]<br />
[[Bild:WindowsAutomation_Library_AccessBlocksExamples.PNG|frame|A Few Examples on How to Access Elements in Notepad.]]<br />
[[Bild:WindowsAutomation_Library_AccessBlocksModes.PNG|frame|Different Ways to Reference a GUI Element.]]<br />
All Windows applications are built as a '' tree'' of '' GUI elements''.<br />
Some elements act as container of other element - their children. Tables, for example, are containers<br />
for their cell elements which themselves might contain text labels.<br />
At the root of the tree are one or more ''windows'' . When you connect to an application, you get access to<br />
all windows at the tree's root.<br />
To manipulate any of the system under test's GUI element, you first have to gain access to it.<br />
The group named "''GUI Element Access''" provides action blocks to access elements. The actions are further categorized into sub-groups named "'' Access By XPath''" , "''Access By Property''", "''Existence Test''" etc. <br />
For each category, blocks with the same interface exist. The only difference is the method of retrieval.<br />
<br />
;Get GUI Element : returns a ''single'' GUI element matching the search condition. If multiple elements match the condition, an ''arbitrary'' element matching the condition is returned.<br />
:To make sure that there is only one single element matching, set ''ensureExclusive'' to true. You can also enforce this globally by setting the environment variable "''ensureExclusive''" in your environment. <br />
:If ensureExclusive is set and more than one element is found, the block will fail and notify about the ambiguity. This is disabled by default, as checking for uniqueness is a very costly (ie. slow) operation.<br />
:You can also specify a ''timeout'' after which the search is aborted. This is useful if you know an element should be there already (or soon but might currently be loading).<br />
<br />
;Get GUI Elements: returns ''all'' GUI elements matching the search condition. If no element is found, it returns an empty list ''Timeout'' and ''cacheXPath'' are also applicable.<br />
<br />
;Exists: Works exactly the same as ''Get GUI Element'' but does not fail if no element is found. Additionally provides an output pin specifying if an element has been found.<br />
<br />
Both of these blocks are also available in the "''Relative To Anchor''" variety. Those blocks also take a GUI Element as ''anchor'' in relation to which they search. <br />
<br />
<br />
=== Using XPaths ===<br />
<br />
'''XPath''' is the query language used for selecting GUI elements in the application's element tree.<br />
You can find the XPath of an element with the [[Expecco GUI Tests Extension Reference/en|Gui Browser]] or with third-party applications like "Inspect.exe" [https://msdn.microsoft.com/en-us/library/dd318521(v=vs.85).aspx] or FlaUInspect [https://github.com/FlauTech/FlaUInspect].<br />
As an example, the ''XPath'' of the scroll button on the <br />
vertical scrollbar in the German Windows Notepad.exe application looks like this:<br />
<br />
<code>/Window[@Name='Unbenannt - Editor']/Document[@Name='Text-Editor']/ScrollBar[@Name='Vertikale Bildlaufleiste']/Button[@Name='Bildlauf nach unten'] </code><br />
<br />
For each level in the GUI tree, a new ''Location Step'' containing the child elements ''Control Type'' has to be added.<br />
You do not have to use any predicates, the following XPath is valid as well:<br />
<br />
<code>/Window/Document/ScrollBar/Button </code><br />
<br />
but might lead to issues as there might be multiple GUI Elements matching this path.<br />
You can select by three predicates that can be mixed and matched in the same query:<br />
<br />
; Name: the name the application developer has given an element. Be careful as this name might change during programm execution (See for example Notepad's window name which always begins with the name of the currently opened file.<br />
: <code>/Window[@Name='Unbenannt - Editor'] </code> <br />
<br />
; AutomationId: An ID the application developer has given an element. It is meant to be unique between siblings but that is not enforced on lazy or incompetent programmers.<br />
: Many lazy developers leave the ID empty or reuse it, making it useless. You should nontheless use this ID wherever applicable as it is static<br />
: and meant for this exact purpose.<br />
: <code>/Window/Document[@AutomationId='15'] </code> <br />
<br />
;List Index: If there are multiple siblings with the same Control Type, you can select one of them by (1-based) list index.<br />
: <code>/Window[1]/Document[1] </code><br />
: <code>/Window[1]/Document[last()] </code> <br />
<br />
'''Please Note''': You can only use the three predicates above in your XPaths. Other predicates '''DO NOT''' work! If you want to search<br />
an element by another property (e.g. its help text), use the '''By Property''' variant of the block instead. <br />
If the property is not unique, you can select a unique ancestor of the target by property or XPath relative to which the property is unique.<br />
You can then use that ancestor as anchor in the [''Get GUI Element By Property (Relative to Anchor)''] block.<br />
<br />
=== Using Wildcards in XPaths ===<br />
<br />
XPath also supports '''wildcards'''. You can:<br />
* replace '''one tree level''' with a "*" wildcard: <br />
<code>/Window/Document[@AutomationId='15']/*/Button[1]</code> <br /><br />
<code>/*/*/*/Button[1] </code> <br />
<br />
* replace a '''control type''' with a "*" wildcard:<br />
<code>/Window/*[@AutomationId='15'] </code> <br />
<br />
* replace '''an arbitrary amount of levels''' with a "//" wildcard:<br />
<code>//Button </code> <br /><br />
<code>/Window//Button[1] </code><br />
<br />
Especially the last option is useful as it makes your tests more readable as the reader can easily focus on the relevant parts of the xpath.<br />
But be careful. Using wildcards comes at a steep performance cost. If your tests run unacceptably slow, first try to remove wildcards where they are not needed.<br />
<br />
=== Using Properties===<br />
<br />
You can also search for elements by property by specifying a value an element's property with the given name must have. For a list of properties a GUI element might have, take a look at Microsoft's documentation [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]. It specifies the supported properties for each pattern an element can support.<br />
<br />
=== XPath Resolution in Action Blocks ===<br />
<br />
Getting a reference to the GUI Element everytime you need to manipulate it in any way can make for very unclean looking test suites as two blocks are needed to perform any action - one for getting a reference to the element and another one for perform the action. The library therefore also allows you to directly feed an xpath into every block that would take a reference to a GUI Element.<br />
<br />
The image on the right shows this mode in action. Variants 1 and 2 are functionally equivalent.<br />
While Variant 2 is more concise, Variant 1 is the right choice in most cases. While it has an additional block, you have control over the other input parameters. <br />
You also can recycle the GUI element reference as seen in 3). This is invaluable as the XPath only has to be resolved once. This speeds up test execution by a lot as XPath resolution is very expensive operation.<br />
<br />
'''Rule of thumb''': Always use Variant 1 except if you need the reference to the GUI element only once.<br />
<br />
=== Separating Path Definitions ===<br />
<br />
It is highly recommended to add definitions for element-lathes into an environment (typically the project environment), and use "Environment Value" references as input to the steps. This gives two benefits:<br />
<br />
* the paths are hidden and the values at the steps become more readable<br />
* your tests are easier to maintain: in case of a changed window layout/structure, only the variable definitions need to be changed at one place.<br />
* you can import those definitions from a CSV or XML file, and thus separate the locators from the actual test suite. In case of changed UI-layout / UI-hierarchy after a revision change of the tested application, all you need is a new excel or xml file containing those definitions. <br />
<br />
If the development team of the application can provide the paths of the UI components in a machine readable form (i.e. CVS/excel or XML file), you may even let expecco read and parse those path definitions at test start time, and let it automatically adapt to any change. <br />
<br />
<br clear=all><br />
<br />
== Interacting with GUI Elements ==<br />
Once you retrieved a GUI element, you can interact with it by making use of the library's blocks located in the groups '''Elements''', '''Patterns''', and '''Properties'''. <br />
Blocks in those categories take a GUI Element (and sometimes additional data) as input and manipulate it or query for its properties in some way.<br />
<br />
[[Bild:WindowsAutomation_Library_ElementsPatternsProperties.png|600px|The Library's Blocks for Interacting With Elements.]]<br />
<br />
<br />
=== The 'Elements' Group ===<br />
<br />
This group contains blocks that are applicable to blocks that only work on GUI elements of a specific type. For a block's detailed description with examples ,<br />
take a look at the block's documentation in expecco.<br />
<br />
Even though not only Checkboxes can be 'checked', the [''Check''] block in the "''Checkbox group''" only works for checkboxes and not e.g. for radio buttons. <br />
Because of this limitation there are not that many blocks targeting specific elements. Most blocks target a specific ''pattern'' instead and are therefore in the "''Patterns''" group.<br />
<br />
=== The 'Patterns' Group ===<br />
<br />
This group contains blocks that are applicable to GUI elements supporting a certain ''pattern''. <br />
Patterns describe how a GUI element ''behaves'' rather than what it ''is''. An element can also support multiple patterns at the same time. <br />
You can find out which patterns an element supports with the [''Get Supported Patterns''] block or by taking a look at Microsoft's documentation about patterns [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview].<br />
<br />
Pattern blocks can therefore be ''re-used'' between GUI elements of different types. <br />
For example, the [''Expand''] block in "''ExpandCollapse pattern''", can be used to expand Comboboxes, Menus, Submenus, or Trees.<br />
<br />
=== The 'Properties' Group ===<br />
<br />
Blocks in the "''Patterns''" and "''Elements''" group already allow you to query the value of properties pertaining to that element or pattern. Blocks in the "''Properties''" group allow you to query both properties which all elements share as well as arbitrary properties. If you try to retrieve a property an element does not support, the block will fail.<br />
<br />
Please note that the [''Get Arbitrary Property''] block can only query for properties that belong to a pattern. You cannot, for example, query "Text" from a textfield as this is not a property, use "Value" of the value pattern instead. Microsoft's documentation has a list of patterns and the properties they provide [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]<br />
<br />
<br clear=all><br />
<br />
== Automating Keyboard and Mouse ==<br />
[[Bild:WindowsAutomation_Library_KeyboardMouse.png|400px|The Library's Blocks for Interacting With Keyboard and Mouse.]]<br />
<br />
You can control keyboard and mouse with action blocks in the "''Keyboard''" and "''Mouse''" groups, as shown on the right. In contrast to the blocks above, which work in context of a GUI element, the keyboard and mouse blocks work on a global level. You therefore do not need to provide a GUI element when using them. <br />
<br />
You might want to execute some blocks in context of a GUI elemenet nontheless (e.g. enter a number into a text field instead of just pressing keys while the application is running). You can achieve this by selecting the element with the mouse beforehand as you would do when using the application normally (use the [''Left/Double/Right Click On Element''] blocks for this).<br />
If you do not want to wait for the mouse to move, you can also use the [''Set Focus''] block instead.<br />
<br />
=== Keyboard ===<br />
The plugin provides blocks to interact with the keyboard on different abstraction levels. The most versatile block is [''Type With Control Keys Pressed''] where you can specify a string of characters to be typed while any number of control keys (e.g. "esc", "alt", "shift", "ctrl", ...) are held down. All other blocks are specializations of this block.<br />
<br />
[''Press Control Keys''] e.g. allows you to enter key commands such as renaming files ("ALT+F2"), starting the task manager ("CTRL+ALT+DEL"), or closing a window ("ALT+F4"). [''Press Control Key''] makes it easy to just press a single key (e.g. "RETURN" to start a new line in an edit box). The "''Shortcuts''" group provides an assorted collection of often used key combinations for your convenience.<br />
<br />
Use the [''Type''] action to just type some text, or if you just need some throwaway demo text, use [''Type Random Phrase''].<br />
<br />
If you need more fine grained control over the keyboard, you can make use of ''Scan Codes''. The keyboard sends a scan code to the operating system whenever a key is pressed or released. <br />
Microsoft provides a list of the scan codes it supports [https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-6.0/aa299374(v=vs.60)].<br />
[''Press Key By Scan Code''] sends a signal to Windows that a key with a given scan code has been pressed (and is held down). The matching [''Release Key By Scan Code''] sends Windows the adverse signal.<br />
Please note that a key that is pressed, stays pressed until it is explicitly released. If you want to just press and release a key by scan code, use [''Type Key By Scan Code''].<br />
<br />
=== Mouse ===<br />
The plugin provides blocks manipulating the mouse in three ways: ''Clicking'', ''Moving'', and interacting with its ''Buttons''.<br />
<br />
<br />
<br clear=all><br />
<br />
== Recording and Taking Screenshots ==<br />
<br />
<br />
= Frequently Asked Questions =<br />
<br />
== What is the difference between Click/Invoke/Select/Toggle? ==<br />
<br />
== My element supports a certain pattern but blocks of that pattern don't work? ==<br />
<br />
== I have designed custom elements, how can I automate them? ==<br />
<br />
== I have extended my GUI elements to have custom properties, how can I query them? ==<br />
<br />
== Hotkey "Get hovered element" selects the wrong element in the tree ==<br />
<br />
Sometimes there are elements which overlap or hide other elements. This component is then selected in the tree. In this case, you can use the Hotkey "Get focused element" to select the element inthe tree</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=WindowsAutomation_Reference_2.0/en&diff=14110WindowsAutomation Reference 2.0/en2018-09-20T14:31:43Z<p>Mb: /* Known issues in the current Release (August 2018) */</p>
<hr />
<div>This is the documentation for the Windows Automation 2.0 plugin.<br />
<br />
It provides facilities to automate tests incorporating applications with a GUI based on Windows Presentation Foundation (WPF), WinForms, and the old Win32 API.<br />
<br />
=Features=<br />
*Automated GUI testing of WPF, WinForms, and Win32 applications.<br />
*Contains an expecco block library and tools which help to model tests and inspect the GUI of the application.<br />
*Parallel remote test-execution on multiple systems.<br />
*Performs tests against already built executables. No source code changes / recompilation of the application is required.<br />
*Access to GUI components using XPath locators.<br />
*Access objects of the application live at execution time.<br />
*Full access to keyboard and mouse of the target system.<br />
*Lots of additional features such as screen capturing, taking screenshots, highlighting GUI elements, mouse tracking, ...<br />
<br />
= Known issues in the current Release (August 2018) =<br />
* The WindowsAutomation2.ets library has got a new functional id. When reimporting the library in existing test suites (which is mandatory), a warning about a changed functional id is shown once. It is ok to accept this dialog.<br />
* Instant follow mouse is too expensive in Windows and is not and will not be supported. Use HotKeys to select a GUI element in the tree at the current pointer position or to update the element tree. HotKeys can be configured in the settings. The HotKey service hast to be started. Take care that the Hotkeys have not already been grabbed by another application that is running on your desktop (a warning will be shown in this case). <br />
* Recording is still in Beta State. Recording of Button clicks and Keystrokes work well.<br />
* ContextMenus cannot be recorded in the current version.<br />
* When doing a clicking the first submenu entry of the first pulldown menu, a wrong element is clicked. All other menu entries are correctly selected. To get it working you can "Invoke" the submenu entry instead of using "Click on Element"<br />
<br />
=Installation and Connection=<br />
The WindowsAutomation testing plugin uses the expecoo ".NET-Bridge" which consists of two parts: A plugin for expecco, and a server executable using the .NET framework running on the remote computer to connect to.<br />
<br />
==Requirements==<br />
On the machine running the system under test:<br />
*.NET Framework 4.6.2 [https://www.microsoft.com/net/download/all] or higher.<br />
* One of the following operation systems:<br />
::- Windows 7 SP1<br />
::- Windows 8<br />
::- Windows 8.1<br />
::- Windows 10<br />
<br />
::- Windows Server 2008 R2 SP1<br />
::- Windows Server 2012<br />
::- Windows Server 2012 R2<br />
::- Windows Server 2016<br />
::- Windows Server, version 1709<br />
<br />
==Plugin Components==<br />
The plugin consists of the following parts:<br />
* The GUI Browser, used to interactively explore your application.<br />
* The Windows Automation Library, which provides blocks that you can use in your test cases.<br />
* The .NET-Bridge server, which provides an interface between the application under test and your tests running in expecco.<br />
<br />
==Installing and Configuring the Plugin in Expecco==<br />
The plugin is usually installed automatically by the installer; either included in the main expecco installation or provided as a separate installable add-on package. Its files are stored in the "<code>plugin</code>" subfolder of the expecco installation folder. You can also copy those files manually to that folder, if required. Expecco detects the plugin automatically during startup. You might need to restart your expecco session.<br />
<br />
==Preparing a local system for test execution==<br />
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Everything should work out of the box.<br />
<br />
[[Datei:WindowsAutomation2Connect.png]]<br />
<br />
==Preparing a remote system for test execuction==<br />
The remote system has to run the "''.Net-Bridge server''" which in turn connects to expecco. <br />
For this, copy "<code>DotNetBridgeServer.exe</code>" (in the "<code>packages/exept/bridgeFramework/dotNetBridge/dotNetBin</code>" folder under the expecco installation directory) to the computer where your system under test is running (you can copy it into any folder). No further installation is needed.<br />
<br />
To start the bridge, navigate to the executable in a shell/cmd/console and start it with the following arguments:<br />
{| class="wikitable"<br />
|-<br />
! Arguments !! Required !! Description<br />
|-<br />
| -s || Yes || Tells the executable to run in server mode (it will wait for expecco to connect to it, as opposed to client mode, where it actively connects to the partner).<br />
|-<br />
| -k || Yes || Tells the client to keep the connection open after a connection has been terminated.<br>This saves you the hassle to restart it every time a test finishes.<br />
|-<br />
| -a&nbsp;<ip/hostname>|| Yes || The IP-address or hostname from which it will accept connections. To ensure that no other machine connects to the server, set this to the IP of the machine your expecco is running on. To allow any machine (i.e. to have it listen on any IP-address), set it to 0.0.0.0.<br />
|-<br />
| -p <int> || No || The port the server should listen on (default is 34318).<br />
|}<br />
<br />
So you may execute on the remote host:<br />
<br />
DotNetBridgeServer.exe -s -k -a 0.0.0.0<br />
<br />
=Settings=<br />
There are currently no configurable settings.<br />
<br />
=GUI Browser=<br />
The GUI browser allows you to explore a running application. You can browse the application, inspect element properties and execute actions. For a more detailed description also see [[Expecco GUI Tests Extension Reference|Gui Browser]].<br />
<br />
=Library=<br />
This article gives a short overview over the design philosophy of the library. You can find more detailed documentation and examples attached to the blocks itself.<br />
<br />
== Connecting to an Application ==<br />
To automate an application, you first have to connect to it. You can do this with the<br />
blocks from the '''Connecting''' group.<br />
[[Bild:WindowsAutomation2_Library_ConnectingBlocks.PNG|frame|The Library's Connection Blocks.]]<br />
<br />
You can connect to an application by its '''executable name''', or by its '''process id'''. <br />
If you use the executable name, expecco will attach to the main process of the specified executable. Be careful as this is not necessarily the process <br />
drawing the GUI! Use the process id if an application spawns more than one process and you need to make sure you connect to the GUI process and not some background process.<br />
All connection blocks also require you to specify a '''name''' by which the connection should be known in future.<br />
This is needed for when you automate multiple applications at the same time and need to change<br />
'''connection contexts''' during test execution.<br />
Please note that the application to connect to has to be started before the corresponding connection block is executed.<br />
You can change in context of which connection a block is executed with the '''Set Active Connection''' block.<br />
This allows you, for example, to automate and compare the state of applications running on multiple systems in one test case.<br />
<br />
=== Establishing a Local Connection === <br />
If you want to automate an application running on the same host as expecco, there is no need to set up anything! Just use the '''Create Local Connection''' with the mentioned above parameters.<br />
<br />
=== Establishing a Remote Connection ===<br />
Make sure that the DotNet Bridge server is started as explained in [[#Preparing a remote system for test execuction|Preparing a remote system for test execuction]]<br />
When the bridge is running, you can connect to it with the '''Create Remote Connection''' block using the hostname and IP-Address you specified when you started the bridge.<br />
<br />
=== Closing a Connection ===<br />
Remember to always close a connection when it is no longer needed, as it otherwise needlessly consumes resources.<br />
One simple way to do this is to setup your connections in the '''Before Execution''' part of the test suite<br />
and put the '''Close All Connections''' block in the '''After exeuction''' part.<br />
<br />
<br clear=all> <br />
== Accessing GUI Elements ==<br />
[[Bild:WindowsAutomation_Library_AccessBlocks.PNG|frame|The Library's GUI Element Access Blocks.]]<br />
[[Bild:WindowsAutomation_Library_AccessBlocksExamples.PNG|frame|A Few Examples on How to Access Elements in Notepad.]]<br />
[[Bild:WindowsAutomation_Library_AccessBlocksModes.PNG|frame|Different Ways to Reference a GUI Element.]]<br />
All Windows applications are built as a ''' tree''' of ''' GUI elements''' .<br />
Some elements act as container of other element - their children. Tables, for example, are containers<br />
for their cell elements which themselves might contain text labels.<br />
At the root of the tree are one or more '''windows''' . When you connect to an application, you get access to<br />
all windows at the tree's root.<br />
To manipulate any of the system under test's GUI element, you first have to gain access to it.<br />
The group '''GUI Element Access''' provides blocks that help you to gain access to the elements. There are 12 blocks in total, divided between ''' Access By XPath''' , '''Access By Property''',<br />
and '''Existence Test'''. For each category, blocks with the same interface exist. The only difference is the method of retrival.<br />
<br />
;Get GUI Element : returns a '''single''' GUI Element matching the search condition. If multiple match the condition, an '''arbitrary''' element matching the condition is returned.<br />
:If you want to make sure that there is only one element matching, set '''ensureExclusive''' to true. You can also enforce this globally by setting the environment variable '''ensureExclusive''' in your environment. <br />
:If ensureExclusive is set and more than one element is found, the block will fail and notify you of the ambiguity. This is disabled by default as checking for uniqueness is a very costly operation.<br />
:You can also specify a '''timeout''' after which the search is aborted. This is useful if you know an element should be there soon but might currently be loading.<br />
<br />
;Get GUI Elements: returns '''all''' GUI Element matching the search condition. If no element is found, it returns an empty list <b> Timeout </b> and <b>cacheXPath</b> are also applicable.<br />
<br />
;Exists: Works exactly the same as '''Get GUI Element''' but does not fail if no element can be found. Additionally provides an output pin specifying if an element has been found.<br />
<br />
Both of these blocks are also available in the '''Relative To Anchor''' variety. Those blocks also take a GUI Element as '''anchor''' in relation to which they search. <br />
<br />
<br />
=== Using XPaths ===<br />
<br />
'''XPath''' is the query language this plugin uses for selecting GUI elements in the application's element tree.<br />
You can find the XPath of an element with the [[Expecco GUI Tests Extension Reference|Gui Browser]] or with third-party applications like Inspect.exe [https://msdn.microsoft.com/en-us/library/dd318521(v=vs.85).aspx] or FlaUInspect [https://github.com/FlauTech/FlaUInspect].<br />
An '''XPath''' for the scroll button on the <br />
vertical scrollbar in the german Windows Notepad application looks like this:<br />
<br />
<code>/Window[@Name='Unbenannt - Editor']/Document[@Name='Text-Editor']/ScrollBar[@Name='Vertikale Bildlaufleiste']/Button[@Name='Bildlauf nach unten'] </code><br />
<br />
For each level in the GUI tree, a new <b>Location Step</b> containing the child elements <b>Control Type</b> has to be added.<br />
You do not have to use any predicates, the following XPath is valid as well:<br />
<br />
<code>/Window/Document/ScrollBar/Button </code><br />
<br />
but might lead to issues as there might be multiple GUI Elements matching this path.<br />
You can select by three predicates that can be mixed and matched in the same query:<br />
<br />
; Name: the name the application developer has given an element. Be careful as this name might change during programm execution (See for example Notepad's window name which always begins with the name of the currently opened file.<br />
: <code>/Window[@Name='Unbenannt - Editor'] </code> <br />
<br />
; AutomationId: An ID the application developer has given an element. It is meant to be unique between siblings but that is not enforced.<br />
: Many developersleave the ID empty or reuse it, making it useless. You should nontheless use this ID wherever applicable as it is static<br />
: and meant for this exact purpose.<br />
: <code>/Window/Document[@AutomationId='15'] </code> <br />
<br />
;List Index: If there are multiple siblings with the same Control Type, you can select one of them by (1-based) list index.<br />
: <code>/Window[1]/Document[1] </code><br />
: <code>/Window[1]/Document[last()] </code> <br />
<br />
'''Please Note''': You can '''only''' use the three predicates above in your XPaths. Other predicates '''DO NOT''' work! If you want to search<br />
an element by another property (e.g. its help text), use the '''By Property''' variant of the block instead. If the property is not unique,<br />
you can select a unique ancestor of the target by property or XPath relative to which the property is unique.<br />
You can then use that ancestor as anchor in the '''Get GUI Element By Property (Relative to Anchor)''' block.<br />
<br />
=== Using Wildcards in XPaths ===<br />
<br />
XPath also supports '''wildcards'''. You can:<br />
* replace '''one tree level''' with a "*" wildcard: <br />
<code>/Window/Document[@AutomationId='15']/*/Button[1]</code> <br /><br />
<code>/*/*/*/Button[1] </code> <br />
<br />
* replace a '''control type''' with a "*" wildcard:<br />
<code>/Window/*[@AutomationId='15'] </code> <br />
<br />
* replace '''an arbitrary amount of levels''' with a "//" wildcard:<br />
<code>//Button </code> <br /><br />
<code>/Window//Button[1] </code><br />
<br />
Especially the last option is useful as it makes your tests <b>more readable</b> as the reader can easily focus on the relevant parts of the xpath.<br />
But be careful. Using wildcards comes at a steep <b>performance cost</b>. If your tests run unacceptably slow, first try to '''remove wildcards where they are not needed'''.<br />
<br />
=== Using Properties===<br />
<br />
You can also search for elements by property by specifying a value an element's property with the given name must have. For a list of properties a GUI element might have, take a look at Microsoft's documentation [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]. It specifies the supported properties for each pattern an element can support.<br />
<br />
=== XPath Resolution in Action Blocks ===<br />
<br />
Getting a reference to the GUI Element everytime you need to manipulate it in any way can make for very unclean looking test suites as two blocks are needed to perform any action - one for getting a reference to the element and another one for perform the action. The library therefore also allows you to directly feed an xpath into every block that would take a reference to a GUI Element.<br />
<br />
The image on the right shows this mode in action. Variants 1 and 2 are functionally equivalent.<br />
While Variant 2 is more concise, Variant 1 is the right choice in most cases. While it has an additional block, you have control over the other input parameters. <br />
You also can recycle the GUI element reference as seen in 3). This is invaluable as the XPath only has to be resolved once. This speeds up test execution by a lot as XPath resolution is very expensive operation.<br />
<br />
'''Rule of thumb''': Always use Variant 1 except if you need the reference to the GUI element only once.<br />
<br />
=== Separating Path Definitions ===<br />
<br />
It is highly recommended to add definitions for element-lathes into an environment (typically the project environment), and use "Environment Value" references as input to the steps. This gives two benefits:<br />
<br />
* the paths are hidden and the values at the steps become more readable<br />
* your tests are easier to maintain: in case of a changed window layout/structure, only the variable definitions need to be changed at one place.<br />
<br />
If the development team of the application can provide the paths of the UI components in a machine readable form (i.e. cvs or excel or xml file), you may even let expecco read and parse those path definitions at test start time, and let it automatically adapt to any change. <br />
<br />
<br clear=all><br />
<br />
== Interacting with GUI Elements ==<br />
Once you retrieved a GUI element, you can interact with it by making use of the library's blocks located in the groups '''Elements''', '''Patterns''', and '''Properties'''. <br />
Blocks in those categories take a GUI Element (and sometimes additional data) as input and manipulate it or query for its properties in some way.<br />
<br />
[[Bild:WindowsAutomation_Library_ElementsPatternsProperties.png|600px|The Library's Blocks for Interacting With Elements.]]<br />
<br />
<br />
=== The 'Elements' Group ===<br />
<br />
This group contains blocks that are applicable to blocks that only work on '''GUI elements of a specific type'''. For a block's detailed description with examples ,<br />
take a look at the block's documentation in expecco.<br />
<br />
Even though not only Checkboxes can be 'checked', the '''Check''' block in the '''Checkbox group''' only works for checkboxes and not e.g. for radio buttons. <br />
Because of this limitation there are not that many blocks targeting specific elements. Most blocks target a specific '''pattern''' instead and are therefore in the '''Patterns''' group.<br />
<br />
=== The 'Patterns' Group ===<br />
<br />
This group contains blocks that are applicable to GUI elements supporting a certain '''pattern'''. '''Patterns''' describe how a GUI element '''behaves''' rather than what it '''is'''. An element can also support multiple patterns<br />
at the same time. You can find out which patterns an element supports with the '''Get Supported Patterns''' block or by taking a look at Microsoft's documentation about patterns [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview].<br />
<br />
Pattern blocks can therefore be '''re-used''' between GUI elements of different types. The '''Expand''' block of the '''ExpandCollapse pattern''', for example, can be used to expand Comboboxes, Menus, Submenus, or Trees.<br />
<br />
=== The 'Properties' Group ===<br />
<br />
Blocks in the '''Patterns''' and '''Elements''' group already allow you to query the value of properties pertaining to that element or pattern. Blocks of the '''Properties''' group allow you to query properties all elements share as well as arbitrary properties. If you try to retrieve a property an element does not support, the block will fail.<br />
<br />
Please note that the '''Get Arbitrary Property''' block can only query for properties that belong to a pattern. You cannot, for example, query "Text" from a textfield as this is not a property, use "Value" of the value pattern instead. Microsoft's documentation has a list of patterns and the properties they provide [https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-control-patterns-overview#control-pattern-classes-and-interfaces]<br />
<br />
<br clear=all><br />
<br />
== Automating Keyboard and Mouse ==<br />
[[Bild:WindowsAutomation_Library_KeyboardMouse.png|400px|The Library's Blocks for Interacting With Keyboard and Mouse.]]<br />
<br />
You can control keyboard and mouse with the blocks in the groups '''Keyboard''' and '''Mouse''' that can be seen on the right. In contrast to the blocks above which work in context of a GUI element, the keyboard and mouse blocks work on a global level. You therefore do not need to provide a GUI element when using them. <br />
<br />
You might want to execute some blocks in context of a GUI elemenet nontheless (e.g. enter a number into a text field instead of just pressing keys while the application is running). You can achieve this by selecting the element with the mouse beforehand as you would do when using the application normally (use the '''Left/Double/Right Click On Element''' blocks for this).<br />
If you do not want to wait for the mouse to move, you can also use the '''Set Focus''' block instead.<br />
<br />
=== Keyboard ===<br />
The plugin provides blocks interacting with the keyboard on different abstraction levels. The most versatile block is '''Type With Control Keys Pressed''' where you can specify a string of characters to be typed while any number of control keys (e.g. esc, alt, shift, ctrl, ...) are held down. All other blocks are specializations of this block.<br />
<br />
'''Press Control Keys''' e.g. allows you to enter key commands such as renaming files (ALT+F2), starting the task manager (CTRL+ALT+DEL), or closing a window (ALT+F4). '''Press Control Key''' makes it easy to just press a single key (e.g. RETURN to start a new line in an edit box). The '''Shortcuts''' group provides an assorted collection of often used key combinations for your convenience.<br />
<br />
Use the '''Type''' to just type some text or, if you just need some throwaway demo text, use '''Type Random Phrase'''.<br />
<br />
If you need more fine grained control over the keyboard, you can make use of '''Scan Codes'''. The keyboard sends a scan codeto the operating system whenever a key is pressed or released. <br />
Microsoft provides a list of the scan codes it supports [https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-6.0/aa299374(v=vs.60)].<br />
'''Press Key By Scan Code''' sends Windows a signal that a key with a given scan code has been pressed (and is held down). The matching '''Release Key By Scan Code''' sends Windows the adverse signal.<br />
Please note that a key that is pressed, stays pressed until it is explicitly released. If you want to just press and release a key by scan code, use '''Type Key By Scan Code'''.<br />
<br />
=== Mouse ===<br />
The plugin provides blocks manipulating the mouse in three ways: '''Clicking''', '''Moving''', and interacting with its '''Buttons'''.<br />
<br />
<br />
<br clear=all><br />
<br />
== Recording and Taking Screenshots ==<br />
<br />
<br />
= Frequently Asked Questions =<br />
<br />
== What is the difference between Click/Invoke/Select/Toggle? ==<br />
<br />
== My element supports a certain pattern but blocks of that pattern don't work? ==<br />
<br />
== I have designed custom elements, how can I automate them? ==<br />
<br />
== I have extended my GUI elements to have custom properties, how can I query them? ==</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Expecco_GUI_Tests_Extension_Reference&diff=6373Expecco GUI Tests Extension Reference2016-09-06T09:37:45Z<p>Mb: /* Platzhalter Schreibweise */</p>
<hr />
<div><!-- Notes<br />
- integrated expecco extension<br />
- common tool for different ui technologys<br />
- information about the ui structure and control properties<br />
- creating testsequences<br />
- recording<br />
<br />
Features<br />
- fully integrated in expecco ui<br />
- one tool for multiple technologys<br />
- examine ui structure<br />
- examine control properties and details<br />
- filtered blocks for selected control and properties<br />
- create block sequence by drag and drop and record<br />
- try blocks, sequence, different paths<br />
- add sequence to your project<br />
- find controls by mouse over or highlight<br />
<br />
Installation<br />
<br />
User Interface<br />
- open the UI<br />
- UI overview<br />
- UI functionality<br />
- connecting applications<br />
<br />
Component Path<br />
<br />
--><br />
<br />
"expecco GUI Tests Extension" unterstützt die Erstellung von Testsequenzen für grafische Benutzeroberflächen (GUIs) in expecco. Das Werkzeug ist nahtlos in die expecco Benutzeroberfläche integriert. Es dient als gemeinsame Basis für verschiedenste GUI-Technologien (Qt, Java/Swing, Android, MFC, etc). Die "expecco GUI Tests Extension" bietet neben der Möglichkeiten zum Aufzeichen von Testsequenzen auch Unterstützung zum interaktiven Entwicklung von Testsequenzen, sowie Informationen über die Struktur der Benutzeroberfläche und Zustände sowie Eigenschaften der Bedienelemente. Einzelne Aktionen oder ganze Sequenzen können zunächst ausprobiert und anschließend in die Testsequenz übernommen werden ("exploratives Testen").<br />
<br />
=Hauptmerkmale=<br />
* Nahtlose Integration in die expecco-Benutzeroberfläche<br />
* Ein gemeinsames Werkzeug für verschiedene UI-Technologien<br />
* Visualisierung des Aufbaus der Benutzeroberfläche (Komponentenstruktur)<br />
* Informationen über verschiedene Zustände und Eigenschaften der einzelnen Bedienelemente<br />
* Unterstützung beim Auffinden von Bedienelemente durch Hervorhebung, Vorschaubilder und "Mouse-Over" Feedback<br />
* Filterung von passenden Aktionsblöcken aus der Block-Bibliothek abhängig von der jeweiligen UI-Technologie<br />
* Erstellung von Testsequenzen mittels "Drag and Drop" und/oder automatischer Aufzeichnung<br />
* Experimentelles Ausprobieren von Blöcken, Testsequenzen und Bedienelement-Pfaden<br />
* Übernehmen von Testsequenzen in das Testprojekt<br />
<br />
=Beschreibung=<br />
[[Datei:GuiBrowser openButton marked.jpg|200px|thumb|right|Schaltfläche zum öffnen der Benutzeroberfläche]]<br />
Die "expecco GUI Tests Extension" bildet eine einheitliche Basis zur Interaktion mit Anwendungen mit grafischer Benutzeroberfläche (GUI). Dabei werden unterschiedliche Technologien unterstützt. Die eigentliche Anbindung an die GUI-Anwendung und deren Steuerung wird von der jeweiligen Erweiterung (plugin) für die konkrete UI-Technologie realisiert. Entsprechende Erweiterungen sind für eine Vielzahl von Technologien erhältlich - z.B. Qt, Java/Swing, MFC, DevExpress, Android. Es muss also mindestens ein konkretes UI-Technologie Plugin vorhanden sein um die "expecco GUI Tests Extension" sinnvoll verwenden zu können. Andererseits können auch mehrere Anwendungen, auch in unterschiedlichen Technologien erstellte, gleichzeitig angesprochen und getestet werden. Somit können, z.B. bei Integrationstests, End-to-End Tests durchgeführt werden, welche innerhalb eines Testlaufs sowohl mobile als auch webbasierte und klassische Oberflächen bedienen und verifizieren. <br />
<br />
Nachdem in expecco ein Projekt erstellt oder geöffnet wurde kann über die Schaltfläche "GUI Test Ansicht Öffnen" die Benutzeroberfläche der "expecco GUI Tests Extension" geöffnet werden.<br />
<br />
==Benutzeroberfläche==<br />
<br />
[[Datei:GuiBrowser mainView labled ger.jpg|400px|thumb|right|Abb1: Gliederung der Hauptansicht]]<br />
[[Datei:GuiBrowser mainView usageFlow ger.jpg|400px|thumb|right|Abb2: Bedienfluss]]<br />
Eine Übersicht über den Aufbau, die Verwendung und die Funktionen der Benutzeroberfläche. Abbildung 1 Zeigt die Gliederung der Hauptansicht. In Abbildung 2 wird der Bedienfulss dargestellt.<br />
<br />
;Verbindungsaufbau<br />
: Eine Auflistung der verfügbaren Benutzer-Oberflächen Technologien. Per Klick auf eine der Schaltflächen wird der Verbindungsaufbau der jeweiligen UI-Technologie gestartet. Nach dem Verbindungsaufba erscheint die Anwendung in der Benutzeroberflächenstruktur (Hierarchie der Komponenten).<br />
<br />
;Benutzeroberflächenstruktur<br />
: Zeigt alle verbundenen und nicht verbunden Anwendungen. Unter jeder Anwendung wird der Aufbau der Benutzeroberfläche mit allen verfügbaren Bedienelementen dargestellt. Beim Aufklappen einer nicht verbundenen Anwendung wird versucht die Verbindung wieder herzustellen, falls diese verloren ging oder noch nicht bestand. Die Selektion eines Bedienelements oder einer Anwendungen aktualisiert die Menge der dazu passenden Aktionen sowie die Ansicht der Block-Bibliothek, Eigenschaftenübersicht, Bedienelementübersicht und den Bedienelementpfad.<br />
<br />
;Werkzeuge<br />
: Eine Auflistung verschiedener Werkzeuge. Ein Klick auf eine der Schaltflächen löst die Aktionen aus. Einige Aktionen sind von der Selektion in der Benutzeroberflächenstruktur abhängig.<br />
: '''Alle Verbindungen Trennen'''<br />
:: Trennt alle Verbindungen aller Technologien.<br />
: '''Ausgewählte Verbindung trennen'''<br />
:: Trennt die Verbindung bezüglich des in der Benutzeroberflächenstruktur ausgewählten Bedienelementes.<br />
: '''Aktuallisieren'''<br />
:: Aktuallisiert die obersten Bedienelemente aller verbundenen Anwendungen.<br />
: '''Kinderelemente erneut Laden'''<br />
:: Aktuallisiert die Kinderelemente bezüglich des in der Benutzeroberflächenstruktur ausgewählten Bedienelementes.<br />
: '''Hervorheben'''<br />
:: Hebt das in der Benutzeroberflächenstruktur ausgewählte Bedienelement in der Benutzeroberfläche hervor.<br />
: '''Zeiger Folgen'''<br />
:: Wenn diese Funktion aktiviert wurde, folgt die Selektion der Benutzeroberflächenstruktur automatisch dem unter dem Mauszeiger befindlichen Bedienelement (Quick-Scan).<br />
: '''Aufzeichnung für alle Anwendungen beginnen'''<br />
:: Beginnt die automatische Aufzeichnung einer Testsequenz für alle verbundenen Anwendungen. Während der Interaktion mit der/den Benutzeroberfläche(n) wird die Testsequenz im Sequenzeditor generiert. Befindet sich bereits eine Sequenz im Sequenz-Editor, so wird diese fortgesetzt.<br />
: '''Aufzeichnung für alle Anwendungen beenden'''<br />
:: Beendet die Aufzeichnung für alle verbundenen Anwendungen.<br />
<br />
;Eigenschaftenübersicht<br />
: Listet verfügbare Eigenschaften des ausgewählten Elements auf. Selektion einer der Eigenschaften ändert die Ansicht der Block-Bibliothek, so dass nur Blöcke die sich auf diese Eigenschaft beziehen, angezeigt werden.<br />
<br />
;Block-Bibliothek<br />
: Zeigt die verfügbaren Blöcke aus der Technologiebibliothek, für das in der Benutzeroberflächenstruktur ausgewählte Element an. Unter "Aktionen" werden die Blöcke aufgeführt, die passend zum Element sind, beispielsweise das Setzen des Textes einer Label-Komponente. Unter "Eigenschaften" werden die Blöcke aufgeführt, die für eine unter "Eigenschaftenübersicht" ausgewählte Eigenschaft relevant sind, wie zum Beispiel das Abfragen der Sichtbarkeit.<br />
: Wird ein Block selektiert, so ändert sich die Ansicht der Editoransicht auf "Test" und der Block wird angezeigt.<br />
: Zieht man den Block mit der Maus über die Editoransicht, so wechselt die Ansicht auf "Sequenz". Lässt man den Block in der Sequenz fallen, so wird er als Schritt an die Sequenz angefügt.<br />
<br />
;Editoransicht<br />
: Unter "Test" wird der in der Blockbibliothek ausgewählte Block dargestellt. Die Pins können editiert werden. Anschließend kann der Block gegen die Anwendung ausgeführt werden. Die Editoransicht wechselt dabei auf "Lauf". Die Ausführung des Blocks kann hier überprüft werden. Aus der Test-Ansicht heraus kann der Block direkt mittels der Schaltfläche "In Sequenz Übernehmen" in die Testsequenz übernommen werden. Der Block wird als Schritt an die Testsequenz angefügt.<br />
: Die "Sequenz"-Ansicht stellt die aktuelle Testsequenz dar. Diese kann manuell oder durch Aufzeichnung erweitert werden. Die Testsequenz lässt sich ausführen, die Ansicht wechselt dann auf "Lauf". Hier kann die Ausführung der gesamten Testsequenz überprüft werden. In der "Sequenz"-Ansicht lässt sich die gesamte Sequenz in das aktuelle Projekt übertragen. Dazu wird die Schaltfläche "In Projekt Übernehmen" ausgewählt.<br />
<br />
;Bedienelement-Pfad<br />
: Zeigt den Pfad des in der Benutzeroberflächenstruktur ausgewählten Bedienelements. Der Pfad kann verändert werden; insbesondere sollten längere verschachtelte Containerpfade durch "*" ersetzt werden, damit die Addressierung der Komponente möglichst unabhängig von späteren Änderungen der UI-Hierarchie werden. Mit der Schaltfläche "Pfad-Prüfen" wird sichergestellt, daß der geänderte Pfad immer noch das in der Benutzeroberflächenstruktur ausgewählte Bedienelement referenziert.<br />
<br />
;Bedienelementübersicht<br />
: Zeigt Informationen des in der Benutzeroberflächenstruktur ausgewählten Bedienelementes an und stellt, falls möglich, eine Vorschau dar. Ein Klick auf die Vorschau öffnet das Bild in Originalgrösse.<br />
<br />
<br style="clear: both" /><br />
<br />
=Bedienelementpfad=<br />
Der "Bedienelementpfad" dient als Referenz auf Bedienelemente innerhalb der Benutzeroberfläche. Er ist vergleichbar mit der XPath-Notation im XML Umfeld. Komponentenpfade werden bei der Testentwicklung festgelegt und später, bei der Testausführung, verwendet um UI-Komponenten zu referenzieren. Der Pfad eines ausgewählten Bedienelements wird unten im "Bedienelement-Pfad" Feld angezeigt, und bei Auswahl eines Elements automatisch aktualisiert. Umgekehrt kann er an dieser Stelle auch geändert und überprüft werden, welche(s) Element(e) durch einen gegebenen Pfad referenziert werden. Der Pfad muss nicht vollständig sein - er kann dynamische Teile enthalten. Dies erhöht die Flexibilität und macht die Testsequenz robuster gegenüber einer möglichen späteren Änderung der getesteten Benutzeroberfläche. Insbesondere gegenüber Änderungen der Hierarchie, z.B. wenn weitere Containerelemente eingefügt werden.<br />
<br />
'''Hinweis: ''' <br />
Viele Benutzeroberflächen ändern während der Ausführung die Struktur dynamisch. Oft werden Container- und Bedienelemente während dem Lauf hinzugefügt oder entfernt. In solchen Fällen sind dynamische Teile im Pfad sehr hilfreich.<br />
<br />
==Pfade Definieren==<br />
Ein typischer Pfad kann wie folgt aussehen:<br />
/frame[@name='Notepad']/root pane/layered pane/panel/panel/panel/tool bar/push button[2]<br />
Dieser Pfad beschreibt die vollständige Adressierung des zweiten Buttons in einer Toolbar, welche ihrerseits in einer verschachtelten Containerhierarchie (panels) liegt.<br />
<br />
Der Pfad wird beschrieben durch eine Liste von Identifikatoren, getrennt durch und beginnend mit "/". Jeder einzelne Identifikator beschreibt eine Unterkomponente des bereits durch den linken Teilpfad beschriebenen Elements. "/frame[@name='Notepad']" referenziert das Hauptfenster der Anwendung. "root pane", "layered pane", "panel" etc. referenzieren jeweils das korrespondierende Kindelement. Zur Referenzierung einer einzelnen konkreten Komponente wird der Pfad beginnend mit dem obersten Bedienelement schrittweise verfolgt. <br />
<br />
Im Beispiel wird zuerst versucht, das Fenster mit Namen "Notepad" zu finden. Das Fenster hat ein oder mehrere Kinder, dessen Identifikator zu "root pane" passt. "root pane" wiederum hat Kinder die zum Identifikator "layered pane" passen und so weiter.<br />
<br />
Die Syntax eines jedes individuellen Identifikators ist: <br />
/<KnotenIdentifikator><[Optionaler Selektor]><br />
<br />
===KnotenIdentifikator===<br />
Der KnotenIdentifikator beschreibt den Typ des Bedienelementes das gesucht wird.<br />
<br />
'''Mögliche Identifikator:'''<br />
;Der Typ des Bedienelements<br />
: Das Ergebnis sind eine oder mehrere Bedienelemente die dem angegebenen Typ entsprechen.<br />
;Der "Jeder" Identifikator ("*")<br />
: Löst den Rest des Pfades unter Verwendung alle Kindelemente, unabhängig vom Typ des aktuell aufzulösenden Identifikators auf.<br />
<br />
Beispiel:<br><br />
Vollständiger Pfad:<br />
/frame[@name='Notepad']/root pane/layered pane/panel/panel/panel/tool bar/push button[2]<br />
Der selbe Pfad mit "*" Identifikatoren:<br />
/*[@name='Notepad']/*/layered pane/*/panel/*/tool bar/push button[2]<br />
<br />
Diese zwei Pfade adressieren in obigem Fall das selbe Bedienelement. Jedoch ist die zweite Variante unempfindlicher gegenüber geänderten Komponenten in der Hierarchie. Zum Beispiel könnten die Entwickler der zu testenden Anwendung eine panel-Komponente durch eine box-Komponente ersetzen. Der erste Pfad würde dann im Testlauf zu einem Fehler wegen nicht auflösbarem Pfad führen.<br />
Zu beachten ist, dass der "*"-Identifikator zur als Platzhalter einer einzelnen Komponente dient. Um den Pfad auch robust gegenüber zusätzlich in die Hierarchie eingebrachte Komponenten zu machen, sollte die "//"-Notation (siehe unten) verwendet werden.<br />
<br />
===Selektor===<br />
Der Selektor ist Optional. Er wird benötigt um Bedienelemente mit gleichem Typ zu unterscheiden. Gibt es beispielsweise 3 Buttons als Kinder eines Bedienelements, so kann mit dem Selektor der zu referenzierende Button festgelegt werden. Der Selektor wird in eckigen "[ ]" Klammern angegeben. Der Selektor wird nach der Auflösung des KnotenIdentifikators auf das Ergebnis angewendet. Gibt es zum Beispiel ein Bedienelement mit zwei Buttons und zwei Checkboxen als Kinder, und der Identifikator liefert als Ergebnis 2 Buttons, so wird der Selektor auf diese 2 Buttons angewendet.<br />
<br />
'''Mögliche Selektoren:'''<br />
;Der "Index" Selektor<br />
: Wählt das Bedienelement anhand des Index. Der Index ist 1 basiert (i.e. [1] bezieht sich auf die erste Komponente).<br />
;Der "Schlüssel-Wert" Selektor (engl. "Key-Selector")<br />
: Wählt das Bedienelement dessen Schlüssel den angegebenen Wert hat. Die Menge der möglichen Schlüssel ist abhängig von der jeweiligen UI-Technologie, der betroffenen Komponente und deren Attribute. Typische Schlüssel sind "name", "id", "label", "value" etc. Bei einigen Komponenten sind auch dynamische Schlüssel möglich, so dass diese erst während der Laufzeit angelegt werden. <br />
<br />
Beispiel (Index Selector): <br />
/*/tool bar/push button[2]<br />
Wählt den zweiten Button innerhalb der Toolbar aus. <br />
<br />
Beispiel (Schlüssel Selector): <br />
/*/tool bar/push button[@name='Save As...']<br />
Wählt den Button aus dessen Attribut "name" (= Schlüssel) den Wert "Save As..." hat.<br />
<br />
===Platzhalter Schreibweise===<br />
Die Platzhalterschreibweise ("//") kann Pfade stark verkürzen und flexibel gegenüber zusätzlich eingefügten Hierarchieebenenen machen. "//" ersetzt dabei ganze Teile des Pfades. Der Vergleich findet nicht nur auf Kinder eines Bedienelementes statt, sondern auf ganze Teilpfade. <br />
<br />
Beispiel:<br/><br />
Angenommen der vollständige Pfad eines Buttons wäre folgender:<br />
/frame[@name='Notepad']/root pane/layered pane/panel/panel/panel/tool bar/push button[@name='Save As...']<br />
<br />
Außerdem angenommen, die Anwendung hat nur einen Button mit dem Namen "Save As...", welche sichtbar ist. Dann kann der Pfad mittels Platzhalterschreibweise wie folgt verkürzt werden:<br />
//push button[@name='Save As...']<br />
<br />
Noch kürzer ginge es, wenn nur ein Bedienelement mit Namen "Save As..." existiert. Dann wäre folgender Pfad möglich:<br />
//*[@name='Save As...']<br />
<br />
Auch ist es möglich, wie im folgenden Beispiel, nur Teile des Pfades mit Platzhaltern zu versehen:<br />
/*[@name='Notepad']//panel//tool bar/*[@name='Save As...']<br />
<br />
'''Hinweis:'''<br />
Die verkürzten Pfade in den oben gezeigten Beispielen sind wesentlich unanfälliger gegenüber Änderungen im Layout der Benutzeroberfläche. Jedoch erhöht es je nach Anwendung und Benutzeroberfläche auch die Wahrscheinlichkeit, dass mehrere passende Bedienelemente gefunden werden. Dies wird dann ebenfalls zur Laufzeit zu einem Fehler führen ("Nicht eindeutiger Komponentenpfad"). In obigem Beispiel könnte dies passieren, wenn im UI neben dem Button auch ein Menueintrag mit dem selben Text existiert.<br />
In der Praxis wird die Auswahl des geeigneten Pfades immer einen Kompromiss aus Flexibilität (möglichst kurz) und Eindeutigkeit darstellen.</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Release_Notes_expecco/en&diff=6191Release Notes expecco/en2016-05-31T07:37:56Z<p>Mb: /* Release 2.9 (Q1/2016) */</p>
<hr />
<div>See also: [[Future_releases_expecco | Planned in one of the future Releases]]<br />
<br />
== Release 2.9 (Q1/2016) ==<br />
* Feature: [[Appium Plugin Reference | Appium-Plugin]]: Add recorder<br />
* Feature: Appium Plugin: Update capabilities<br />
* Feature: Appium Plugin: Settings Dialog for setting up external auxiliary programs (adb, Appium Server, AVD Manager, SDK Manager)<br />
* Feature: Appium Plugin: New menu for launching auxiliary programs (Appium Server, AVD Manager, SDK Manager)<br />
* Feature: Appium Plugin: New buttons in Android Wizard to refresh the device list, launch AVD Manager, install APKs.<br />
* Feature: Appium Plugin: Save and load connection settings in and from attachments in test suite.<br />
* Feature: Appium Plugin: Allow editing and copying of connection settings.<br />
* Feature: Appium Plugin: Allow adding arbitrary capabilities for forward compatibility.<br />
* Feature: Appium Plugin Bundle: Update contents, in particular use Appium Server 1.4.16.<br />
* Feature: Appium Plugin Bundle: Remove Android emulator from bundle as it is huge. If needed, download and install it separately.<br />
<br />
* UI enhancement: Appium Plugin: More verbose warning dialogs.<br />
* UI enhancement: Appium Plugin: Remove obsolete "Emulator Settings" from connection dialog (using the wizard is superior now).<br />
* UI enhancement: Appium Plugin: Make newCommandTimeout capability user visible<br />
* UI enhancement: Appium Plugin: Remove unimportantView from default capabilities<br />
* UI enhancement: Appium Plugin: Automatically select entry in Android Wizard if only one is available.<br />
* UI enhancement: Appium Plugin: Highlight unknown capabilities to give a hint in case of bad spelling.<br />
* UI enhancement: Appium Plugin: Add a search filter for packages in the Android Wizard.<br />
<br />
* STD-LIB: Image Save block supports writing of jpg images.<br />
<br />
* Appium Library: New blocks for multi-touch actions<br />
* Appium Library: New block for reading capabilities from files<br />
* Appium Library: New blocks for reading logs<br />
* Appium Library: New block "Find Elements by XPath" for finding sets of elements<br />
* Appium Library: New blocks for consecutive actions on single elements<br />
* Appium Library: New block for taking screenshots<br />
* Appium Library: New blocks for pressKeyCode API, make old blocks (sendKeyEvent API) obsolete<br />
<br />
* Localization: Appium Plugin: German translation mostly complete.<br />
<br />
* Documentation: Update and add more documentation to Appium library.<br />
<br />
* Fix: Appium Plugin: Timeout in Android Wizard if adb does not return.<br />
* Fix: Appium Plugin: Do not cut off multi-line status messages in Android Wizard.<br />
* Fix: Appium Plugin: Fix error and bad behavior when cancelling file dialog in connection settings.<br />
* Fix: Appium Plugin: Do not drop connection settings on connection error.<br />
* Fix: Appium Plugin: Use Java path from Settings <br />
* Fix: XML/XPath - accepts underscore ('_') and Unicode characters in element and attribute names.<br />
* Fix: RemoteAccess Plugin - fix error waiting for prompt<br />
* Fix: RemoteAccess Plugin - fix response in same line as command<br />
* Fix: Java GUI Plugin - fix error in "Verify Path"<br />
<br />
== Release 2.8 (Q4/2015) ==<br />
<br />
'''Notice: You have to install a patch for expecco 2.7.5, if you want to load a Testsuite which was edited in expecco 2.8 and uses some of the new features! [[release2.8_incompatibilities|(More info)]]'''<br />
<br />
* Feature: [[TableDrivenBlock Element | Table driven actions]]; these offer a simpler, table oriented interface<br />
* Feature: [[Appium Plugin Reference | Appium-Plugin]] for Android and Apple IOS test automation for mobile devices<br />
* Feature: Variable number of pins in groups ([[DiagramElements-Pin/en#Variable_Number_of_Pins | "Variable Pin Groups"]])<br />
* Feature: First release of the [[User_Defined_Menu_Items#Useful_Building_Blocks_for_Custom_Menu_Operations | Expecco Reflection Library]] (to automate expecco itself) <br />
* Feature: Enum datatype: support for individual assigned enum values, described in the [[ Datatype_Editor/en#Enumeration_Types | Datatype Editor Documentation ]] and the [[ Datatype_Element/en#Enumeration_Types | Datatype Element Documentation ]] and also the [[ Expecco_API/en#Enum Type Functions | API Documentation ]].<br />
* Feature: [[ Starting_expecco_via_Command_Line#Expecco_Rest_Service_Interface | Rest service ]] for remote controlling expecco execution<br />
* Feature: New [[ElementaryBlock_Element/en#Ruby_Script_Blocks|Ruby actions]]<br />
* Feature: Better execution directory settings for [[ElementaryBlock Element/en#Shell_Script_Blocks|Shell blocks]]<br />
* Feature: New step attributes for more specific [[ CompoundBlock_Editor-CompoundWorksheet_Editor/en#Step_Specific_Options_.28Context_Menu.29 | "skip in log/trace"]] options (for looping actions)<br />
* Feature: New user preference setting to ignore all [[CompoundBlock_Editor-CompoundWorksheet_Editor/en#Step_Specific_Options_.28Context_Menu.29 | skip-in-log]] attributes (for debugging)<br />
* Feature: "immediate fork new process" flag now also in block description or dynamically from elementary code<br />
* Feature: Improved performer data type handling; virtual steps now only accept valid performers, and freeze value choices are filtered for valid performers.<br />
* Feature: Option to start background action before or after pre-action<br />
* Feature: New constraint datatype type (for better freeze value selection)<br />
* Feature/Fix: compatibility of indexOf() / lastIndexOf() javaScript functions (allow substring search)<br />
* Feature: Data inspector for strings shows another (XML-DOM) tab if the string is an XML string. This tab shows the parsed XML DOM-tree.<br />
* Feature: Attachments can now be declared as binary file attachment. These will not be interpreted; especially, no cr/lf translation and utf8 or similar character translation is performed. Binary attachments are required, e.g. to embed jar or other code files.<br />
<br />
* UI enhancement: Multiline labels in steps (use "\" as line-separator)<br />
* UI enhancement: Additional custom headline and custom text block in reports (can be filled in right before printing).<br />
* UI enhancement: Can now also set breakpoints on steps and code lines of readonly actions (e.g. in an imported library)<br />
* UI enhancement: Undo gives a warning when about to undo past the previous file-save state<br />
* UI enhancement: Added a menu item in "Extras" - "Debugging" to stop [[ User_Defined_Menu_Items#Asynchronous_.28Background.29_Actions | background menu actions ]]<br />
* UI enhancement: Added more convenient pin-comment editing support to the schema editor<br />
* UI enhancement: Text editor has a new "split" menu function in its tools-submenu<br />
* UI enhancement: Better "New Step" and "Replace Step" dialogs in the diagram editor (showing preview, code and contents; also show attachements).<br />
* UI enhancement: Better autoconnect and matching blocks search algorithm in the "Place and Select New Step" function (i.e. New Step function, when an output pin is selected)<br />
* UI enhancement: New scale diagram function (scale and spread multiple steps)<br />
* UI enhancement: Lint performs a number of checks on a block being edited and gives immediate warnings in the info line (same checks as in the tree's error- and special search tabs)<br />
* UI enhancement: New lint-error check rules to detect consumed pin values in loops and multi-triggered chains.<br />
* UI enhancement: Double click on a search item to navigate to it in the tree<br />
* UI enhancement: Codeview and network view in the activitylog indicate that they are readonly.<br />
* UI enhancement: Secondary navigation tree for drag&drop.<br />
* UI enhancement: Warn if it is due time to check for updates.<br />
<br />
* STD-LIB: Collection creator and multi-setter blocks with variable number of pins (alternating key-value pairs)<br />
* STD-LIB: New DLL-Mapping block<br />
* STD-LIB: New blocks "File [modification time]", "File [access time]" and "File [creation time]".<br />
* STD-LIB: Additional blocks for event queue handling.<br />
* STD-LIB: Additional blocks for static step-local storage.<br />
* STD-LIB: Better versions for FAIL/WARN/INFO, LogFAIL, logWARNING and logINFO. New "Transcriber with Timestamp" action.<br />
* STD-LIB: Fixed some collection-type issues (now pins are #-template-typed, instead of Collection), which required a downcast in many suites.<br />
* STD-LIB: New blocks: "Trigger Periodically" and "Counter"<br />
* STD-LIB: New blocks: "Enumtype symbol<->integer"<br />
<br />
* Fix: Freeze value menu of unions of enums did not merge the individual enum values<br />
* Fix: Freeze value menu of unions of constraint dataType-types<br />
* Fix: The search breakpoints function (in the errors-tab of the treeview) now also finds statement breakpoints.<br />
* Fix: Fixes and improvements in the SOAP, REST and WSDL frameworks<br />
* Fix: Enum numeric value assignments were lost sometimes when saving/restoring<br />
* Fix: Search for references of a variable did not find them in imported libraries<br />
* Fix: Report of looped testplans (pre-action was reported multiple times)<br />
* Fix: behavior of cancel pin (did neither drive triggerOut-pin, nor exception-pin)<br />
* Fix: Fixes for crashes in follow mouse and backward (xPath) compatiblity in WindowsAutomation Plugin<br />
* Fix: The embedded type editor for defined classes lost its code window, when reopened on another class type.<br />
* Fix: Proper class naming is now enforced in the type editor.<br />
<br />
&nbsp;<br />
<br />
== Release 2.7.5 (2015-06-09) ==<br />
<br />
'''New features''':<br />
* The JavaFX plugin now supports keyboard input. Use the block "Request Focus" to focus an input field and the block "Type Text" to enter any text.<br />
<br />
'''Bugfixes''':<br />
* The JavaFX plugin now provides improved connection handling.<br />
<br />
<br />
For expecco running under Linux you need GLIBC >= 2.14<br />
<br />
Tested technology versions:<br />
* Selenium<br />
* The Java Bridge requires a JDK version 1.6 or higher<br />
** JavaFX testing requires JavaFX 8<br />
* QT: Qt 2.6.3 (mingw,vs2008), Qt 4.8.4 (mingw, vs2008, vs2010, vs2013), Qt 5.4.2 (vs2010, vs2013)<br />
* .NET<br />
* MFC<br />
* HTML 5<br />
* DevExpress<br />
* Android<br />
* iOS<br />
* Windows CE/Mobile Phone<br />
* CANoe: 8.2 SP4<br />
* WSDL-Import: it is required that you re-import your WSDL-Definitions in your Testsuites<br />
&nbsp;<br />
<br />
==Release 2.7.1 ==<br />
* Convenient menu functions to add the special [[ Expecco_API#Using a Particular JVM Connection / Executing Groovy on a Possibly Remote Machine | "java" and "groovy" ]] input pins to a Groovy elementary block.<br />
* Standard library: new blocks: "Directory [ Contents as Filenames ]", "Directory [ Contents as Pathnames ]", "Directory [ Contents as Basenames ]", "File [ isReadable? ]" and "File [ isWritable? ]"<br />
&nbsp;<br />
<br />
==Release 2.7 ==<br />
* Patches go into a release specific directory (e.g. patches-2.7.0.5)<br />
* configurable external editor for attachments and csv data (eg. excel or openoffice calculator)<br />
* tree view: markers in search lists; add to/remove from remembered list menu items<br />
* tree view: folders can have tags, too<br />
* tree view: per-tag icons in tree<br />
* [[ Starting_expecco_via_Command_Line/en#Utility_Functions | "--diff" command line option ]]<br />
* [[ Starting_expecco_via_Command_Line/en#Startup | "--settings" command line option ]]<br />
* Scatter/Gather composition of test plans from multiple suites [[ Starting_expecco_via_Command_Line/en#Scatter Gather Test Suite Composition | via command line arguments ]]<br />
* library: background OS process and background block actions<br />
* improved type checks and preference settings<br />
* schema editor: cursor up/down keys in pin name fields<br />
* schema and diagram editor: additional menu functions in multiple-pin selection menu<br />
* new blocks in the StandardLibrary: ExceptionClassifier, WriteCSV, Load/Save Environment from/to CSV<br />
* [[ SAP Testing | SAP plugin and VBScript action blocks ]]<br />
* change in the handling of Groovy callbacks. Please read [[ Expecco_API/en#Attention_.2F_Warning | "Attention / Warning" ]] and [[ Expecco_API/en#Special_Functions | "Special Functions"]] in the Groovy API documentation.<br />
* improved Groovy debugging support<br />
* new common Android and iPhone/iPad testing framework<br />
* option to save a per-run report, when a suite is executed in a loop (especially useful, when running until fail or until success)<br />
* block assertions: assert-executed / assert-all outputs written / assert any output written<br />
* License server support<br />
&nbsp;<br />
<br />
==Release 2.6.2 bugfix release - April 2014 ==<br />
Thus is a stable release consisting of the 2.6.1 base version INCLUDING all 2.6.1 patches (up to April).<br />
<br />
&nbsp;<br />
<br />
==Release 2.6.1 update - Januar 2014 ==<br />
* [[ Expecco_API#Groovy_Elementary_Blocks | groovy action]]: the java-bridge can be passed in via pin named "java" or environment var named "JAVA". GroovyShell can be passed in via pin named "groovy" or variable named "GROOVY". Pins are optional for backward compatibility.<br />
&nbsp;<br />
<br />
==Release 2.6 - November 2013 ==<br />
* New testplan execution loop mode: "loop until required test fails"<br />
* More options for automatic check for and installation of updates & patches<br />
* Better default directories in file open/save/import dialogs.<br />
* Tuned automatic reimport when multiple libraries are imported.<br />
* Improved Java object inspector<br />
* New attachment contents representation modes.<br />
* Step tooltips include the underlying block's tree location.<br />
* Shift click on connection selects all underlying connections.<br />
* Give an indication (colorize menubar) if running with root/Admin rights.<br />
* Option to put the custom operations menu into the top menu<br />
* Additional tab in tree view to search by item-type<br />
* Additional search options for interfaces and concrete actions<br />
* Various bug fixes & enhancements:<br />
** handle duplicate attachment filenames, <br />
** fixed some type conversions, <br />
** fixed clipboard handling under XWindow/Qt desktop, <br />
** fixed non-changing testplan/testitem spec page.<br />
** added string search in resources, skills and inventories<br />
** no longer close expanded tree items when reimporting<br />
** fixed making an imported library writable, which is imported by another sub-import<br />
** fixed freeze of template pin to boolean/enum<br />
** fixed enum values which start with a digit (aka '001 aaa')<br />
** remove freeze value connection via menu<br />
&nbsp;<br />
<br />
==Release 2.5 ==<br />
* Can refer to [[ Environment_Editor#Initialization Types | shell environment variables ]] in an environment variable's initializer.<br />
* New elementary block type: Groovy Code. Installs script code to be executed in a Java target or a local JVM.<br />
* New keyword driven actions<br />
* Additional checks in save dialogs to prevent overwriting another testsuite/library<br />
* Optional automatic reimport or check for reimportable imports (configure via settings dialog)<br />
* Additional freeze value validation when types are edited<br />
* New plugin: Jar Import<br />
* New and much improved manual test import plugin<br />
* Speedup, impovements and fixes in the JavaBridge plugin<br />
* Menu actions can [[ Misc_Editor#Background_Actions | execute in the background ]] (name as "...&")<br />
* Background actions in testplan and testcase<br />
* Much faster: startup, plugin loading and bridge communication<br />
* Multiple freeze value menu organizations for enum types (hierachical selection)<br />
<br />
===Release 2.5.1 - July 2013 ===<br />
<!-- This is a bugfix release, in which various patches and small enhancements from the past few months have been integrated. <br />
<br><br />
--><br />
* Automatic & semiautomatic update from server<br />
&nbsp;<br />
<br />
==Release 2.4 - Februar 2013 ==<br />
This is a bugfix release, in which various patches and small enhancements from the past few months have been integrated.<br />
<br>&nbsp;<br />
<br>&nbsp;<br />
<br />
==Release 2.3 - December 2012 ==<br />
* New integrated GUI Browser<br />
* New menu functions: "minimize/restore all Windows"<br />
* Polarion compatible report<br />
* Improved Project-Diff-Browser<br />
&nbsp;<br />
<br />
==Release 2.2==<br />
* New SchemaEditor menu functions: copy/paste pin interface<br />
* New plugin: [[GembirdPowerControlPlugin_Reference#|Gembird Power Control Plugin]]<br />
* New debug-menu function: "close all temporary windows"<br />
* [[Probe | Probes]]; easy recording and check of pinValues<br />
* Junit compatible report<br />
* HTTP and SOAP transmission log (optional on Transcript)<br />
* Fixed WSDL/SOAP for document-style operations<br />
* Better inspector (hex dump tab, hex representation of floats)<br />
&nbsp;<br />
<br />
==Release 2.1 - November 2011== <br />
* Condition variables for simple (and easy to use) control of testcase execution<br />
* [[Webservices#REST_Baustein|REST-Call]] blocks<br />
* Option to disable logging of activityNotifications (from the underlying language framework)<br />
* URL-override for SOAP service call blocks via the SOAP_URL environment variable.<br />
* Access to the certificate store (for SSL/HTTPS), allows adding and removing individual certificates<br />
* Elementary steps can have a variable number of output-pins (for multiplexer, dispatcher, round-robin generators etc.) <br />
* New menu function: "Generate Value Extractor" for Dictionary-typed pin values. (in the activityLog, output pin-data menu)<br />
* New tree-menu function: "Refactor"->"Change Variable Access", to search for and replace environment variable references.<br />
* New datatype [[Datatype_Element#Special_Types | "struct" ]], to represent arbitrary compound (struct) values.<br />
* GUI improvements: better annotation-text editors; line numbers, tags in file viewer<br />
* Allow for multi pin-value parametrization in testplan (block with multiple inputs in a testplan item) <br />
* Proxy support for HTTP-fetch blocks<br />
* Recording feature for Java Swing GUIs <br />
* Enhanced Java Swing Function Block Library<br />
* GUI Browser improvements: tree view with widget specific icons, record tree actions <br />
&nbsp;<br />
<br />
==Release 2.0==<br />
* Elementary steps can have a variable number of input-pins (improves the format, plus, string-concat and many other blocks)<br />
* Statistic page added to the project editor<br />
* Improved manual test import plugin; nicer Manualtest runner GUI; user definable manual test GUI<br />
* Allow for pin-value parametrization in testplan (block with a single input parameter in a testplan item)<br />
* Configurable max. cleanup time after terminating a run; Confirmation Dialog when longer.<br />
* ActivityLog: added "Select in Tree" from log-entry<br />
* HTTPS / SSL Support for HTTP blocks<br />
&nbsp;<br />
<br />
== Update Patch 1.9.1.1 ==<br />
(patch applied to the iX-Demo CD)<br />
<br />
* fixed the settings dialog's "mark new items" checkbox.<br />
* improved the termination timeout handling (long time spent in post action)<br />
* fixed the "search for active block" button's function<br />
* fixed a scroll-offset bug in the diagram editor<br />
&nbsp;<br />
<br />
== Release 1.9.1 ==<br />
Release date: Jan 2011<br />
<br>(release candidate: 1.8.3.30)<br />
<br />
* New blocks in the [[ StandardLibrary_ReleaseNotes#1.8.3 | StandardLibrary 1.8.3 ]] and [[ StandardLibrary_ReleaseNotes#1.9.1 | StandardLibrary 1.9.1 ]]<br />
* Separate model language translations<br />
* URL attachments<br />
* EBCDIC support<br />
* HP Quality Center Interface improved (up/download of tests and test-sets, autologout)<br />
* New plugin: Android Mobile Apps Interface<br />
* XMI import plugin improved (can now import test cases from Enterprise Architect models)<br />
* [[JavaSwing_Reference|JavaSwing plugin]] improved<br />
* Much improved Java-Bridge functionality: can now inject code dynamically<br />
* [[SeleniumLibrary_Reference|Web Interfacing]] updated to use newest Selenium Version.<br />
* Improved browser profile handling (for example for proxy setup)<br />
* Firefox profile now includes Firebug and Firepath for web page analysis<br />
* additional [[SeleniumLibrary_Reference|Web interface]] blocks (waitForAndXXX, table-accessors, table enumerators)<br />
* Optional cyclePeriod when looping a testplan<br />
* Suspend new activities when a debugger is open (option)<br />
* [[ WebSphere_MQ | WebSpere MQ (IBM Middleware interface)]] client interface plugin/library<br />
* Tagsearch includes Step-Tags<br />
* Can now save individual TestCase- and ActivityLog results to a file<br />
* New elementary block-type: Batch-script<br />
* Search for steps by name in result log<br />
* New variable-types in environment: [[ Environment Editor#Initialization_Types | SecretConstant, RequestFromUserWhenFirstUsed and SecretFromUserWhenFirstUsed ]] <br />
* Screenshot also via main menu<br />
* Code-editor now supports code completion (CTRL-Shift) and variable-correction (define as local or pin)<br />
* Optional sound when operator input is required<br />
* More execution control in the Control & Monitoring Window.<br />
* "Abort TestPlan" function in debugger.<br />
* Search for modified actions, search for values in tree<br />
* Improved XML-inspector (skip empty text, xml-text display)<br />
* Can now disable a plugin in the settings (will hide its menus)<br />
* Paste step with selected connection inserts the pasted step into the flow<br />
* improved single step function & breakpoint behavior<br />
* prerequisite package loading and prerequisite plugin checking<br />
* much improved [[AndroidLibrary_Reference | Android mobile-phone testing support]]<br />
* rename variable menu-function<br />
* improved references to variable search function (looks into code)<br />
* embedded inspector (better environment variable value display) in the activity log<br />
* webtest functionality upgraded to current selenium/firefox versions<br />
* regex matching text search in tree (in addition to existing glob-matching search)<br />
* search for consumed input value in cycles (lint)<br />
* pause on error option in blockTester<br />
* default parallelity of new steps is now "limited to 1"<br />
* grouping of user defined types<br />
* shrink-wrap of imported libraries<br />
* colorize by tag configuration<br />
* customizable operation menu<br />
* improved the diff-viewer, added attachment diffs<br />
&nbsp;<br />
<br />
== Release 1.8.2 ==<br />
Release date: Jul 2010 <br />
<br />
* Network Editor: allow connecting to a frozen pin (freeze to same value)<br />
* Network Editor: new menu function: "Extract Compound Action" (without replacing the selection)<br />
* Network Editor: new menu function: "Insert Step at Connection"<br />
* Network Editor: automatic "connect-through" when deleting steps from eni-eno chains<br />
* More testplan information for expeccoNET: operator needed; selectable testCases.<br />
* Search for halts and breakpoints<br />
* Breakpoint-toggling also in the log-viewer<br />
* Load resources from expeccoNET<br />
* New plugin: JIRA Interface (for issue validation)<br />
* New plugin: HP Quality Center Interface (up/download of test-suites)<br />
* New plugin/library: Swift-Message Handling<br />
* Fixed CTRL-a in some subviews<br />
* More attributes in annotations<br />
&nbsp;<br />
<br />
== Release 1.8.1 ==<br />
Release date: May 2010 (skipped for 1.8.2)<br />
<br />
* New blocks in the [[ StandardLibrary_ReleaseNotes#1.8.1 | StandardLibrary 1.8.1 ]]<br />
* Triggering Mailbox Pins (see Collect Block as an example)<br />
* ExecutionTime-Output pin<br />
* More search options (search for virtual, iterated and exception handling steps)<br />
* New step flags: "Skip Children in Trace", "Assert Output Written" and "Assert Executed"<br />
* New Settings flag "Open Debugger for Handled Exceptions"<br />
* Report: can now include screenshots and other images<br />
* Report: new "Print as Flat List" option.<br />
* Report: speedup for big PDF reports<br />
* Elementary Code Editor: Senders and References search now includes elementary code in search<br />
&nbsp;<br />
<br />
== Release 1.8.0 ==<br />
Release date: April 2010 (skipped for 1.8.1)<br />
<br />
* Different connection styles (direct, curved)<br />
* WSDL import plugin fixed and enhanced.<br />
* Some report improvements (more variables)<br />
* XML-RPC Blocks<br />
* Jira Plugin<br />
* Skill, Resource and Inventory Interface for expeccoNET<br />
&nbsp;<br />
<br />
== Release 1.7.4 ==<br />
Release date: Februrary 2010<br />
<br />
* New blocks in the [[ StandardLibrary_ReleaseNotes#1.7.4 | StandardLibrary 1.7.4 ]]<br />
* Implicit virtual block resolving specified in environment<br />
* Implicit virtual block resolving via virtual library specified in environment<br />
* Resource & skill access API fixed & enhanced<br />
* Enhanced display of virtual action in execution log<br />
* Fixed error-display in network if error occurs in action setup<br />
* Virtual blocks can now also be used as pre- and post-action<br />
* Fixed the input-pin handling of virtual blocks<br />
* [[Tools_TestSuiteDifferenceBrowser | TestSuite diff viewer]] (to compare two project versions)<br />
* New tree-menu-functions: "Generate Instance Creator" & "Generate Field Extractor"<br />
* New tree-menu-function: "Sort Children"<br />
* New type-kind: CType.<br />
* Added a new kind of inspector-view: CDatumInspector to show C-data in a structured, hierarchical list<br />
* Non-Blocking DLL-calls<br />
&nbsp;<br />
<br />
== Release 1.7.3 ==<br />
Internal Release date: January 2010<br />
<br />
* New blocks in the [[ StandardLibrary_ReleaseNotes#1.7.3 | StandardLibrary 1.7.3 ]]<br />
* Can now force connect of incompatible pins with CTRL-key<br />
* Default inventory now in testSuite (moved up from the testplan)<br />
* PostLoad & preUnload actions for suite and imported libraries<br />
&nbsp;<br />
<br />
== Release 1.7.2 ==<br />
Release date: October 2009<br />
<br />
* VariableList: added nameFilter and sortability<br />
* New blocks in the [[ StandardLibrary_ReleaseNotes#1.7.2 | StandardLibrary 1.7.2 ]]<br />
&nbsp;<br />
<br />
== Release 1.7.1 ==<br />
Release date: September 2009<br />
<br />
* When saving test suites that were originally signed with a expecco demo version, convert all demo signatures to final signatures - if you have got a dongle.<br />
* Now can load test suites saved with expecco-developer with expecco-pro (and developer with pro - as long as you do not features that are supported only by expecco-pro in your test suite)<br />
* all blocks tagged in the [[ StandardLibrary_ReleaseNotes#1.7.1 | StandardLibrary 1.7.1 ]]<br />
* new blocks in the [[ StandardLibrary_ReleaseNotes#1.7.1 | StandardLibrary 1.7.1 ]]<br />
&nbsp;<br />
<br />
== Release 1.7.0 ==<br />
Release date: July 2009<br />
<br />
* RunTimeLimit for individual testCases<br />
* Better flyby info for steps and actions<br />
* Folders in the tree can have a documentation<br />
* Log files (.elf) are now zipped ([[HowtoReadZippedElf|Reading zipped .elf files with expecco < Rel1.7]])<br />
* WebTest: SeliniumRc has been updated to V1.0.1 and supports now Firfox3.5, Interne Explorer 8 and Google Chrome<br />
* New functions in network-editor: <br />
** Exchange connections of two pins; <br />
** Resize to min/max; <br />
** Better chooser for new steps; <br />
** Insert & connect function (find best match for selected pins);<br />
** "insert step" function ("select step and connection")<br />
** Can place and connect new steps via the menu without drag&drop (intelligent selection list)<br />
** Multiple pin variable-freeze<br />
** Drop connection onto a step (for trigger-in/trigger-out connection)<br />
** Connection-colors<br />
*In code-editor<br />
** F4/F5 (comment / uncomment) now also work with JavaScript code<br />
** Syntax color configuration in preferences dialog<br />
** "Implementors" menu-function fixed<br />
&nbsp;<br />
Bug Fixes and Improvements:<br />
* Sound file access fixed<br />
* Activity-log display update speed improved<br />
* Keep dialogs visible (auto raise windows from dialog-blocks)<br />
&nbsp;<br />
<br />
== Release 1.6 ==<br />
Release date: Mar 2009<br />
* Improved report, allows multiple report templates<br />
* Search for Missing Attachments<br />
* Optional Debug-Check of Pin Value against Pin Type (in elementary code)<br />
* Scripting (Remote Control)<br />
* "execute until success" loop feature<br />
* Attachment output can provide contents of file (instead of pathname)<br />
* SOA Testing: Generation of SOAP Call EB's from an imported WSDL (PRO Version only)<br />
* CodeGenerator can generate EB from a CB (PRO Version only)<br />
* More command line options for report generation (if executed via batch script)<br />
* "make your own elementary GUI" blocks with the UI Editor (PRO Version only)<br />
* Both console (expecco.com) and non-console (expecco.exe) executables are provided<br />
* --noBanner option<br />
* New blocks in the [[ StandardLibrary_ReleaseNotes#1.6.2 | StandardLibrary 1.6.2 ]]<br />
&nbsp;<br />
<br />
== Release 1.5 ==<br />
Release date: 13.08.2008<br />
* File Attachment<br />
* Drag & Drop of Attachment<br />
* New ZIP-File Format<br />
* Improved Routing and Editor Functions<br />
* More Search Functions<br />
* Drag&Drop from Search<br />
&nbsp;<br />
<br />
== Release 1.4 ==<br />
<br />
* XML Parser Speedup<br />
* FileBrowser, Notebook and ProcessMonitor added<br />
* Acoustic test-execution feedback<br />
* Stop-on-Error can be turned off when running a TestSuite<br />
* Filter data messages in the Log-Viewer<br />
* Better presentation of detail-data in the Log-Viewer when double-clicking (Inspector)<br />
* Timelimit for testSuite execution<br />
* Looping & Loopcount for testSuite execution<br />
&nbsp;<br />
<br />
== Release 1.3 ==<br />
* Acoustic test-execution feedback <br />
* Stop-on-Error can be turned off when running a TestSuite <br />
* Filter data messages in the Log-Viewer <br />
* Better presentation of detail-data in the Log-Viewer when double-clicking (Inspector) <br />
* Timelimit for testSuite execution <br />
* Looping & Loopcount for testSuite execution <br />
* FileBrowser, Notebook and ProcessMonitor added<br />
&nbsp;</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Release_Notes_expecco/en&diff=6190Release Notes expecco/en2016-05-31T07:34:12Z<p>Mb: /* Release 2.9 (Q1/2016) */</p>
<hr />
<div>See also: [[Future_releases_expecco | Planned in one of the future Releases]]<br />
<br />
== Release 2.9 (Q1/2016) ==<br />
* Feature: [[Appium Plugin Reference | Appium-Plugin]]: Add recorder<br />
* Feature: Appium Plugin: Update capabilities<br />
* Feature: Appium Plugin: Settings Dialog for setting up external auxiliary programs (adb, Appium Server, AVD Manager, SDK Manager)<br />
* Feature: Appium Plugin: New menu for launching auxiliary programs (Appium Server, AVD Manager, SDK Manager)<br />
* Feature: Appium Plugin: New buttons in Android Wizard to refresh the device list, launch AVD Manager, install APKs.<br />
* Feature: Appium Plugin: Save and load connection settings in and from attachments in test suite.<br />
* Feature: Appium Plugin: Allow editing and copying of connection settings.<br />
* Feature: Appium Plugin: Allow adding arbitrary capabilities for forward compatibility.<br />
* Feature: Appium Plugin Bundle: Update contents, in particular use Appium Server 1.4.16.<br />
* Feature: Appium Plugin Bundle: Remove Android emulator from bundle as it is huge. If needed, download and install it separately.<br />
<br />
* UI enhancement: Appium Plugin: More verbose warning dialogs.<br />
* UI enhancement: Appium Plugin: Remove obsolete "Emulator Settings" from connection dialog (using the wizard is superior now).<br />
* UI enhancement: Appium Plugin: Make newCommandTimeout capability user visible<br />
* UI enhancement: Appium Plugin: Remove unimportantView from default capabilities<br />
* UI enhancement: Appium Plugin: Automatically select entry in Android Wizard if only one is available.<br />
* UI enhancement: Appium Plugin: Highlight unknown capabilities to give a hint in case of bad spelling.<br />
* UI enhancement: Appium Plugin: Add a search filter for packages in the Android Wizard.<br />
<br />
* STD-LIB: Image Save block supports writing of jpg images.<br />
<br />
* Appium Library: New blocks for multi-touch actions<br />
* Appium Library: New block for reading capabilities from files<br />
* Appium Library: New blocks for reading logs<br />
* Appium Library: New block "Find Elements by XPath" for finding sets of elements<br />
* Appium Library: New blocks for consecutive actions on single elements<br />
* Appium Library: New block for taking screenshots<br />
* Appium Library: New blocks for pressKeyCode API, make old blocks (sendKeyEvent API) obsolete<br />
<br />
* Localization: Appium Plugin: German translation mostly complete.<br />
<br />
* Documentation: Update and add more documentation to Appium library.<br />
<br />
* Fix: Appium Plugin: Timeout in Android Wizard if adb does not return.<br />
* Fix: Appium Plugin: Do not cut off multi-line status messages in Android Wizard.<br />
* Fix: Appium Plugin: Fix error and bad behavior when cancelling file dialog in connection settings.<br />
* Fix: Appium Plugin: Do not drop connection settings on connection error.<br />
* Fix: XML/XPath - accepts underscore ('_') and Unicode characters in element and attribute names.<br />
* Fix: RemoteAccess Plugin - fix error waiting for prompt<br />
* Fix: RemoteAccess Plugin - fix response in same line as command<br />
* Fix: Java GUI Plugin - fix error in "Verify Path"<br />
<br />
== Release 2.8 (Q4/2015) ==<br />
<br />
'''Notice: You have to install a patch for expecco 2.7.5, if you want to load a Testsuite which was edited in expecco 2.8 and uses some of the new features! [[release2.8_incompatibilities|(More info)]]'''<br />
<br />
* Feature: [[TableDrivenBlock Element | Table driven actions]]; these offer a simpler, table oriented interface<br />
* Feature: [[Appium Plugin Reference | Appium-Plugin]] for Android and Apple IOS test automation for mobile devices<br />
* Feature: Variable number of pins in groups ([[DiagramElements-Pin/en#Variable_Number_of_Pins | "Variable Pin Groups"]])<br />
* Feature: First release of the [[User_Defined_Menu_Items#Useful_Building_Blocks_for_Custom_Menu_Operations | Expecco Reflection Library]] (to automate expecco itself) <br />
* Feature: Enum datatype: support for individual assigned enum values, described in the [[ Datatype_Editor/en#Enumeration_Types | Datatype Editor Documentation ]] and the [[ Datatype_Element/en#Enumeration_Types | Datatype Element Documentation ]] and also the [[ Expecco_API/en#Enum Type Functions | API Documentation ]].<br />
* Feature: [[ Starting_expecco_via_Command_Line#Expecco_Rest_Service_Interface | Rest service ]] for remote controlling expecco execution<br />
* Feature: New [[ElementaryBlock_Element/en#Ruby_Script_Blocks|Ruby actions]]<br />
* Feature: Better execution directory settings for [[ElementaryBlock Element/en#Shell_Script_Blocks|Shell blocks]]<br />
* Feature: New step attributes for more specific [[ CompoundBlock_Editor-CompoundWorksheet_Editor/en#Step_Specific_Options_.28Context_Menu.29 | "skip in log/trace"]] options (for looping actions)<br />
* Feature: New user preference setting to ignore all [[CompoundBlock_Editor-CompoundWorksheet_Editor/en#Step_Specific_Options_.28Context_Menu.29 | skip-in-log]] attributes (for debugging)<br />
* Feature: "immediate fork new process" flag now also in block description or dynamically from elementary code<br />
* Feature: Improved performer data type handling; virtual steps now only accept valid performers, and freeze value choices are filtered for valid performers.<br />
* Feature: Option to start background action before or after pre-action<br />
* Feature: New constraint datatype type (for better freeze value selection)<br />
* Feature/Fix: compatibility of indexOf() / lastIndexOf() javaScript functions (allow substring search)<br />
* Feature: Data inspector for strings shows another (XML-DOM) tab if the string is an XML string. This tab shows the parsed XML DOM-tree.<br />
* Feature: Attachments can now be declared as binary file attachment. These will not be interpreted; especially, no cr/lf translation and utf8 or similar character translation is performed. Binary attachments are required, e.g. to embed jar or other code files.<br />
<br />
* UI enhancement: Multiline labels in steps (use "\" as line-separator)<br />
* UI enhancement: Additional custom headline and custom text block in reports (can be filled in right before printing).<br />
* UI enhancement: Can now also set breakpoints on steps and code lines of readonly actions (e.g. in an imported library)<br />
* UI enhancement: Undo gives a warning when about to undo past the previous file-save state<br />
* UI enhancement: Added a menu item in "Extras" - "Debugging" to stop [[ User_Defined_Menu_Items#Asynchronous_.28Background.29_Actions | background menu actions ]]<br />
* UI enhancement: Added more convenient pin-comment editing support to the schema editor<br />
* UI enhancement: Text editor has a new "split" menu function in its tools-submenu<br />
* UI enhancement: Better "New Step" and "Replace Step" dialogs in the diagram editor (showing preview, code and contents; also show attachements).<br />
* UI enhancement: Better autoconnect and matching blocks search algorithm in the "Place and Select New Step" function (i.e. New Step function, when an output pin is selected)<br />
* UI enhancement: New scale diagram function (scale and spread multiple steps)<br />
* UI enhancement: Lint performs a number of checks on a block being edited and gives immediate warnings in the info line (same checks as in the tree's error- and special search tabs)<br />
* UI enhancement: New lint-error check rules to detect consumed pin values in loops and multi-triggered chains.<br />
* UI enhancement: Double click on a search item to navigate to it in the tree<br />
* UI enhancement: Codeview and network view in the activitylog indicate that they are readonly.<br />
* UI enhancement: Secondary navigation tree for drag&drop.<br />
* UI enhancement: Warn if it is due time to check for updates.<br />
<br />
* STD-LIB: Collection creator and multi-setter blocks with variable number of pins (alternating key-value pairs)<br />
* STD-LIB: New DLL-Mapping block<br />
* STD-LIB: New blocks "File [modification time]", "File [access time]" and "File [creation time]".<br />
* STD-LIB: Additional blocks for event queue handling.<br />
* STD-LIB: Additional blocks for static step-local storage.<br />
* STD-LIB: Better versions for FAIL/WARN/INFO, LogFAIL, logWARNING and logINFO. New "Transcriber with Timestamp" action.<br />
* STD-LIB: Fixed some collection-type issues (now pins are #-template-typed, instead of Collection), which required a downcast in many suites.<br />
* STD-LIB: New blocks: "Trigger Periodically" and "Counter"<br />
* STD-LIB: New blocks: "Enumtype symbol<->integer"<br />
<br />
* Fix: Freeze value menu of unions of enums did not merge the individual enum values<br />
* Fix: Freeze value menu of unions of constraint dataType-types<br />
* Fix: The search breakpoints function (in the errors-tab of the treeview) now also finds statement breakpoints.<br />
* Fix: Fixes and improvements in the SOAP, REST and WSDL frameworks<br />
* Fix: Enum numeric value assignments were lost sometimes when saving/restoring<br />
* Fix: Search for references of a variable did not find them in imported libraries<br />
* Fix: Report of looped testplans (pre-action was reported multiple times)<br />
* Fix: behavior of cancel pin (did neither drive triggerOut-pin, nor exception-pin)<br />
* Fix: Fixes for crashes in follow mouse and backward (xPath) compatiblity in WindowsAutomation Plugin<br />
* Fix: The embedded type editor for defined classes lost its code window, when reopened on another class type.<br />
* Fix: Proper class naming is now enforced in the type editor.<br />
<br />
&nbsp;<br />
<br />
== Release 2.7.5 (2015-06-09) ==<br />
<br />
'''New features''':<br />
* The JavaFX plugin now supports keyboard input. Use the block "Request Focus" to focus an input field and the block "Type Text" to enter any text.<br />
<br />
'''Bugfixes''':<br />
* The JavaFX plugin now provides improved connection handling.<br />
<br />
<br />
For expecco running under Linux you need GLIBC >= 2.14<br />
<br />
Tested technology versions:<br />
* Selenium<br />
* The Java Bridge requires a JDK version 1.6 or higher<br />
** JavaFX testing requires JavaFX 8<br />
* QT: Qt 2.6.3 (mingw,vs2008), Qt 4.8.4 (mingw, vs2008, vs2010, vs2013), Qt 5.4.2 (vs2010, vs2013)<br />
* .NET<br />
* MFC<br />
* HTML 5<br />
* DevExpress<br />
* Android<br />
* iOS<br />
* Windows CE/Mobile Phone<br />
* CANoe: 8.2 SP4<br />
* WSDL-Import: it is required that you re-import your WSDL-Definitions in your Testsuites<br />
&nbsp;<br />
<br />
==Release 2.7.1 ==<br />
* Convenient menu functions to add the special [[ Expecco_API#Using a Particular JVM Connection / Executing Groovy on a Possibly Remote Machine | "java" and "groovy" ]] input pins to a Groovy elementary block.<br />
* Standard library: new blocks: "Directory [ Contents as Filenames ]", "Directory [ Contents as Pathnames ]", "Directory [ Contents as Basenames ]", "File [ isReadable? ]" and "File [ isWritable? ]"<br />
&nbsp;<br />
<br />
==Release 2.7 ==<br />
* Patches go into a release specific directory (e.g. patches-2.7.0.5)<br />
* configurable external editor for attachments and csv data (eg. excel or openoffice calculator)<br />
* tree view: markers in search lists; add to/remove from remembered list menu items<br />
* tree view: folders can have tags, too<br />
* tree view: per-tag icons in tree<br />
* [[ Starting_expecco_via_Command_Line/en#Utility_Functions | "--diff" command line option ]]<br />
* [[ Starting_expecco_via_Command_Line/en#Startup | "--settings" command line option ]]<br />
* Scatter/Gather composition of test plans from multiple suites [[ Starting_expecco_via_Command_Line/en#Scatter Gather Test Suite Composition | via command line arguments ]]<br />
* library: background OS process and background block actions<br />
* improved type checks and preference settings<br />
* schema editor: cursor up/down keys in pin name fields<br />
* schema and diagram editor: additional menu functions in multiple-pin selection menu<br />
* new blocks in the StandardLibrary: ExceptionClassifier, WriteCSV, Load/Save Environment from/to CSV<br />
* [[ SAP Testing | SAP plugin and VBScript action blocks ]]<br />
* change in the handling of Groovy callbacks. Please read [[ Expecco_API/en#Attention_.2F_Warning | "Attention / Warning" ]] and [[ Expecco_API/en#Special_Functions | "Special Functions"]] in the Groovy API documentation.<br />
* improved Groovy debugging support<br />
* new common Android and iPhone/iPad testing framework<br />
* option to save a per-run report, when a suite is executed in a loop (especially useful, when running until fail or until success)<br />
* block assertions: assert-executed / assert-all outputs written / assert any output written<br />
* License server support<br />
&nbsp;<br />
<br />
==Release 2.6.2 bugfix release - April 2014 ==<br />
Thus is a stable release consisting of the 2.6.1 base version INCLUDING all 2.6.1 patches (up to April).<br />
<br />
&nbsp;<br />
<br />
==Release 2.6.1 update - Januar 2014 ==<br />
* [[ Expecco_API#Groovy_Elementary_Blocks | groovy action]]: the java-bridge can be passed in via pin named "java" or environment var named "JAVA". GroovyShell can be passed in via pin named "groovy" or variable named "GROOVY". Pins are optional for backward compatibility.<br />
&nbsp;<br />
<br />
==Release 2.6 - November 2013 ==<br />
* New testplan execution loop mode: "loop until required test fails"<br />
* More options for automatic check for and installation of updates & patches<br />
* Better default directories in file open/save/import dialogs.<br />
* Tuned automatic reimport when multiple libraries are imported.<br />
* Improved Java object inspector<br />
* New attachment contents representation modes.<br />
* Step tooltips include the underlying block's tree location.<br />
* Shift click on connection selects all underlying connections.<br />
* Give an indication (colorize menubar) if running with root/Admin rights.<br />
* Option to put the custom operations menu into the top menu<br />
* Additional tab in tree view to search by item-type<br />
* Additional search options for interfaces and concrete actions<br />
* Various bug fixes & enhancements:<br />
** handle duplicate attachment filenames, <br />
** fixed some type conversions, <br />
** fixed clipboard handling under XWindow/Qt desktop, <br />
** fixed non-changing testplan/testitem spec page.<br />
** added string search in resources, skills and inventories<br />
** no longer close expanded tree items when reimporting<br />
** fixed making an imported library writable, which is imported by another sub-import<br />
** fixed freeze of template pin to boolean/enum<br />
** fixed enum values which start with a digit (aka '001 aaa')<br />
** remove freeze value connection via menu<br />
&nbsp;<br />
<br />
==Release 2.5 ==<br />
* Can refer to [[ Environment_Editor#Initialization Types | shell environment variables ]] in an environment variable's initializer.<br />
* New elementary block type: Groovy Code. Installs script code to be executed in a Java target or a local JVM.<br />
* New keyword driven actions<br />
* Additional checks in save dialogs to prevent overwriting another testsuite/library<br />
* Optional automatic reimport or check for reimportable imports (configure via settings dialog)<br />
* Additional freeze value validation when types are edited<br />
* New plugin: Jar Import<br />
* New and much improved manual test import plugin<br />
* Speedup, impovements and fixes in the JavaBridge plugin<br />
* Menu actions can [[ Misc_Editor#Background_Actions | execute in the background ]] (name as "...&")<br />
* Background actions in testplan and testcase<br />
* Much faster: startup, plugin loading and bridge communication<br />
* Multiple freeze value menu organizations for enum types (hierachical selection)<br />
<br />
===Release 2.5.1 - July 2013 ===<br />
<!-- This is a bugfix release, in which various patches and small enhancements from the past few months have been integrated. <br />
<br><br />
--><br />
* Automatic & semiautomatic update from server<br />
&nbsp;<br />
<br />
==Release 2.4 - Februar 2013 ==<br />
This is a bugfix release, in which various patches and small enhancements from the past few months have been integrated.<br />
<br>&nbsp;<br />
<br>&nbsp;<br />
<br />
==Release 2.3 - December 2012 ==<br />
* New integrated GUI Browser<br />
* New menu functions: "minimize/restore all Windows"<br />
* Polarion compatible report<br />
* Improved Project-Diff-Browser<br />
&nbsp;<br />
<br />
==Release 2.2==<br />
* New SchemaEditor menu functions: copy/paste pin interface<br />
* New plugin: [[GembirdPowerControlPlugin_Reference#|Gembird Power Control Plugin]]<br />
* New debug-menu function: "close all temporary windows"<br />
* [[Probe | Probes]]; easy recording and check of pinValues<br />
* Junit compatible report<br />
* HTTP and SOAP transmission log (optional on Transcript)<br />
* Fixed WSDL/SOAP for document-style operations<br />
* Better inspector (hex dump tab, hex representation of floats)<br />
&nbsp;<br />
<br />
==Release 2.1 - November 2011== <br />
* Condition variables for simple (and easy to use) control of testcase execution<br />
* [[Webservices#REST_Baustein|REST-Call]] blocks<br />
* Option to disable logging of activityNotifications (from the underlying language framework)<br />
* URL-override for SOAP service call blocks via the SOAP_URL environment variable.<br />
* Access to the certificate store (for SSL/HTTPS), allows adding and removing individual certificates<br />
* Elementary steps can have a variable number of output-pins (for multiplexer, dispatcher, round-robin generators etc.) <br />
* New menu function: "Generate Value Extractor" for Dictionary-typed pin values. (in the activityLog, output pin-data menu)<br />
* New tree-menu function: "Refactor"->"Change Variable Access", to search for and replace environment variable references.<br />
* New datatype [[Datatype_Element#Special_Types | "struct" ]], to represent arbitrary compound (struct) values.<br />
* GUI improvements: better annotation-text editors; line numbers, tags in file viewer<br />
* Allow for multi pin-value parametrization in testplan (block with multiple inputs in a testplan item) <br />
* Proxy support for HTTP-fetch blocks<br />
* Recording feature for Java Swing GUIs <br />
* Enhanced Java Swing Function Block Library<br />
* GUI Browser improvements: tree view with widget specific icons, record tree actions <br />
&nbsp;<br />
<br />
==Release 2.0==<br />
* Elementary steps can have a variable number of input-pins (improves the format, plus, string-concat and many other blocks)<br />
* Statistic page added to the project editor<br />
* Improved manual test import plugin; nicer Manualtest runner GUI; user definable manual test GUI<br />
* Allow for pin-value parametrization in testplan (block with a single input parameter in a testplan item)<br />
* Configurable max. cleanup time after terminating a run; Confirmation Dialog when longer.<br />
* ActivityLog: added "Select in Tree" from log-entry<br />
* HTTPS / SSL Support for HTTP blocks<br />
&nbsp;<br />
<br />
== Update Patch 1.9.1.1 ==<br />
(patch applied to the iX-Demo CD)<br />
<br />
* fixed the settings dialog's "mark new items" checkbox.<br />
* improved the termination timeout handling (long time spent in post action)<br />
* fixed the "search for active block" button's function<br />
* fixed a scroll-offset bug in the diagram editor<br />
&nbsp;<br />
<br />
== Release 1.9.1 ==<br />
Release date: Jan 2011<br />
<br>(release candidate: 1.8.3.30)<br />
<br />
* New blocks in the [[ StandardLibrary_ReleaseNotes#1.8.3 | StandardLibrary 1.8.3 ]] and [[ StandardLibrary_ReleaseNotes#1.9.1 | StandardLibrary 1.9.1 ]]<br />
* Separate model language translations<br />
* URL attachments<br />
* EBCDIC support<br />
* HP Quality Center Interface improved (up/download of tests and test-sets, autologout)<br />
* New plugin: Android Mobile Apps Interface<br />
* XMI import plugin improved (can now import test cases from Enterprise Architect models)<br />
* [[JavaSwing_Reference|JavaSwing plugin]] improved<br />
* Much improved Java-Bridge functionality: can now inject code dynamically<br />
* [[SeleniumLibrary_Reference|Web Interfacing]] updated to use newest Selenium Version.<br />
* Improved browser profile handling (for example for proxy setup)<br />
* Firefox profile now includes Firebug and Firepath for web page analysis<br />
* additional [[SeleniumLibrary_Reference|Web interface]] blocks (waitForAndXXX, table-accessors, table enumerators)<br />
* Optional cyclePeriod when looping a testplan<br />
* Suspend new activities when a debugger is open (option)<br />
* [[ WebSphere_MQ | WebSpere MQ (IBM Middleware interface)]] client interface plugin/library<br />
* Tagsearch includes Step-Tags<br />
* Can now save individual TestCase- and ActivityLog results to a file<br />
* New elementary block-type: Batch-script<br />
* Search for steps by name in result log<br />
* New variable-types in environment: [[ Environment Editor#Initialization_Types | SecretConstant, RequestFromUserWhenFirstUsed and SecretFromUserWhenFirstUsed ]] <br />
* Screenshot also via main menu<br />
* Code-editor now supports code completion (CTRL-Shift) and variable-correction (define as local or pin)<br />
* Optional sound when operator input is required<br />
* More execution control in the Control & Monitoring Window.<br />
* "Abort TestPlan" function in debugger.<br />
* Search for modified actions, search for values in tree<br />
* Improved XML-inspector (skip empty text, xml-text display)<br />
* Can now disable a plugin in the settings (will hide its menus)<br />
* Paste step with selected connection inserts the pasted step into the flow<br />
* improved single step function & breakpoint behavior<br />
* prerequisite package loading and prerequisite plugin checking<br />
* much improved [[AndroidLibrary_Reference | Android mobile-phone testing support]]<br />
* rename variable menu-function<br />
* improved references to variable search function (looks into code)<br />
* embedded inspector (better environment variable value display) in the activity log<br />
* webtest functionality upgraded to current selenium/firefox versions<br />
* regex matching text search in tree (in addition to existing glob-matching search)<br />
* search for consumed input value in cycles (lint)<br />
* pause on error option in blockTester<br />
* default parallelity of new steps is now "limited to 1"<br />
* grouping of user defined types<br />
* shrink-wrap of imported libraries<br />
* colorize by tag configuration<br />
* customizable operation menu<br />
* improved the diff-viewer, added attachment diffs<br />
&nbsp;<br />
<br />
== Release 1.8.2 ==<br />
Release date: Jul 2010 <br />
<br />
* Network Editor: allow connecting to a frozen pin (freeze to same value)<br />
* Network Editor: new menu function: "Extract Compound Action" (without replacing the selection)<br />
* Network Editor: new menu function: "Insert Step at Connection"<br />
* Network Editor: automatic "connect-through" when deleting steps from eni-eno chains<br />
* More testplan information for expeccoNET: operator needed; selectable testCases.<br />
* Search for halts and breakpoints<br />
* Breakpoint-toggling also in the log-viewer<br />
* Load resources from expeccoNET<br />
* New plugin: JIRA Interface (for issue validation)<br />
* New plugin: HP Quality Center Interface (up/download of test-suites)<br />
* New plugin/library: Swift-Message Handling<br />
* Fixed CTRL-a in some subviews<br />
* More attributes in annotations<br />
&nbsp;<br />
<br />
== Release 1.8.1 ==<br />
Release date: May 2010 (skipped for 1.8.2)<br />
<br />
* New blocks in the [[ StandardLibrary_ReleaseNotes#1.8.1 | StandardLibrary 1.8.1 ]]<br />
* Triggering Mailbox Pins (see Collect Block as an example)<br />
* ExecutionTime-Output pin<br />
* More search options (search for virtual, iterated and exception handling steps)<br />
* New step flags: "Skip Children in Trace", "Assert Output Written" and "Assert Executed"<br />
* New Settings flag "Open Debugger for Handled Exceptions"<br />
* Report: can now include screenshots and other images<br />
* Report: new "Print as Flat List" option.<br />
* Report: speedup for big PDF reports<br />
* Elementary Code Editor: Senders and References search now includes elementary code in search<br />
&nbsp;<br />
<br />
== Release 1.8.0 ==<br />
Release date: April 2010 (skipped for 1.8.1)<br />
<br />
* Different connection styles (direct, curved)<br />
* WSDL import plugin fixed and enhanced.<br />
* Some report improvements (more variables)<br />
* XML-RPC Blocks<br />
* Jira Plugin<br />
* Skill, Resource and Inventory Interface for expeccoNET<br />
&nbsp;<br />
<br />
== Release 1.7.4 ==<br />
Release date: Februrary 2010<br />
<br />
* New blocks in the [[ StandardLibrary_ReleaseNotes#1.7.4 | StandardLibrary 1.7.4 ]]<br />
* Implicit virtual block resolving specified in environment<br />
* Implicit virtual block resolving via virtual library specified in environment<br />
* Resource & skill access API fixed & enhanced<br />
* Enhanced display of virtual action in execution log<br />
* Fixed error-display in network if error occurs in action setup<br />
* Virtual blocks can now also be used as pre- and post-action<br />
* Fixed the input-pin handling of virtual blocks<br />
* [[Tools_TestSuiteDifferenceBrowser | TestSuite diff viewer]] (to compare two project versions)<br />
* New tree-menu-functions: "Generate Instance Creator" & "Generate Field Extractor"<br />
* New tree-menu-function: "Sort Children"<br />
* New type-kind: CType.<br />
* Added a new kind of inspector-view: CDatumInspector to show C-data in a structured, hierarchical list<br />
* Non-Blocking DLL-calls<br />
&nbsp;<br />
<br />
== Release 1.7.3 ==<br />
Internal Release date: January 2010<br />
<br />
* New blocks in the [[ StandardLibrary_ReleaseNotes#1.7.3 | StandardLibrary 1.7.3 ]]<br />
* Can now force connect of incompatible pins with CTRL-key<br />
* Default inventory now in testSuite (moved up from the testplan)<br />
* PostLoad & preUnload actions for suite and imported libraries<br />
&nbsp;<br />
<br />
== Release 1.7.2 ==<br />
Release date: October 2009<br />
<br />
* VariableList: added nameFilter and sortability<br />
* New blocks in the [[ StandardLibrary_ReleaseNotes#1.7.2 | StandardLibrary 1.7.2 ]]<br />
&nbsp;<br />
<br />
== Release 1.7.1 ==<br />
Release date: September 2009<br />
<br />
* When saving test suites that were originally signed with a expecco demo version, convert all demo signatures to final signatures - if you have got a dongle.<br />
* Now can load test suites saved with expecco-developer with expecco-pro (and developer with pro - as long as you do not features that are supported only by expecco-pro in your test suite)<br />
* all blocks tagged in the [[ StandardLibrary_ReleaseNotes#1.7.1 | StandardLibrary 1.7.1 ]]<br />
* new blocks in the [[ StandardLibrary_ReleaseNotes#1.7.1 | StandardLibrary 1.7.1 ]]<br />
&nbsp;<br />
<br />
== Release 1.7.0 ==<br />
Release date: July 2009<br />
<br />
* RunTimeLimit for individual testCases<br />
* Better flyby info for steps and actions<br />
* Folders in the tree can have a documentation<br />
* Log files (.elf) are now zipped ([[HowtoReadZippedElf|Reading zipped .elf files with expecco < Rel1.7]])<br />
* WebTest: SeliniumRc has been updated to V1.0.1 and supports now Firfox3.5, Interne Explorer 8 and Google Chrome<br />
* New functions in network-editor: <br />
** Exchange connections of two pins; <br />
** Resize to min/max; <br />
** Better chooser for new steps; <br />
** Insert & connect function (find best match for selected pins);<br />
** "insert step" function ("select step and connection")<br />
** Can place and connect new steps via the menu without drag&drop (intelligent selection list)<br />
** Multiple pin variable-freeze<br />
** Drop connection onto a step (for trigger-in/trigger-out connection)<br />
** Connection-colors<br />
*In code-editor<br />
** F4/F5 (comment / uncomment) now also work with JavaScript code<br />
** Syntax color configuration in preferences dialog<br />
** "Implementors" menu-function fixed<br />
&nbsp;<br />
Bug Fixes and Improvements:<br />
* Sound file access fixed<br />
* Activity-log display update speed improved<br />
* Keep dialogs visible (auto raise windows from dialog-blocks)<br />
&nbsp;<br />
<br />
== Release 1.6 ==<br />
Release date: Mar 2009<br />
* Improved report, allows multiple report templates<br />
* Search for Missing Attachments<br />
* Optional Debug-Check of Pin Value against Pin Type (in elementary code)<br />
* Scripting (Remote Control)<br />
* "execute until success" loop feature<br />
* Attachment output can provide contents of file (instead of pathname)<br />
* SOA Testing: Generation of SOAP Call EB's from an imported WSDL (PRO Version only)<br />
* CodeGenerator can generate EB from a CB (PRO Version only)<br />
* More command line options for report generation (if executed via batch script)<br />
* "make your own elementary GUI" blocks with the UI Editor (PRO Version only)<br />
* Both console (expecco.com) and non-console (expecco.exe) executables are provided<br />
* --noBanner option<br />
* New blocks in the [[ StandardLibrary_ReleaseNotes#1.6.2 | StandardLibrary 1.6.2 ]]<br />
&nbsp;<br />
<br />
== Release 1.5 ==<br />
Release date: 13.08.2008<br />
* File Attachment<br />
* Drag & Drop of Attachment<br />
* New ZIP-File Format<br />
* Improved Routing and Editor Functions<br />
* More Search Functions<br />
* Drag&Drop from Search<br />
&nbsp;<br />
<br />
== Release 1.4 ==<br />
<br />
* XML Parser Speedup<br />
* FileBrowser, Notebook and ProcessMonitor added<br />
* Acoustic test-execution feedback<br />
* Stop-on-Error can be turned off when running a TestSuite<br />
* Filter data messages in the Log-Viewer<br />
* Better presentation of detail-data in the Log-Viewer when double-clicking (Inspector)<br />
* Timelimit for testSuite execution<br />
* Looping & Loopcount for testSuite execution<br />
&nbsp;<br />
<br />
== Release 1.3 ==<br />
* Acoustic test-execution feedback <br />
* Stop-on-Error can be turned off when running a TestSuite <br />
* Filter data messages in the Log-Viewer <br />
* Better presentation of detail-data in the Log-Viewer when double-clicking (Inspector) <br />
* Timelimit for testSuite execution <br />
* Looping & Loopcount for testSuite execution <br />
* FileBrowser, Notebook and ProcessMonitor added<br />
&nbsp;</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=FAQ_expecco&diff=6162FAQ expecco2016-05-17T09:09:39Z<p>Mb: </p>
<hr />
<div>Die Ausführung eines Webtests mit Internet Explorer 10/11 bricht mit einem Scriptfehler im Browser (Fehler Dialog) ab.<br />
<br />
- Im Internet Explorer muss im Menü --> Internetoptionen --> Sicherheit unter "Sicherheitsstufe für diese Zone" für alle Zonen die Option "Geschütztne Modus aktivieren" gleich gesetz sein (Alle an oder alle aus!).<br />
Danach ist die Ausführung im IE 11 möglich.<br />
<br />
<br />
Bowser Fehlermeldung "Dies ist keine sichere Verbindung" beim Aufruf einer https:// Url<br />
<br />
- Hinzufügen des Arguments "-trustAllSSLCertificates" unter expecco Menü --> Extras --> Einstellungen --> Erweiterungen --> Webtest(Selenium) --> Advanced Settings (Selenium RC) --> Weitere Argumente beseitigt das Problem</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=FAQ_expecco&diff=6161FAQ expecco2016-05-17T08:54:20Z<p>Mb: </p>
<hr />
<div>Die Ausführung eines Webtests mit Internet Explorer 10/11 bricht mit einem Scriptfehler im Browser (Fehler Dialog) ab.<br />
<br />
- Im Internet Explorer muss im Menü --> Internetoptionen --> Sicherheit unter "Sicherheitsstufe für diese Zone" für alle Zonen die Option "Geschütztne Modus aktivieren" gleich gesetz sein (Alle an oder alle aus!).<br />
Danach ist die Ausführung im IE 11 möglich.</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=FAQ_expecco&diff=6160FAQ expecco2016-05-17T08:53:45Z<p>Mb: Die Seite wurde neu angelegt: „Die Ausführung eines Webtests mit Internet Explorer 10/11 bricht mit einem Scriptfehler im Browser (Fehler Dialog ab) - Im Internet Explorer muss im Menü --…“</p>
<hr />
<div>Die Ausführung eines Webtests mit Internet Explorer 10/11 bricht mit einem Scriptfehler im Browser (Fehler Dialog ab)<br />
<br />
- Im Internet Explorer muss im Menü --> Internetoptionen --> Sicherheit unter "Sicherheitsstufe für diese Zone" für alle Zonen die Option "Geschütztne Modus aktivieren" gleich gesetz sein (Alle an oder alle aus!).<br />
Danach ist die Ausführung im IE 11 möglich.</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Appium_Plugin_Reference&diff=6089Appium Plugin Reference2016-03-30T08:22:21Z<p>Mb: /* Installation des Bundles */</p>
<hr />
<div>= Einleitung =<br />
<br />
Appium ist ein freies Open-Source-Framework zum Testen und Automatisieren von mobilen Anwendungen. Diese Tests können entweder auf realen mobilen Endgeräten oder auf emulierten Geräten durchgeführt werden. Hierbei werden sowohl Android- als auch iOS-Geräte unterstützt. expecco bietet mit seinem Appium-Plugin eine Schnittstelle zur Ausführung von Tests mithilfe von Appium an.<br />
Das erste Kapitel dieser Dokumentation beschreibt die Verwendung des Appium-Bundles, einer von eXept erstellten Zusammenstellung von Appium, dem Android SDK und dem JDK. Mit dieser können Sie schnell erste Tests umsetzen. <br />
Der erste Abschnitt des Kapitels erläutert die Installation des Bundles auf Ihrem Betriebssystem. Sollten Sie das Bundle bereits installiert haben, so können Sie diesen Abschnitt überspringen. <br />
Im Anschluss wird beschrieben, wie Sie die einzelnen Komponenten des Bundles starten können. Um einen praktischen Eindruck von unserer Appium-Implementierung zu bekommen, wird zum Ende des Kapitels ein kurzes Tutorial beschrieben, wie Sie erste Tests mithilfe des Bundles ausführen können.<br />
Im zweiten Kapitel soll anhand eines beispielhaften Testaufbaus das Appium-Plugin und dessen Interaktion mit dem Appium-Server, zum Testen von mobilen Anwendungen, näher erläutert werden. Hierbei wird der Fokus auf die dazu verwendeten Technologien gesetzt um Entwicklern einen Ansatzpunkt zum selbständigen Entwickeln von Bausteinen oder zur Erweiterung der bestehenden Funktionsbibliothek zu ermöglichen. <br />
<br />
= Setup =<br />
<br />
== Installation des Bundles ==<br />
<br />
Um schnell Ihre ersten Schritte mit dem mobilen Testen in expecco durchzuführen, können Sie unter folgender Adresse das Appium-Bundle herunterladen: https://download.exept.de/transfer/h-expecco-2.8.0/appiumBundleSetup-1.2.exe.<br />
Der Download besteht aus einer einzelnen Installationsdatei. Nachdem Sie diese heruntergeladen haben, können Sie die Installation mit einem Doppelklick auf die Datei starten. Folgen Sie dann den Anweisungen des Installationsprogramms und wählen Sie einen Installationsort für das Bundle aus. Während des Installationsvorgangs wird unter Umständen die Appium-App gestartet. Diese können Sie wieder schließen, da der Appium-Server für den Test später direkt gestartet wird.<br />
<br />
Die Umgebungsvariable PATH muss um das Verzeichnis, in dem die adb.exe liegt, erweitert werden. Suchen Sie dazu in der Systemsteuerung nach den Umgebungsvariablen. Doppelklicken Sie dort auf die Variable mit dem Namen PATH, um diese zu ändern. Falls noch keine Variable mit diesem Namen existiert, legen Sie diese neu an. Geben Sie dort den Pfad des Verzeichnisses an, in dem die adb.exe liegt, beziehungsweise hängen Sie ihn mit einem Semikolon getrennt an den bereits vorhandenen Wert der Variable an. Der Pfad hat in der Regel die Form ''C:\Program Files (x86)\exept\Appium Bundle\android-sdk\platform-tools''.<br />
<br />
== Appium-Server starten ==<br />
<br />
Das Bundle beinhaltet einen Appium-Server, der die Kommunikation zwischen expecco und dem Testgerät ermöglicht. Sie können diesen direkt über die Verknüpfung auf dem Desktop starten, die während der Installation angelegt wurde. Alternativ können Sie auch die Batchdatei "start_appium.bat" im Installationsverzeichnis des Bundles starten. Es öffnet sich ein Fenster mit einer Konsole über die der Server läuft und in der seine Lognachrichten ausgegeben werden. Der Server ist bereit, sobald die ersten Lognachrichten erscheinen.<br />
<br />
== Mobilgerät verbinden ==<br />
<br />
Bevor Sie ein Mobilgerät mit dem Appium-Plugin ansteuern können, müssen Sie für dieses USB-Debugging erlauben. Für Android-Geräte finden Sie dies in den Einstellungen unter ''Entwickleroptionen'' (siehe https://www.droidwiki.de/USB-Debugging). Beim Verbinden des Geräts mit dem PC über USB müssen Sie ggf. am Gerät noch der Verbindung zustimmen.<br />
<br />
== Verbindungsaufbau über den Appium-Verbindungsdialog ==<br />
<br />
Nachdem Sie den Appium-Server gestartet haben und ein Gerät über USB verbunden ist, können Sie in expecco eine Verbindung zu einer mobilen Anwendung aufzubauen. Wechseln Sie dazu in expecco in den GUI-Browser. Dort können Sie auf der linken Seite ''Verbinden'' auswählen und dann im erscheinenden Dropdown-Menü ''Appium'' auswählen.<br />
<br />
[[Datei:AppiumGUIBrowser.png|border|]]<br />
<br />
<br />
Daraufhin öffnet sich der Appium-Verbindungsdialog (siehe Screenshot), in dem Sie die gewünschten Parameter für die Verbindung konfigurieren.<br />
<br />
Geben Sie zunächst die Adresse des Appium-Servers in das Eingabefeld ein. Standardmäßig wird der Appium-Server auf Port ''4723'' gestartet. Geben Sie also Folgendes ein:<br />
<br />
<nowiki>http://<IP des Appium Hostrechners>:4723/wd/hub</nowiki><br />
<br />
Als nächstes müssen Sie die Konfiguration für die Verbindung angeben. Der Appium-Server verlangt hierfür die Angabe sogenannter Capabilities.<br />
<br />
Für Tests unter Android empfiehlt es sich, hierfür den Android-Assistenten zu verwenden. Der Android-Assistent ermöglicht es Ihnen, die Capabilities für beliebige über USB angeschlossene Geräte automatisch auszufüllen.<br />
<br />
[[Datei:Appium GUI AndroidWizard.png|border|600px|]]<br />
<br />
<br />
Durch Klicken auf ''Android-Assistent'' öffnet sich der Einrichtungsassistent (siehe Screenshot). Mit Hilfe dieses Assistenten können Sie über Dropdown-Menüs die zu Verfügung stehenden Konfigurationen vornehmen.<br />
<br />
[[Datei:Appium Settings showSystemPackages.png|border|400px|]]<br />
<br />
Wählen Sie im obersten Feld das Gerät aus, mit dem Sie sich verbinden wollen. In der Liste des Dropdown-Menüs finden Sie alle erreichbaren Geräte. Daraufhin werden die auf dem Gerät vorhandenen Pakete abgerufen, dies kann einen Moment dauern. Die Pakete werden in Fremdpakete und Systempakete unterteilt. Von Ihnen installierte Anwendungen befinden sich unter den Fremdpaketen. Haben Sie noch keine Anwendung installiert, können Sie beispielsweise auch den Taschenrechner auswählen, der sich bereits auf dem Gerät befindet. Wählen Sie dazu die Systempakete aus. Im Eingabefeld darunter können Sie einen Filter eingeben, um die Liste der Pakete zu verkleinern. Geben Sie ''Calc'' als Filter ein und Sie finden Ihren Taschenrechner einfacher. (Das Paket heißt je nach Gerät verschieden, hat aber ''calculator'' im Namen.) Wählen Sie im Dropdown-Menü das gewünschte Paket aus und anschließend im untersten Dropdown-Menü eine Activity aus diesem Paket (z. B. ''.Calculator''). Durch Klicken auf OK werden die Capabilities entsprechend Ihrer Auswahl gesetzt.<br />
<br />
[[Datei:AppiumSettingsWizard.png| 600px|]]<br />
<br />
Um die Capabilities manuell einzutragen, wählen Sie links unten aus der Dropdownbox die gewünschten Capabilities aus. Um sie der Konfiguration hinzuzufügen, klicken Sie auf ''Hinzufügen''. Danach können Sie in der Liste im Dialog die entsprechenden Werte für die einzelnen Capabilities eingeben. Mit ''Entfernen'' können Sie eingetragene Capabilities wieder aus der Liste löschen.<br />
<br />
Die folgenden Capabilities sind für einen Verbindungsaufbau notwendig:<br />
<br />
* plattformName Wählen Sie hier aus, ob Sie eine Android-App oder eine iOS-App automatisieren wollen.<br />
* udid Wählen Sie hier aus, auf welchem Gerät Sie die App automatisieren wollen, z.B. ''emulator-5554''<br />
<br />
Für Android-Apps sind folgende Capabilities zusätzlich notwendig:<br />
<br />
* appPackage Geben Sie hier das Package der zu automatisierenden App an, z.B. ''com.apple.calculator''<br />
* appActivity Geben Sie hier die Activity innerhalb des Packages an, ''.Calculator''<br />
Für iOS-Apps sind folgende Capabilities zusätzlich notwendig:<br />
* bundleId Geben Sie hier die Bundle-ID der zu automatisierenden App an, z.B. ''com.apple.calculator''<br />
<br />
Weitere Informationen zu verfügbaren Capabilities finden Sie unter:<br />
<br />
http://appium.io/slate/en/master/?java#appium-server-capabilities<br />
<br />
<br />
Nachdem Sie alle gewünschten Capabilities hinzugefügt haben, können Sie mit ''Speichern'' Ihre Einstellungen in einer Datei speichern. Diese können Sie dann beim nächsten Mal über ''Laden aus Datei'' einlesen oder auch in den Tests verwenden.<br />
<br />
Mit einem Klick auf ''Verbinden'' starten Sie den Verbindungsaufbau mit den angegebenen Einstellungen.<br />
<br />
== Tests mit dem Appium-Recorder erstellen ==<br />
<br />
Nachdem Sie die Verbindung zu einem Gerät hergestellt haben, können Sie im GUI-Browser den Appium-Recorder über das Aufnahme-Symbol starten.<br />
<br />
[[Datei:AppiumRecorder.png|1000px|]]<br />
<br />
In der Menüleiste können Sie bei ''Aktion'' auswählen, welche Aktion Sie ausführen wollen. Voreingestellt ist ''Berühren'', was ein Anklicken des ausgewählten Elements erzeugt. Sie können nun mit der Maus eine Aktion auslösen, indem Sie in der Anzeige des Recorders beispielsweise auf eine Ziffer des Taschenrechners klicken. Sie sehen, dass die Aktion auf dem Gerät ausgeführt wird und der Recorder den aktuellen Bildschirminhalt des Geräts nachlädt. Außerdem wird im Arbeitsbereich des GUI-Browsers ein entsprechender Baustein erzeugt.<br />
<br />
Sie können aus folgenden Aktionen wählen:<br />
* Aktionen<br />
** ''Wischen'': Wischen über den Bildschirm von der Position, an der Sie die Maus drücken, bis zu der Position, an der Sie sie wieder loslassen. Die Dauer wird ebenfalls berücksichtigt<br />
** ''Antippen'': Antippen des Bildschirms an der Cursorposition mit der selben Dauer wie Sie Ihre Maus gedrückt halten (hilfreich für Long-Clicks)<br />
** ''Element antippen'': wie Antippen, aber für das Element an der Cursorposition<br />
** ''Berühren'': kurzes Berühren des Elements an der Cursorposition (Click)<br />
** ''Zoom'': noch nicht implementiert<br />
** ''Text setzen'': nach dem Klicken auf ein Element können Sie den Text eingeben, mit dem dieses befüllt werden soll; funktioniert nur für Eingabefelder<br />
* Test & Verify<br />
** ''Attribut vergleichen'': Nach dem Klicken auf ein Element können Sie eines seiner Attribute auswählen. Es wird ein Verzweigungsbaustein erstellt, der den Wert des Attributs zum Zeitpunkt des Tests mit dem angegebenen Wert vergleicht.<br />
** ''Attribut verifizieren'': Nach dem Klicken auf ein Element können Sie eines seiner Attribute auswählen. Es wird ein Baustein erstellt, der fehlschlägt, wenn der Wert des Attributs zum Zeitpunkt des Tests mit dem angegebenen Wert nicht übereinstimmt.<br />
<br />
Außerdem können Sie mit den vier Icons an der rechten Seite die Tasten ''Home'', ''Zurück'' ''Menü'' und ''Power'' auslösen.<br />
<br />
Beim Aufnehmen der Aktionen werden die Bausteine im Arbeitsbereich lediglich linear angelegt. Sie können den Ablauf dort aber auch einfach ändern, zum Beispiel wenn Sie Verzweigungsbausteine verwenden oder zusätzliche Bausteine einfügen wollen. Über das Icon in der rechten oberen Ecke können Sie den Arbeitsbereich als neuen Baustein in Ihrer Testsuite anlegen.<br />
<br />
Um später Tests mit diesen Bausteinen ausführen zu können, müssen Sie am Anfang des Tests den ''Connect''-Baustein aus der Appium-Library einbauen und am Ende entsprechend ein ''Disconnect''. Zur Erzeugung der Capabilities für den ''Connect''-Baustein können Sie den Baustein ''Read Capabilities from File'' verwenden, der eine im Verbindungsdialog erstellte Datei einlesen kann.<br />
<br />
<br />
== Verbindungsabbau ==<br />
Um eine bestehende Verbindung abzubauen, führen Sie einen Rechtsklick auf den Verbindungseintrag im GUI-Browser aus und wählen Sie ''Verbindung abbauen'' oder ''Verbindung abbauen und Eintrag entfernen'' aus. Dadurch wird die Verbindung von Appium zum Testgerät abgebaut. Trennen Sie erst anschließend das Gerät vom PC. Den Appium-Server können Sie stoppen, indem Sie das Konsolenfenster schließen.<br />
<br />
= Entwicklerguide =<br />
<br />
== Architektur und Technologien ==<br />
<br />
Die Anbindung an das Appium Testframework wurde über den 'Appium Driver', einer Weiterentwicklung des Selenium WebDriver, umgesetzt. Das auf HTML und JavaScript basierende Interface wurde funktional so erweitert, dass es als Schnittstelle zum Appium Server verwendet werden kann und dadurch dessen Dienste zum Testen von mobilen Anwendungen genutzt werden können. Diese beiden Komponenten kommunizieren über das JSON Wire Protokoll miteinander.<br />
Zur Zeit unterstützt Appium das Testen auf iOS und Android Systemen. Grundsätzlich können die Test in diversen Programmiersprachen geschrieben werden. Jedoch muss beim Erstellen der Tests definiert werden, auf welchem System sich die zu testende Anwendung befindet. An dieser Definition orientiert sich der Server, sucht sich die auszuführenden Aktionen heraus und sendet diese Befehle in einer dem Zielsystem verständlichen Form an die Endgeräte. Als Middleware für Android-Systeme wird die Android Debug Bridge genutzt. Für iOS-Systeme hingegen wird Instruments verwendet.<br />
<br />
[[Datei:appium_architekturskizze_mit_konsolenfenster.png | 650px|]]</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Expecco_GUI_Tests_Extension_Reference&diff=6058Expecco GUI Tests Extension Reference2016-03-09T09:22:58Z<p>Mb: Die Seite wurde neu angelegt: „<!-- Notes - integrated expecco extension - common tool for different ui technologys - information about the ui structure and control properties - creating tes…“</p>
<hr />
<div><!-- Notes<br />
- integrated expecco extension<br />
- common tool for different ui technologys<br />
- information about the ui structure and control properties<br />
- creating testsequences<br />
- recording<br />
<br />
Features<br />
- fully integrated in expecco ui<br />
- one tool for multiple technologys<br />
- examine ui structure<br />
- examine control properties and details<br />
- filtered blocks for selected control and properties<br />
- create block sequence by drag and drop and record<br />
- try blocks, sequence, different paths<br />
- add sequence to your project<br />
- find controls by mouse over or highlight<br />
<br />
Installation<br />
<br />
User Interface<br />
- open the UI<br />
- UI overview<br />
- UI functionality<br />
- connecting applications<br />
<br />
Component Path<br />
<br />
--><br />
<br />
"expecco GUI Tests Extension" unterstützt die Erstellung von Testsequenzen für grafische Benutzeroberflächen (GUIs) in expecco. Das Werkzeug ist nahtlos in die expecco Benutzeroberfläche integriert. Es dient als gemeinsame Basis für verschiedenste GUI-Technologien (Qt, Java/Swing, Android, MFC, etc). Die "expecco GUI Tests Extension" bietet neben der Möglichkeiten zum Aufzeichen von Testsequenzen auch Unterstützung zum interaktiven Entwicklung von Testsequenzen, sowie Informationen über die Struktur der Benutzeroberfläche und Zustände sowie Eigenschaften der Bedienelemente. Einzelne Aktionen oder ganze Sequenzen können zunächst ausprobiert und anschließend in die Testsequenz übernommen werden ("exploratives Testen").<br />
<br />
=Hauptmerkmale=<br />
* Nahtlose Integration in die expecco-Benutzeroberfläche<br />
* Ein gemeinsames Werkzeug für verschiedene UI-Technologien<br />
* Visualisierung des Aufbaus der Benutzeroberfläche (Komponentenstruktur)<br />
* Informationen über verschiedene Zustände und Eigenschaften der einzelnen Bedienelemente<br />
* Unterstützung beim Auffinden von Bedienelemente durch Hervorhebung, Vorschaubilder und "Mouse-Over" Feedback<br />
* Filterung von passenden Aktionsblöcken aus der Block-Bibliothek abhängig von der jeweiligen UI-Technologie<br />
* Erstellung von Testsequenzen mittels "Drag and Drop" und/oder automatischer Aufzeichnung<br />
* Experimentelles Ausprobieren von Blöcken, Testsequenzen und Bedienelement-Pfaden<br />
* Übernehmen von Testsequenzen in das Testprojekt<br />
<br />
=Beschreibung=<br />
[[Datei:GuiBrowser openButton marked.jpg|200px|thumb|right|Schaltfläche zum öffnen der Benutzeroberfläche]]<br />
Die "expecco GUI Tests Extension" bildet eine einheitliche Basis zur Interaktion mit Anwendungen mit grafischer Benutzeroberfläche (GUI). Dabei werden unterschiedliche Technologien unterstützt. Die eigentliche Anbindung an die GUI-Anwendung und deren Steuerung wird von der jeweiligen Erweiterung (plugin) für die konkrete UI-Technologie realisiert. Entsprechende Erweiterungen sind für eine Vielzahl von Technologien erhältlich - z.B. Qt, Java/Swing, MFC, DevExpress, Android. Es muss also mindestens ein konkretes UI-Technologie Plugin vorhanden sein um die "expecco GUI Tests Extension" sinnvoll verwenden zu können. Andererseits können auch mehrere Anwendungen, auch in unterschiedlichen Technologien erstellte, gleichzeitig angesprochen und getestet werden. Somit können, z.B. bei Integrationstests, End-to-End Tests durchgeführt werden, welche innerhalb eines Testlaufs sowohl mobile als auch webbasierte und klassische Oberflächen bedienen und verifizieren. <br />
<br />
Nachdem in expecco ein Projekt erstellt oder geöffnet wurde kann über die Schaltfläche "GUI Test Ansicht Öffnen" die Benutzeroberfläche der "expecco GUI Tests Extension" geöffnet werden.<br />
<br />
==Benutzeroberfläche==<br />
<br />
[[Datei:GuiBrowser mainView labled ger.jpg|400px|thumb|right|Abb1: Gliederung der Hauptansicht]]<br />
[[Datei:GuiBrowser mainView usageFlow ger.jpg|400px|thumb|right|Abb2: Bedienfluss]]<br />
Eine Übersicht über den Aufbau, die Verwendung und die Funktionen der Benutzeroberfläche. Abbildung 1 Zeigt die Gliederung der Hauptansicht. In Abbildung 2 wird der Bedienfulss dargestellt.<br />
<br />
;Verbindungsaufbau<br />
: Eine Auflistung der verfügbaren Benutzer-Oberflächen Technologien. Per Klick auf eine der Schaltflächen wird der Verbindungsaufbau der jeweiligen UI-Technologie gestartet. Nach dem Verbindungsaufba erscheint die Anwendung in der Benutzeroberflächenstruktur (Hierarchie der Komponenten).<br />
<br />
;Benutzeroberflächenstruktur<br />
: Zeigt alle verbundenen und nicht verbunden Anwendungen. Unter jeder Anwendung wird der Aufbau der Benutzeroberfläche mit allen verfügbaren Bedienelementen dargestellt. Beim Aufklappen einer nicht verbundenen Anwendung wird versucht die Verbindung wieder herzustellen, falls diese verloren ging oder noch nicht bestand. Die Selektion eines Bedienelements oder einer Anwendungen aktualisiert die Menge der dazu passenden Aktionen sowie die Ansicht der Block-Bibliothek, Eigenschaftenübersicht, Bedienelementübersicht und den Bedienelementpfad.<br />
<br />
;Werkzeuge<br />
: Eine Auflistung verschiedener Werkzeuge. Ein Klick auf eine der Schaltflächen löst die Aktionen aus. Einige Aktionen sind von der Selektion in der Benutzeroberflächenstruktur abhängig.<br />
: '''Alle Verbindungen Trennen'''<br />
:: Trennt alle Verbindungen aller Technologien.<br />
: '''Ausgewählte Verbindung trennen'''<br />
:: Trennt die Verbindung bezüglich des in der Benutzeroberflächenstruktur ausgewählten Bedienelementes.<br />
: '''Aktuallisieren'''<br />
:: Aktuallisiert die obersten Bedienelemente aller verbundenen Anwendungen.<br />
: '''Kinderelemente erneut Laden'''<br />
:: Aktuallisiert die Kinderelemente bezüglich des in der Benutzeroberflächenstruktur ausgewählten Bedienelementes.<br />
: '''Hervorheben'''<br />
:: Hebt das in der Benutzeroberflächenstruktur ausgewählte Bedienelement in der Benutzeroberfläche hervor.<br />
: '''Zeiger Folgen'''<br />
:: Wenn diese Funktion aktiviert wurde, folgt die Selektion der Benutzeroberflächenstruktur automatisch dem unter dem Mauszeiger befindlichen Bedienelement (Quick-Scan).<br />
: '''Aufzeichnung für alle Anwendungen beginnen'''<br />
:: Beginnt die automatische Aufzeichnung einer Testsequenz für alle verbundenen Anwendungen. Während der Interaktion mit der/den Benutzeroberfläche(n) wird die Testsequenz im Sequenzeditor generiert. Befindet sich bereits eine Sequenz im Sequenz-Editor, so wird diese fortgesetzt.<br />
: '''Aufzeichnung für alle Anwendungen beenden'''<br />
:: Beendet die Aufzeichnung für alle verbundenen Anwendungen.<br />
<br />
;Eigenschaftenübersicht<br />
: Listet verfügbare Eigenschaften des ausgewählten Elements auf. Selektion einer der Eigenschaften ändert die Ansicht der Block-Bibliothek, so dass nur Blöcke die sich auf diese Eigenschaft beziehen, angezeigt werden.<br />
<br />
;Block-Bibliothek<br />
: Zeigt die verfügbaren Blöcke aus der Technologiebibliothek, für das in der Benutzeroberflächenstruktur ausgewählte Element an. Unter "Aktionen" werden die Blöcke aufgeführt, die passend zum Element sind, beispielsweise das Setzen des Textes einer Label-Komponente. Unter "Eigenschaften" werden die Blöcke aufgeführt, die für eine unter "Eigenschaftenübersicht" ausgewählte Eigenschaft relevant sind, wie zum Beispiel das Abfragen der Sichtbarkeit.<br />
: Wird ein Block selektiert, so ändert sich die Ansicht der Editoransicht auf "Test" und der Block wird angezeigt.<br />
: Zieht man den Block mit der Maus über die Editoransicht, so wechselt die Ansicht auf "Sequenz". Lässt man den Block in der Sequenz fallen, so wird er als Schritt an die Sequenz angefügt.<br />
<br />
;Editoransicht<br />
: Unter "Test" wird der in der Blockbibliothek ausgewählte Block dargestellt. Die Pins können editiert werden. Anschließend kann der Block gegen die Anwendung ausgeführt werden. Die Editoransicht wechselt dabei auf "Lauf". Die Ausführung des Blocks kann hier überprüft werden. Aus der Test-Ansicht heraus kann der Block direkt mittels der Schaltfläche "In Sequenz Übernehmen" in die Testsequenz übernommen werden. Der Block wird als Schritt an die Testsequenz angefügt.<br />
: Die "Sequenz"-Ansicht stellt die aktuelle Testsequenz dar. Diese kann manuell oder durch Aufzeichnung erweitert werden. Die Testsequenz lässt sich ausführen, die Ansicht wechselt dann auf "Lauf". Hier kann die Ausführung der gesamten Testsequenz überprüft werden. In der "Sequenz"-Ansicht lässt sich die gesamte Sequenz in das aktuelle Projekt übertragen. Dazu wird die Schaltfläche "In Projekt Übernehmen" ausgewählt.<br />
<br />
;Bedienelement-Pfad<br />
: Zeigt den Pfad des in der Benutzeroberflächenstruktur ausgewählten Bedienelements. Der Pfad kann verändert werden; insbesondere sollten längere verschachtelte Containerpfade durch "*" ersetzt werden, damit die Addressierung der Komponente möglichst unabhängig von späteren Änderungen der UI-Hierarchie werden. Mit der Schaltfläche "Pfad-Prüfen" wird sichergestellt, daß der geänderte Pfad immer noch das in der Benutzeroberflächenstruktur ausgewählte Bedienelement referenziert.<br />
<br />
;Bedienelementübersicht<br />
: Zeigt Informationen des in der Benutzeroberflächenstruktur ausgewählten Bedienelementes an und stellt, falls möglich, eine Vorschau dar. Ein Klick auf die Vorschau öffnet das Bild in Originalgrösse.<br />
<br />
<br style="clear: both" /><br />
<br />
=Bedienelementpfad=<br />
Der "Bedienelementpfad" dient als Referenz auf Bedienelemente innerhalb der Benutzeroberfläche. Er ist vergleichbar mit der XPath-Notation im XML Umfeld. Komponentenpfade werden bei der Testentwicklung festgelegt und später, bei der Testausführung, verwendet um UI-Komponenten zu referenzieren. Der Pfad eines ausgewählten Bedienelements wird unten im "Bedienelement-Pfad" Feld angezeigt, und bei Auswahl eines Elements automatisch aktualisiert. Umgekehrt kann er an dieser Stelle auch geändert und überprüft werden, welche(s) Element(e) durch einen gegebenen Pfad referenziert werden. Der Pfad muss nicht vollständig sein - er kann dynamische Teile enthalten. Dies erhöht die Flexibilität und macht die Testsequenz robuster gegenüber einer möglichen späteren Änderung der getesteten Benutzeroberfläche. Insbesondere gegenüber Änderungen der Hierarchie, z.B. wenn weitere Containerelemente eingefügt werden.<br />
<br />
'''Hinweis: ''' <br />
Viele Benutzeroberflächen ändern während der Ausführung die Struktur dynamisch. Oft werden Container- und Bedienelemente während dem Lauf hinzugefügt oder entfernt. In solchen Fällen sind dynamische Teile im Pfad sehr hilfreich.<br />
<br />
==Pfade Definieren==<br />
Ein typischer Pfad kann wie folgt aussehen:<br />
/frame[@name='Notepad']/root pane/layered pane/panel/panel/panel/tool bar/push button[2]<br />
Dieser Pfad beschreibt die vollständige Adressierung des zweiten Buttons in einer Toolbar, welche ihrerseits in einer verschachtelten Containerhierarchie (panels) liegt.<br />
<br />
Der Pfad wird beschrieben durch eine Liste von Identifikatoren, getrennt durch und beginnend mit "/". Jeder einzelne Identifikator beschreibt eine Unterkomponente des bereits durch den linken Teilpfad beschriebenen Elements. "/frame[@name='Notepad']" referenziert das Hauptfenster der Anwendung. "root pane", "layered pane", "panel" etc. referenzieren jeweils das korrespondierende Kindelement. Zur Referenzierung einer einzelnen konkreten Komponente wird der Pfad beginnend mit dem obersten Bedienelement schrittweise verfolgt. <br />
<br />
Im Beispiel wird zuerst versucht, das Fenster mit Namen "Notepad" zu finden. Das Fenster hat ein oder mehrere Kinder, dessen Identifikator zu "root pane" passt. "root pane" wiederum hat Kinder die zum Identifikator "layered pane" passen und so weiter.<br />
<br />
Die Syntax eines jedes individuellen Identifikators ist: <br />
/<KnotenIdentifikator><[Optionaler Selektor]><br />
<br />
===KnotenIdentifikator===<br />
Der KnotenIdentifikator beschreibt den Typ des Bedienelementes das gesucht wird.<br />
<br />
'''Mögliche Identifikator:'''<br />
;Der Typ des Bedienelements<br />
: Das Ergebnis sind eine oder mehrere Bedienelemente die dem angegebenen Typ entsprechen.<br />
;Der "Jeder" Identifikator ("*")<br />
: Löst den Rest des Pfades unter Verwendung alle Kindelemente, unabhängig vom Typ des aktuell aufzulösenden Identifikators auf.<br />
<br />
Beispiel:<br><br />
Vollständiger Pfad:<br />
/frame[@name='Notepad']/root pane/layered pane/panel/panel/panel/tool bar/push button[2]<br />
Der selbe Pfad mit "*" Identifikatoren:<br />
/*[@name='Notepad']/*/layered pane/*/panel/*/tool bar/push button[2]<br />
<br />
Diese zwei Pfade adressieren in obigem Fall das selbe Bedienelement. Jedoch ist die zweite Variante unempfindlicher gegenüber geänderten Komponenten in der Hierarchie. Zum Beispiel könnten die Entwickler der zu testenden Anwendung eine panel-Komponente durch eine box-Komponente ersetzen. Der erste Pfad würde dann im Testlauf zu einem Fehler wegen nicht auflösbarem Pfad führen.<br />
Zu beachten ist, dass der "*"-Identifikator zur als Platzhalter einer einzelnen Komponente dient. Um den Pfad auch robust gegenüber zusätzlich in die Hierarchie eingebrachte Komponenten zu machen, sollte die "//"-Notation (siehe unten) verwendet werden.<br />
<br />
===Selektor===<br />
Der Selektor ist Optional. Er wird benötigt um Bedienelemente mit gleichem Typ zu unterscheiden. Gibt es beispielsweise 3 Buttons als Kinder eines Bedienelements, so kann mit dem Selektor der zu referenzierende Button festgelegt werden. Der Selektor wird in eckigen "[ ]" Klammern angegeben. Der Selektor wird nach der Auflösung des KnotenIdentifikators auf das Ergebnis angewendet. Gibt es zum Beispiel ein Bedienelement mit zwei Buttons und zwei Checkboxen als Kinder, und der Identifikator liefert als Ergebnis 2 Buttons, so wird der Selektor auf diese 2 Buttons angewendet.<br />
<br />
'''Mögliche Selektoren:'''<br />
;Der "Index" Selektor<br />
: Wählt das Bedienelement anhand des Index. Der Index ist 1 basiert (i.e. [1] bezieht sich auf die erste Komponente).<br />
;Der "Schlüssel-Wert" Selektor (engl. "Key-Selector")<br />
: Wählt das Bedienelement dessen Schlüssel den angegebenen Wert hat. Die Menge der möglichen Schlüssel ist abhängig von der jeweiligen UI-Technologie, der betroffenen Komponente und deren Attribute. Typische Schlüssel sind "name", "id", "label", "value" etc. Bei einigen Komponenten sind auch dynamische Schlüssel möglich, so dass diese erst während der Laufzeit angelegt werden. <br />
<br />
Beispiel (Index Selector): <br />
/*/tool bar/push button[2]<br />
Wählt den zweiten Button innerhalb der Toolbar aus. <br />
<br />
Beispiel (Schlüssel Selector): <br />
/*/tool bar/push button[@name='Save As...']<br />
Wählt den Button aus dessen Attribut "name" (= Schlüssel) den Wert "Save As..." hat.<br />
<br />
===Platzhalter Schreibweise===<br />
Die Platzhalterschreibweise ("//") kann Pfade stark verkürzen und flexibel gegenüber zusätzlich eingefügten Hierarchieebenenen machen. "//" ersetzt dabei ganze Teile des Pfades. Der Vergleich findet nicht nur auf Kinder eines Bedienelementes statt, sondern auf ganze Teilpfade. <br />
<br />
Beispiel:<br/><br />
Angenommen der vollständige Pfad eines Buttons wäre folgender:<br />
/frame[@name='Notepad']/root pane/layered pane/panel/panel/panel/tool bar/push button[@name='Save As...']<br />
<br />
Außerdem angenommen, die Anwendung hat nur einen Button mit dem Namen "Save As...", welchee sichtbar ist. Dann kann der Pfad mittels Platzhalterschreibweise wie folgt verkürzt werden:<br />
//push button[@name='Save As...']<br />
<br />
Noch kürzer ginge es, wenn es überhaupt nur ein Bedienelement mit Namen "Save As..." gäbe. Dann wäre folgender Pfad möglich:<br />
//*[@name='Save As...']<br />
<br />
Auch ist es möglich, wie im folgenden Beispiel, nur Teile des Pfades mit Platzhaltern zu versehen:<br />
/*[@name='Notepad']//panel//tool bar/*[@name='Save As...']<br />
<br />
'''Hinweis:'''<br />
Die verkürzten Pfade in den oben gezeigten Beispielen sind wesentlich unanfälliger gegenüber Änderungen im Layout der Benutzeroberfläche. Jedoch erhöht es je nach Anwendung und Benutzeroberfläche auch die Wahrscheinlichkeit, dass mehrere passende Bedienelemente gefunden werden. Dies wird dann ebenfalls zur Laufzeit zu einem Fehler führen ("Nicht eindeutiger Komponentenpfad"). In obigem Beispiel könnte dies passieren, wenn im UI neben dem Button auch ein Menueintrag mit dem selben Text existiert.<br />
In der Praxis wird die Auswahl des geeigneten Pfades immer einen Kompromiss aus Flexibilität (möglichst kurz) und Eindeutigkeit darstellen.</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Themensammlung&diff=6057Themensammlung2016-03-09T09:22:12Z<p>Mb: /* UI Testing */</p>
<hr />
<div><br />
= expecco =<br />
<br />
== Release Notes ==<br />
<br />
* [[ Release Notes expecco]]<br />
* [[ Release Notes expecco/en ]]<br />
<br />
== General ==<br />
<br />
* [[ expecco Overview | Overview]] -- Empty!<br />
* [[ expecco Overview/en | Overview/en ]] -- empty!<br />
* [[ Installation ]] - initial installation, license files, patches<br />
* [[ Installation/en ]] - initial installation, license files, patches<br />
* [[ Configuration & Setup ]] - jre/jdk setup, pathes<br />
* [[ Configuration & Setup/en ]] - jre/jdk setup, pathes<br />
* [[ Personal Settings ]] - editor settings<br />
* [[ Personal Settings/en ]] - editor settings<br />
* [[ Report Generation ]]<br />
* [[ Report Generation/en ]]<br />
* [[ Concepts]] - concepts; testplan, testcase, activities, verdicts<br />
* [[ Concepts/en]] - concepts; testplan, testcase, activities, verdicts<br />
* [[ Command Line Options | Command Line Options and RPC Services ]]<br />
* [[ Command Line Options/en | Command Line Options and RPC Services/en ]]<br />
* [[ Glossary ]]<br />
* [[ Glossary/en ]]<br />
* [[ FAQ ]]<br />
* [[ FAQ/en ]]<br />
<br />
== expecco UI ==<br />
<br />
* [[ Menu ]] empty!<br />
* [[ Menu/en ]] empty!<br />
* [[ Toolbar ]] empty!<br />
* [[ Toolbar/en ]] empty!<br />
* [[ Navigation Tree ]] empty!<br />
* [[ Navigation Tree/en ]] empty!<br />
* [[ Settings ]] empty!<br />
* [[ Settings/en ]] empty!<br />
* [[ Testsuite Browser ]] empty!<br />
* [[ Testsuite Browser/en ]] empty!<br />
* [[ Expecco Remote Control APP ]]<br />
<br />
== Editors ==<br />
<br />
* [[ Scheme Editor ]] <br />
* [[ Scheme Editor/en ]]<br />
* [[ Documentation Editor ]] <br />
* [[ Documentation Editor/en ]]<br />
* [[ History Editor ]] <br />
* [[ History Editor/en ]]<br />
* [[ BlockFunctionalityTestEditor ]] <br />
* [[ BlockFunctionalityTestEditor/en ]]<br />
* [[ BlockFunctionalityRunner ]] <br />
* [[ BlockFunctionalityRunner/en ]]<br />
* [[ BlockSkill Editor ]] <br />
* [[ BlockSkill Editor/en ]]<br />
<br />
* [[ ElementaryBlock Editor-Code Editor ]] <br />
* [[ ElementaryBlock Editor-Code Editor/en ]]<br />
<br />
* [[ KeywordBlock Editor-KeywordActionList Editor ]] <br />
* [[ KeywordBlock Editor-KeywordActionList Editor/en ]]<br />
<br />
* [[ CompoundBlock Editor-CompoundWorksheet Editor ]] <br />
* [[ CompoundBlock Editor-CompoundWorksheet Editor/en ]]<br />
* [[ CompoundBlock Editor-Environment Editor ]] <br />
* [[ CompoundBlock Editor-Environment Editor/en ]]<br />
<br />
* [[ TestDataGeneratorBlock Editor-TestData Editor ]] <br />
* [[ TestDataGeneratorBlock Editor-TestData Editor/en ]]<br />
<br />
* [[ TableDrivenBlock Editor-Table Editor ]]<br />
* [[ TableDrivenBlock Editor-Table Editor/en ]]<br />
<br />
* [[ Testplan Editor-TestplanEnvironment Editor ]] <br />
* [[ Testplan Editor-TestplanEnvironment Editor/en ]]<br />
* [[ Testplan Editor-TestplanListView Editor ]] <br />
* [[ Testplan Editor-TestplanListView Editor/en ]]<br />
* [[ Testplan Editor-ReportParameter Editor ]] <br />
* [[ Testplan Editor-ReportParameter Editor/en ]]<br />
<br />
* [[ Testsuite Editor-Environment Editor ]] <br />
* [[ Testsuite Editor-Environment Editor/en ]]<br />
* [[ Testsuite Editor-ExecutionSettings Editor ]] <br />
* [[ Testsuite Editor-ExecutionSettings Editor/en ]]<br />
* [[ Testsuite Editor-ReportParameter Editor ]] <br />
* [[ Testsuite Editor-ReportParameter Editor/en ]]<br />
* [[ Testsuite Editor-Metadata Editor ]] <br />
* [[ Testsuite Editor-Metadata Editor/en ]]<br />
* [[ Testsuite Editor-StatisticData Editor ]] <br />
* [[ Testsuite Editor-StatisticData Editor/en ]]<br />
<br />
* [[ TestsuiteHistory Editor ]] <br />
* [[ TestsuiteHistory Editor/en ]]<br />
<br />
* [[ Datatype Editor ]] <br />
* [[ Datatype Editor/en ]]<br />
<br />
* [[ Inventory Editor ]] <br />
* [[ Inventory Editor/en ]]<br />
<br />
* [[ ReportParameter Editor]]<br />
* [[ ReportParameter Editor/en]]<br />
<br />
* [[ Resource Editor ]] <br />
* [[ Resource Editor/en ]]<br />
<br />
* [[ Skill Editor ]] <br />
* [[ Skill Editor/en ]] <br />
<br />
* [[ CategoryContainer Editor ]] <br />
* [[ CategoryContainer Editor/en ]]<br />
<br />
* [[ Documentation Editor ]] <br />
* [[ Documentation Editor/en ]]<br />
<br />
* [[ FileAttachment Editor ]] <br />
* [[ FileAttachment Editor/en ]]<br />
<br />
* [[ URLAttachment Editor ]] <br />
* [[ URLAttachment Editor/en ]]<br />
<br />
* [[ ReportTemplateAttachment Editor ]] <br />
* [[ ReportTemplateAttachment Editor/en ]]<br />
<br />
* [[ GUI Editor-GUICode Editor ]] <br />
* [[ GUI Editor-GUICode Editor/en ]]<br />
<br />
==Tree-Elements==<br />
<br />
* [[ Tree Elements ]]<br />
* [[ Tree Elements/en ]]<br />
<br />
* [[ Datatype Element ]] <br />
* [[ Datatype Element/en ]]<br />
* [[ Testplan Element ]] <br />
* [[ Testplan Element/en ]]<br />
* [[ ElementaryBlock Element ]] <br />
* [[ ElementaryBlock Element/en ]]<br />
* [[ CompoundBlock Element ]] <br />
* [[ CompoundBlock Element/en ]]<br />
* [[ Inventory Element ]]<br />
* [[ Inventory Element/en ]] <br />
* [[ Skill Element ]] <br />
* [[ Skill Element/en ]] <br />
* [[ Resource Element ]] <br />
* [[ Resource Element/en ]] <br />
* [[ Attachment Element ]] <br />
* [[ Attachment Element/en ]]<br />
* [[ ReportTemplate Element ]] <br />
* [[ ReportTemplate Element/en ]]<br />
* [[ KeywordBlock Element ]] <br />
* [[ KeywordBlock Element/en ]]<br />
* [[ TestDataGeneratorBlock Element ]] <br />
* [[ TestDataGeneratorBlock Element/en ]]<br />
* [[ VirtualBlock Element ]] <br />
* [[ VirtualBlock Element/en ]]<br />
* [[ UnimplementedBlock Element ]] <br />
* [[ UnimplementedBlock Element/en ]]<br />
* [[ GUIBlock Element ]] <br />
* [[ GUIBlock Element/en ]]<br />
* [[ Block Element ]] <br />
* [[ Block Element/en ]]<br />
* [[ Folder Element ]] <br />
* [[ Folder Element/en ]]<br />
<br />
==Diagram-Elements==<br />
<br />
Achtung: DiagramElements-XXXPin gehen nun alle nach DiagramElements-Pin#typeofPin. Also z.B. DiagramElements-Pin#Enable_Output_pin.<br />
entsprechende hash-tags müssen in DiagramElements-Pin erhalten bleiben.<br />
<br />
* [[ DiagramElements-Pin ]]<br />
* [[ DiagramElements-Pin/en ]]<br />
<br />
* [[ DiagramElements-Pin#Enable Input Pin ]]<br />
* [[ DiagramElements-Pin#Cancel Input Pin ]]<br />
* [[ DiagramElements-Pin#Iterate Input Pin ]]<br />
* [[ DiagramElements-Pin#Timelimit Input Pin ]]<br />
* [[ DiagramElements-Pin#Performer Input Pin ]]<br />
* [[ DiagramElements-Pin#Input Pin ]]<br />
* [[ DiagramElements-Pin#Exception Output Pin ]]<br />
* [[ DiagramElements-Pin#Enable Output Pin ]]<br />
* [[ DiagramElements-Pin#ExecutionTime Output Pin ]]<br />
* [[ DiagramElements-Pin#Output Pin ]]<br />
<br />
* [[ DiagramElements-Step ]]<br />
* [[ DiagramElements-Step/en ]]<br />
* [[ DiagramElements-AttachmentStep ]]<br />
* [[ DiagramElements-AttachmentStep/en ]]<br />
* [[ DiagramElements-Connection ]]<br />
* [[ DiagramElements-Connection/en ]]<br />
* [[ DiagramElements-PinDescription ]]<br />
* [[ DiagramElements-PinDescription/en ]]<br />
* [[ DiagramElements-Annotation ]] <br />
* [[ DiagramElements-Annotation/en ]] <br />
* [[ DiagramElements-Probe ]]<br />
* [[ DiagramElements-Probe/en ]]<br />
<br />
== Tools ==<br />
<br />
=== Additional tools in the "Extras"-Menu ===<br />
<br />
* [[Tools_Notepad/en | Notepad]]: A postIt-like text editor and code evaluation window<br />
* [[Tools_FileBrowser/en | File Browser]]: A tool to search for and manipulate files and their contents<br />
* [[Tools_ClassBrowser/en | Class Browser]]: Expert tool to investigate and manipulate class code<br />
* [[Tools_ProcessMonitor/en | Process Monitor]]: A tool to show active execution processes (threads)<br />
* [[Tools_Transcript/en | Transcript]]: A message and trace window<br />
<br />
* [[Tools_TestSuiteDifferenceBrowser/en | Test Suite Difference Browser]]: To find differences between two test suites<br />
<br />
=== Additional functions in the "Extras" Menu ===<br />
<br />
* "Explorer" / "Explorer In...": opens a Windows Explorer window on one of the common directories (Windows platform only)<br />
* "Finder" / "Finder In...": opens a Finder window on one of the common directories (Mac OSX platform only)<br />
* Screenshot: generates a file containing a screenshot image (in bmp, png or tiff format)<br />
* [[Tools_ModelTranslationEditor/en | Model Translation Editor]]: To define language-translations for model elements<br />
* [[Tools_ImportScripts/en | Import Shell or Batch Scripts]]: To generate blocks for existing test/automation scripts<br />
<br />
=== Low level debug functions found in the "Extras"-"Debugging" Menu ===<br />
<br />
* [[ToolsMenuFunctions#ShowAllExternalConnections/en | Show all External Connections]]: To find open handles <br />
* [[ToolsMenuFunctions#ShutDownBridgeConnections/en | Shut Down Bridge Connections]]: To tear down leftover JavaBridge connections<br />
* [[ToolsMenuFunctions#CloseAllSocketConnections/en | Close all Socket Connections]]: To tear down leftover Socket (interprocess communication) connections<br />
* [[ToolsMenuFunctions#CloseAllSerialConnections/en | Close all Serial Connections]]: To tear down leftover Serial connections<br />
<br />
* [[ToolsMenuFunctions#ShowMemoryUsageByObjectType/en | Show Memory Usage by Object Type]]: Detailed information about memory usage <br />
* [[ToolsMenuFunctions#Memory_Cleanup/en | Memory Cleanup]]: Force memory cleanup to release unused resources<br />
<br />
== Elementary Block API ==<br />
* [[ Expecco API/en | Expecco API ]] - Information for Elementary Block Developers<br />
<br />
== Standard Library Reference ==<br />
<br />
The following libraries are included in the base package. <br />
No additional exptension or plugin is required.<br />
<br />
* [[ Standard Library ]] -- A common, domain independent library<br />
* [[ Expecco Reflection Library ]] -- A library to automate expecco itself<br />
<br />
== Interfacing to the System Under Test ==<br />
<br />
* [[ COM/OLE ]] -- How to invoke COM interfaces<br />
* [[ Corba ]] -- How to invoke Corba interfaces<br />
* [[ FTP ]] -- FTP interface<br />
* [[ HTTP ]] -- HTTP interface<br />
* [[ HTTPS ]] -- HTTP (SSL) interface<br />
* [[ SOAP ]] -- SOAP interface<br />
* [[ XMLRPC ]] -- XML-RPC interface<br />
* [[ REST ]] -- REST interface<br />
* [[ Telnet ]] -- Telnet interface<br />
* [[ Sockets ]] -- Generic Low Level Socket interfaces<br />
* [[ Pipes ]] -- Pipes<br />
* [[ Shared Memory ]] - Shared Memory<br />
* [[ DLL Calls ]]<br />
<br />
== Plugins and Extensions ==<br />
<br />
=== UI Testing ===<br />
<br />
* [[ Selenium Web Test Plugin ]] -- Web Page Tests and Interaction (part of the base package)<br />
* [[ Selenium Web Test Plugin/en ]]<br />
* [[ SeleniumLibrary Reference ]] -- Library reference<br />
<br />
* [[ Appium Plugin Reference ]] -- Mobile UI Testing on Android and iOS using Appium<br />
* [[ Java GUI Plugins ]]<br />
<br />
* [[WindowsAutomation_Reference_1.0| Windows Automation GUI Access Interfacing Library]]<br />
<br />
* [[Expecco_GUI Tests_Extension_Reference | GUI Browser: Expecco Extension for GUI Tests]]<br />
<br />
=== Code Execution ===<br />
<br />
* [[ Groovy Code Execution Plugin/en ]] -- allows for Groovy code to be executed on the SUT<br />
* [[ VBScript | VisualBasic Script Plugin ]] -- allows VisualBasic code to be executed either locally or on the SUT<br />
* [[ VBScript/en | VisualBasic Script Plugin/en ]] -- allows VisualBasic code to be executed either locally or on the SUT* [[ Java Browser ]] -- allows for Java classes to be browsed in the SUT<br />
* [[ Java Browser/en ]]<br />
* [[ Java Debugger ]] -- allows to debug Groovy blocks and other code executed by Java Bridge in (remote) JVM<br />
* [[ Java Debugger/en ]]<br />
* [[ SmallSense ]] -- together with [[ Java Browser/en ]] provides basic completion support for Groovy code. <br />
* [[ SmallSense/en ]]<br />
<br />
=== Manual Test Support Plugins ===<br />
<br />
* [[ Manual Test Plugin ]] -- guides users through manual tests<br />
* [[ Manual Test Import Plugin ]] -- imports test specifications written in Word or Excel<br />
<br />
=== Misc Plugins ===<br />
<br />
* [[ GembirdPowerControlPlugin Reference ]] -- control a power plug (part of the base package)<br />
<br />
=== QM Interface Plugins ===<br />
<br />
* [[ PolarionPlugin Reference ]] - automate execution from & interact with Polarion<br />
* [[ expeccoNET Plugin Reference ]] - automate execution from & interact with expeccoNET<br />
* [[ HP Quality Center Plugin Reference ]] - automate execution from and interact with HP Quality Center<br />
* [[ Jira Plugin Reference/en]] - interact with Jira<br />
* [[ Jira Plugin Reference ]] - interact with Jira<br />
<br />
=== Specification Import/Export ===<br />
<br />
* [[ WSDL Service Import Plugin ]] -- import service actions from a WSDL service description<br />
* [[ XMI Diagram Import Plugin ]] -- import XMI activity diagrams from Enterprise Architect<br />
<br />
=== Data/Message/Document Formats ===<br />
<br />
* [[ ASN1 Support ]] -- parse ASN1 specifications; read/write/verify/modify ASN1 encoded messages<br />
* [[ GDMO Support ]] -- read/write/verify/modify GDMO objects<br />
* [[ DTD, XSD Support ]] -- read type specifications<br />
* [[ SWIFT Plugin ]] -- read/write/verify/modify SWIFT messages<br />
* [[ EDI/Edifact Plugin | EDI / Edifact Plugin ]] -- read/write/verify/modify EDI messages; parse message specifications in various formats;<br />
* [[ EDI/Idoc Plugin | EDI / Idoc Plugin ]] -- to be documented<br />
* [[ EDI/X12 Plugin | EDI / X12 Plugin ]] -- to be documented<br />
* [[ PDF Support ]] -- read PDF file structure; generate PDF documents<br />
* [[ ODF Support ]] -- read ODF file structure<br />
* [[ JSON Support ]] -- encode/decode JSON messages<br />
* [[ PEG Parser ]] -- to parse arbitrary messages/texts<br />
<br />
=== Communications/Protocols ===<br />
<br />
* [[ FTP Support ]] -- ftp client / ftp server / sftp client <br />
* [[ HTTP Support ]] -- http client / http server <br />
* [[ Telnet Protocol ]] -- client / server<br />
* [[ SSL Protocol ]]<br />
* [[ IMAP & POP3 Support ]]<br />
* [[ NFS Support ]] -- server<br />
* [[ SunRPC Support ]] -- client & server<br />
* [[ Thrift Support ]] <br />
* [[ MQueue Plugin ]] -- websphere/mainframe interface<br />
* [[ Serial Port Communication ]] <br />
* [[ Parallel Port Communication ]] <br />
* [[ USB Port Communication ]] <br />
* [[ ChipCard/SmartCard Package ]] - GSM, EC, ISO7816 cards and other standards via GemPlus, Oros and other interfaces<br />
* [[ GPIB Interface ]] - measurement device interface<br />
* [[ CanBUS Interface ]] - low level interface via serial or USB interface<br />
* [[ LDAP Interface ]]<br />
* [[ OLE Interface ]]<br />
<br />
=== Databases ===<br />
* [[ ODBC Interface ]] (part of the base package) <br />
* [[ SQLite Interface ]] (part of the base package) <br />
* [[ Oracle Native Interface ]]<br />
<br />
==== NoSQL ==== <br />
* [[ Cassandra Interface ]] <br />
* [[ CouchDB Interface ]]<br />
* [[ MongoDB Interface ]]<br />
* [[ SandstoneDB Interface ]]<br />
* [[ Goods-DB Interface ]]<br />
<br />
=== API ===<br />
* [[ Plugin API ]] - information for Plugin developers<br />
<br />
== Customization ==<br />
<br />
* [[ User Defined Menu Items ]]<br />
&nbsp;<br />
<br />
== Concepts, Hints, Tips and Tricks ==<br />
<br />
* [[ expecco API ]]<br />
* [[ expecco API/en ]]<br />
* [[ Executor]]<br />
* [[ Executor#Activity]]<br />
<br />
* [[ Generating Test Data ]]<br />
* [[ Parametrizing Tests ]]<br />
* [[ Organizing Libraries ]]<br />
* [[ Reimporting a Library]]<br />
* [[ User Defined Menu Items ]]<br />
* [[ Uses of Tags ]]<br />
<br />
== Tutorials ==<br />
<br />
* [[Testing Java Applications using Groovy blocks]]<br />
* [[Testing Java Applications using Groovy blocks/en]]<br />
<br />
= expecco ALM =<br />
== Überblick ==<br />
expecco ALM (Application Lifecycle Management) <br />
<br />
=== Glossary ===<br />
<br />
=== Konzepte ===<br />
* [[ expecco ALM Concepts |Concepts ]] - concepts; testsuite, testdefinition, testschedule, testrun, testequipment<br />
* [[ expecco ALM Concepts/en | Concepts/en ]] - concepts; testsuite, testdefinition, testschedule, testrun, testequipment<br />
* [[ expecco ALM Configuration & Setup | Configuration & Setup ]] - setting up users, roles and projects<br />
* [[ expecco ALM Configuration & Setup/en | Configuration & Setup/en ]] - setting up users, roles and projects<br />
<br />
=== Release Notes ===<br />
* [[ expecco ALM Release Notes 1.9.5 | 1.9.5]]<br />
* [[ expecco ALM Release Notes/en 1.9.5 | 1.9.5/en ]]<br />
* [[ expecco ALM Release Notes 2.0.0 | 2.0.0]]<br />
* [[ expecco ALM Release Notes/en 2.0.0 | 2.0.0/en ]]<br />
<br />
== [[ expecco ALM Installation | Installation ]] ==<br />
<br />
== Webanwendung (HTTP) ==<br />
* [[ expecco ALM Personal Settings | Personal Settings ]] - editor settings<br />
* [[ expecco ALM Personal Settings/en | Personal Settings/en ]] - editor settings<br />
* [[ expeccoNET Master Menu | Master Menu]]<br />
* [[ expeccoNET Master Menu/en | Master Menu/en ]]<br />
* [[ expeccoNET Requirements UI | Requirements UI ]]<br />
* [[ expeccoNET Requirements UI/en | Requirements UI/en ]]<br />
* [[ expeccoNET Defects UI | Defects UI]]<br />
* [[ expeccoNET Defects UI/en | Defects UI/en ]]<br />
* [[ expeccoNET Actions UI | Actions UI ]]<br />
* [[ expeccoNET Actions UI/en |Actions UI/en ]]<br />
* [[ expeccoNET Tests UI | Tests UI ]]<br />
* [[ expeccoNET Tests UI/en | Tests UI/en ]]<br />
* [[ expeccoNET Projects UI | Projects UI ]]<br />
* [[ expeccoNET Projects UI/en | Projects UI/en ]]<br />
* [[ expeccoNET Organization UI | Organization UI ]]<br />
* [[ expeccoNET Organization UI/en | Organization UI/en ]]<br />
* [[ expeccoNET Settings UI | Settings UI ]]<br />
* [[ expeccoNET Settings UI/en | Settings UI/en ]]<br />
<br />
== Mobile Anwendung (Android) ==<br />
* [[expecco ALM App]]<br />
<br />
= Lizenzservice =<br />
== Allgemein ==<br />
* [[ License Server Overview | Overview]]<br />
* [[ License Server Overview/en | Overview/en ]] <br />
* [[ License Server Release Notes | Release Notes]]<br />
* [[ License Server Release Notes/en | Release Notes/en ]] <br />
* [[ Lizenzservice Installation | Installation]] - initial installation, license files, updates<br />
* [[ Lizenzservice Installation/en | Installation/en ]] - initial installation, license files, updates <br />
* [[ License Server Configuration & Setup | Configuration & Setup ]] - setting up ports and users<br />
* [[ License Server Configuration & Setup/en | Configuration & Setup/en ]] - setting up ports and users <br />
* [[ License Server Glossary | Glossary]]<br />
* [[ License Server Glossary/en | Glossary/en]]<br />
<br />
== Benutzerinterface ==<br />
* [[ License Server License Menu | License Menu ]]<br />
* [[ License Server License Menu/en | License Menu/en]]<br />
<br />
= Smalltalk =<br />
<br />
== Packages ==<br />
* [[ SOAP ]]<br />
* [[ SOAP WSDL ]]</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=WindowsAutomation_Reference_1.0&diff=6056WindowsAutomation Reference 1.02016-03-09T09:20:12Z<p>Mb: Die Seite wurde neu angelegt: „This is the WindowsAutomation-Plugin documentation. This expecco plugin provides facilities to automate tests incorporating applications with a GUI based on W…“</p>
<hr />
<div>This is the WindowsAutomation-Plugin documentation.<br />
<br />
This expecco plugin provides facilities to automate tests incorporating applications with a GUI based on Windows Presentation Foundation (WPF). It also lets you access GUI components, to use and validate them in a test.<br />
<br />
=Features=<br />
*Automated GUI testing of WPF applications<br />
*Parallel remote test-execution on multiple systems<br />
*Performs tests against completely built and executable WPF applications. No source code changes / recompilation of the application is required <br />
*Access GUI components, using XPath-like locators.<br />
*Access objects of the application live at execution time.<br />
*Consists of an expecco block library and tools which help to model tests and inspect the GUI of the application<br />
<br />
=Installation and Connection=<br />
The WindowsAutomation testing plugin uses a so called ".NET-Bridge" which consists of two parts: one side is a plugin for expecco, the other side is an .NET console application (the "WindowsAutomationApplication").<br />
<br />
==Requirements==<br />
On the test executing machine.<br />
*.NET Framework 3.5 [http://www.microsoft.com/en-us/download/details.aspx?id=21] or higher.<br />
* One of the following operation systems: <br />
::- Windows XP (with the Windows Automation API library [http://www.microsoft.com/en-us/download/details.aspx?id=13821])<br />
::- Windows Vista (with the Windows Automation API library [http://www.microsoft.com/en-us/download/details.aspx?id=23432])<br />
::- Windows 7<br />
::- Windows 8<br />
::- Windows 8.1<br />
::- Windows Server 2003 (with the Windows Automation API library [http://www.microsoft.com/en-us/download/details.aspx?id=7483])<br />
::- Windows Server 2008(with the Windows Automation API library [http://www.microsoft.com/en-us/download/details.aspx?id=11850])<br />
::- Windows Server 2008 R2<br />
::- Windows Server 2012<br />
::- Windows Server 2012 R2<br />
<br />
==Plugin Components==<br />
The plugin consists of the following parts:<br />
* The GUI Browser, used to explore your application. <br />
* The WindowsAutomation Library, provides blocks that you can use in your test-cases.<br />
* The WindowsAutomationApplication, provides the interface between the tested application and your tests (i.e. expecco).<br />
<br />
==Installing and Configuring the Plugin in Expecco==<br />
The plugin is usually installed automatically by the installer; either included in the main expecco installation or provided as a separate installable add-on package. Its files are stored in the "plugin" subfolder of the expecco installation folder. You can also copy those files manually to that folder, if required. Expecco detects the plugin automatically during startup. So it may be required to restart any expecco session.<br />
<br />
If you want expecco to automatically connect to the local computer by opening up a connection navigate to "Extras->Settings->Plugins->WindowsAutomation". Make sure the Path of the WindowsAutomationApplication is entered correctly and the checkbox is selected.<br><br />
To set up a manual connection unselect the checkbox, open up the connection in expecco and subsequently start the WindowsAutomationApplication.<br />
<br />
==Installing and Running the WindowsAutomationApplication==<br />
The ''WindowsAutomationApplication'' is a .NET console application. It uses the so calles ".Net-Bridge" to connect to expecco. You just need to copy the folder containing the "WindowsAutomationApplication.exe" to the computer you want to run the tests on. The ''WindowsAutomationApplication'' does not need any further installation. <br />
<br />
To run the client manually and connect to expecco on the default port, port ''9988'', without any extentions just double click onto the "WindowsAutomationApplication.exe".<br />
<br />
===Arguments===<br />
[[Bild:WindowsAutomation&DevExpress.png|thumb|220px|The GuiBrowser with and without the DevExpress extention.]]<br />
{| class="wikitable"<br />
|-<br />
! Arguments !! Description<br />
|-<br />
| -port <int> || The TCP-Port to run the connection on.<br />
|-<br />
| -mode <server/client>|| To start the .Net-Bridge as TCP-Server or to run as TCP-Client.<br />
|-<br />
| -keepAlive <true/false>|| To keep the .Net-Bridge alive for reconnect. (If started as Server only!)<br />
|-<br />
| -log <path> || Path to write a logfile.<br />
|}<br />
<br />
===Additional Arguments for the WindowsAutomationApplication.DevExpress===<br />
The WindowsAutomationApplication.DevExpress is an enhanced client application for the PlugIn. It can be used to browse through applications build with DevExpress. To take benefit out of the extention you have to extend the applications you want to browse through.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Arguments !! Description<br />
|-<br />
| -extend <path> || Path of an application within the .Net-VM to be shown with the DevExpress extention. <br />
|-<br />
| -extendDynamically <true/false>|| To work with dynamic gui applicactions or save some performance.<br />
|-<br />
| -recordMap <path> || Path to wite a xMap for an extended application.<br />
|-<br />
| -map <path> || Path of an xMap to extend the Browser with.<br />
|}<br />
<br />
<br />
If you want to run the ''WindowsAutomationApplication'' on another TCP port you have to start the client using the command prompt, specifying the port number using the ''-port'' parameter.<br />
C:\Programme\exept\expecco\plugin\windowsAutomation\systemDLL\WindowsAutomationIDEClient>WindowsAutomationApplication.exe -port 9987<br />
<br />
=Settings=<br />
[[Bild:WinAuto_settings.PNG|thumb|220px|Windows Automation settings dialog.]]<br />
Open "Extras->Settings->Plugins->WindowsAutomation" to inspect or change the plugin settings. The settings are composed in four categories: connection settings, execution settings, recording settings and advanced settings. <br />
<br />
For further information on connection settings please refer to the chapter "Installation and Connection".<br />
<br />
<br />
The execution settings affect the way blocks are executed. You are able to decide how they respond to a failure while execution. Potentially an element they are trying to adress isn't propperly constructed yet. If the check box "Retry Execution" is checked the delay time adjusted in the text box "Execution Timeout" will be applied and the exection will be repeated till an error apperars.<br />
<br />
<br />
In the recording settings you can select wich devices you want to record. You have the choice between mouse, keybord or both of them. <br />
The recording mode can be switched. Recording input devides is default and recommended. However you can use recording keycodes to record key combinations and hotkeys. Due to performance and stability issues the use of recording keycodes isn't recomendet if another recording mode can be used. <br />
<br />
Another option ist to record event based changes. Recording events is a higher level way of recording. Since handles have to been added to the windows only windows opened after recording was initialized are recordet properly. Events are a clean and simple way of recording if the application you want to record interaction with does support them.<br />
<br />
Recording all events isn't resommended since one user interaction might trigger few events.<br />
<br />
<br />
The check box "Filter Windows GUI Elements" allows you to activate or deactivate a filter in the GUI Browser. If it is activated you just see windows belonging to applications. The menu bar, file system windows and temporarily shown windows for example tool tip windows aren't displayed. <br />
If you activate "Show Warnings" unexpected events occurring during the connection will raise a warning message.<br />
<br />
The check box "Update Top Elements" allows you to decide if new applications appear in the tree of the GUI Browser by themself. Please be aware that the plugin might run smoother if this check box is unselected.<br />
<br />
=GUI Browser=<br />
The GUI browser allows you to explore a running WPF application. You can browse the application, inspect element properties and execute actions. For a more detailed description on how to use and what to do with the GUI browser also see [[Expecco GUI Tests Extension Reference]].<br />
<br />
=WindowsAutomation Library=<br />
[[Bild:WinAuto_lib.PNG|thumb|220px|The Windows Automation library.]]<br />
For automation and testing of an application, a library of building blocks is provided, which contains functional blocks for all of those operations. <br />
<br />
The ''WindowsAutomation Library'' consists of a set of predefined function blocks which are used to model your tests. Import this library via expecco's "Import Library" menu-function.<br />
<br />
<br />
==Connections==<br />
:;Settings<br />
:: Settings valid for the current connection. You usually don't need to make a change on these.<br />
<br />
::;Set Execution Timeout<br />
::: Set the timeout for each execution.<br />
::: '''timeout''' <Integer> - Timeout in milliseconds.<br />
<br />
::;Set Execution Delay<br />
::: Set the delay between each try for each execution.<br />
::: '''delay''' <Integer> - Delay in milliseconds.<br />
<br><br />
<br />
:;Setup Connection<br />
:: Establish a connection to a target host by its network address.<br />
:: Optional: '''ip''' <String> - The IP-network address or host name of the host you want to connect to. Default is '''localhost'''.<br />
:: Optional: '''port''' <Integer> - The TCP port to use for the connection. The default port is '''9988'''.<br />
:: Optional: '''name''' <String> - A identifier for the connection. Default is '''local'''.<br />
<br />
:;Close Connection<br />
:: Close down all connections.<br />
<br />
==Elements==<br />
Element actions, sorted by the type of components and pattern.<br />
<br />
===By Components===<br />
[[Bild:WinAuto_byComponent.PNG|thumb|220px|By Components.]]<br />
Element actions sorted by the type of components.<br />
<br />
:;Click<br />
:: Click onto an element.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
:;Double Click<br />
:: Double-Click onto an element.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
:;Right Click<br />
:: Right-Click onto an element.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
:;Set Focus<br />
:: Set the focus onto an element.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
:; Get Property Value<br />
:: Get any property value.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
:: '''property''' <String> - The identifier for a property, for example to get the property value.<br />
:: Return: '''value''' <String> - The current property value.<br />
<br />
:; Get Property Value As Boolean<br />
:: Get any property value as boolean.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
:: '''property''' <String> - The identifier for a property, for example to get the property value.<br />
:: Return: '''isBoolean''' <Boolean> - Identifies whether the property has a boolean value or not.<br />
:: Return: '''value''' <Boolean> - The current property value.<br />
<br />
:; Is Boolean Property<br />
:: Check if a property value is boolean.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
:: '''property''' <String> - The identifier for a property, for example to get the property value.<br />
:: Return: '''isBoolean''' <Boolean> - Identifies whether the property has a boolean value or not.<br />
<br />
:; Get Name<br />
:: Get the name.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
:: Return: '''name''' <String> - The elements current name.<br />
<br />
:; Get Class Name<br />
:: Get the classname.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
:: Return: '''className''' <String> - The elements current classname.<br />
<br />
:; Get Position<br />
:: Get the position.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
:: Return: '''position''' <String> - The elements current position.<br />
<br />
:; Is Enabled<br />
:: Check if the element is enabled.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
:: Return: '''isEnabled''' <Boolean> - Identifies if the element is enabled or not.<br />
<br />
:; Is Focusable<br />
:: Check if the element in focusable.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
:: Return: '''isFacusable''' <Boolean> - Identifies if the element is focusable or not.<br />
<br><br />
<br />
:;Button<br />
<br />
::;Perform Click<br />
::: Simulate the click onto a button.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br><br />
<br />
:;RadioButton<br />
<br />
::;Select<br />
::: Select an Item.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::;Unselect<br />
::: Unselect an Item.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::;Toggle<br />
::: Toogle between states.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::; Is Selected<br />
::: Check if the RadioButton is selected.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: Return: '''isSelected''' <Boolean> - Identifies if the element is currently selected.<br />
<br><br />
<br />
:;CheckBox<br />
<br />
::;Check<br />
::: Check the CheckBox.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::;Uncheck<br />
::: Uncheck the CheckBox.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::;Toggle<br />
::: Toogle the state.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::; Is Checked<br />
::: Check if the CheckBox is checked.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: Return: '''isChecked''' <Boolean> - Identifies if the element is currently checked.<br />
<br />
<br><br />
<br />
:;List<br />
<br />
::;Has Enabled List Item<br />
::: Check if List has specified Child List Item and if Child List Item is enabled.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''entryName''' <String> - Identifier for the child element.<br />
::: Return: '''hasEnabledEntry''' <Boolean> - Identifies if the specified element is a child list item.<br />
::: Return: '''path''' <String> - Identifies for the element.<br />
<br />
::;Has List Item<br />
::: Check if List has specified Child List Item.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''entryName''' <String> - Identifier for the child element.<br />
::: Return: '''hasEntry''' <Boolean> - Identifies if the specified element is a child list item.<br />
::: Return: '''path''' <String> - Identifies for the element.<br />
<br><br />
<br />
:;Menu<br />
<br />
::;Get Menu Entry Property Value<br />
::: Get any property value for Child Menu Entry.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''entryName''' <String> - Identifier for the child element.<br />
::: '''property''' <String> - The identifier for a property, for example to get the property value.<br />
::: Return: '''value''' <String> - The current property value.<br />
<br />
::;Has Enabled Menu Entry<br />
::: Check if Menu has specified Child Menu Item and if Child Menu Item is enabled.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''entryName''' <String> - Identifier for the child element.<br />
::: Return: '''hasEnabledEntry''' <Boolean> - Identifies if the specified element is a child menu item.<br />
::: Return: '''path''' <String> - Identifies for the element.<br />
<br />
::;Has Menu Entry<br />
::: Check if Menu has specified Child Menu Item.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''entryName''' <String> - Identifier for the child element.<br />
::: Return: '''hasEntry''' <Boolean> - Identifies if the specified element is a child menu item.<br />
::: Return: '''path''' <String> - Identifies for the element.<br />
<br />
::;Select Menu Entry<br />
::: Select an Child Menu Item.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''entry name''' <String> - Identifier for the child element.<br />
::: Return: '''entryPath''' <String> - Identifier of selected Menu. Can be used to cascade menus.<br />
<br />
::;Open Menu<br />
::: Perform the Action of an Menu Item.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
<br><br />
<br />
:;ScrollBar<br />
<br />
::;Scroll<br />
::: Scroll for a large decrement.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::;Scroll Small Decrement<br />
::: Scroll for a small decrement.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::; Is Horizontal Oriented<br />
::: Check the scrollbars orientation.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: Return: '''isHorizontal''' <Boolean> - Identifies if the element is aligned in a horizontal direction.<br />
<br />
::; Is Vertical Oriented<br />
::: Check the scrollbars orientation.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: Return: '''isVertical''' <Boolean> - Identifies if the element is aligned in a vertical direction.<br />
<br><br />
<br />
:;Tab<br />
<br />
::;Has Enabled Tab Item<br />
::: Check if Tab has specified Child Tab Item and if Child Tab Item is enabled.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''entryName''' <String> - Identifier for the child element.<br />
::: Return: '''hasEnabledEntry''' <Boolean> - Identifies if the specified element is a child tab item.<br />
::: Return: '''path''' <String> - Identifies for the element.<br />
<br />
::;Has Tab Item<br />
::: Check if Tab has specified Child Tab Item.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''entryName''' <String> - Identifier for the child element.<br />
::: Return: '''hasEntry''' <Boolean> - Identifies if the specified element is a child tab item.<br />
::: Return: '''path''' <String> - Identifies for the element.<br />
<br><br />
<br />
:;Text<br />
<br />
::;Set Text<br />
::: Change the text.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''text''' <String> - Text to change to.<br />
<br />
::; Is Read Only<br />
::: Check if the field is read only.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: Return: '''isReadOnly''' <Boolean> - Identifies if the element is read only or not.<br />
<br />
::; Has Keyboard Focus<br />
::: Check if the element does have the focus.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: Return: '''hasFocus''' <Boolean> - Identifies if the element is currently focused.<br />
<br><br />
<br />
:;Tree<br />
<br />
::;Has Enabled Tree Item<br />
::: Check if Treehas specified Child Tree Item and if Child Tree Item is enabled.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''entryName''' <String> - Identifier for the child element.<br />
::: Return: '''hasEnabledEntry''' <Boolean> - Identifies if the specified element is a child tree item.<br />
::: Return: '''path''' <String> - Identifies for the element.<br />
<br />
::;Has Tree Item<br />
::: Check if Tab has specified Child Tree Item.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''entryName''' <String> - Identifier for the child element.<br />
::: Return: '''hasEntry''' <Boolean> - Identifies if the specified element is a child tree item.<br />
::: Return: '''path''' <String> - Identifies for the element.<br />
<br><br />
<br />
:;Window<br />
<br />
::;Maximize<br />
::: Maximize an window.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::;Minimize<br />
::: Minimize an window.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::;Normalize<br />
::: Normalize an window.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::;Close<br />
::: Close an window.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::;Rotate<br />
::: Rotate an window.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''value''' <String> - The degree you want to rotate the window.<br />
<br />
::;Resize<br />
::: Resize an window.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''valueForX''' <String> - New size for dimention x.<br />
::: '''valueForY''' <String> - New size for dimention y.<br />
<br />
::;Move<br />
::: Move an window.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''valueForX''' <String> - X-coordinate you want to move the upper left corner of the window to.<br />
::: '''valueForY''' <String> - Y-coordinate you want to move the upper left corner of the window to.<br />
<br />
::; Get Interaction State<br />
::: Get the interaction state.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: Return: '''state''' <String> - The window interaction state.<br />
<br />
::; Get Visual State<br />
::: Get the visual state.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: Return: '''state''' <String> - The current visual state.<br />
<br />
::; Is Maximized<br />
::: Check if the window is maximized.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: Return: '''isMaximized''' <Boolean> - Identifies if the element is maximized.<br />
<br />
::; Is Minimized<br />
::: Check if the window is minimized.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: Return: '''isMinimized''' <Boolean> - Identifies if the element is minimized.<br />
<br />
::; Is Topmost<br />
::: Check if the window is topmost.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: Return: '''isTopmost''' <Boolean> - Identifies if the element is topmost.<br />
<br />
<br />
::; Is Offscreen<br />
::: Check if the window is offscreen.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: Return: '''isOffscreen''' <Boolean> - Identifies if the element is aligned in offscreen.<br />
<br />
::; Can Maximize<br />
::: Check if the window can maximize.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: Return: '''canMaximize''' <Boolean> - Identifies if the window can be maximized.<br />
<br />
::; Can Minimize<br />
::: Check if the window can minimize.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: Return: '''canMinimize''' <Boolean> - Identifies if the window can be minimized.<br />
<br />
::; Can Move<br />
::: Check if the window can move.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: Return: '''canMove''' <Boolean> - Identifies if the window can be moved.<br />
<br />
::; Can Rotate<br />
::: Check if the window can rotate.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: Return: '''canRotate''' <Boolean> - Identifies if the window can be rotated.<br />
<br />
::; Can Resize<br />
::: Check if the window can resize.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: Return: '''canResize''' <Boolean> - Identifies if the window can be resized.<br />
<br><br />
<br />
===By Pattern===<br />
[[Bild:WinAuto_byPattern.PNG|thumb|220px|By Pattern.]]<br />
Element actions sorted by there pattern. <br />
If you want to lern more about UI Automation Control Pattern you can find the documentation at the MSDN [http://msdn.microsoft.com/library/ms752362].<br />
<br />
:;Invoke Pattern<br />
<br />
::;Invoke<br />
::: Invoke an Element, for Example an Button and perform its distinct Action.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br><br />
<br />
:;Menu Pattern<br />
<br />
::;Click Menu<br />
::: Perform the Action of an Menu Item.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br><br />
<br />
:;Scroll Item Pattern<br />
<br />
::;Scroll<br />
::: Scroll for a large decrement.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::;Scroll Small Decrement<br />
:::Scroll for a small decrement.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
<br><br />
<br />
:;Selection Item Pattern<br />
<br />
::;AddSelection<br />
::: Select an Item.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::;RemoveSelection<br />
::: Unselect an Item.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br><br />
<br />
:;Toogle Pattern<br />
<br />
::;Toggle<br />
::: Toogle an Element, for Example an Button and Switch its Status.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br><br />
<br />
:;Transform Pattern<br />
<br />
::;Rotate<br />
::: Rotate an window.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''value''' <String> - The degree you want to rotate the window.<br />
<br />
::;Resize<br />
::: Resize an window.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''valueForX''' <String> - New size for dimention x.<br />
::: '''valueForY''' <String> - New size for dimention y.<br />
<br />
::;Move<br />
::: Move an window.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''valueForX''' <String> - X-coordinate you want to move the upper left corner of the window to.<br />
::: '''valueForY''' <String> - Y-coordinate you want to move the upper left corner of the window to.<br />
<br />
<br><br />
<br />
:;Window Pattern<br />
<br />
::;Maximize Window<br />
::: Maximize an window.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::;Minimize Window<br />
::: Minimize an window.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::;Normalize Window<br />
::: Normalize an window.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::;Close Window<br />
::: Close an window.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
<br><br />
<br />
:;Value Pattern<br />
<br />
::;Set Value<br />
::: Change the value, for example the text, of an element.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''value''' <String> - Value to change to.<br />
<br />
<br><br />
<br />
==Implementation==<br />
Blocks implementing core functionality are stored in here. <br />
They shouldn't be needed for building up tests.<br />
<br />
==Input Devices==<br />
[[Bild:WinAuto_inputDevices.PNG|thumb|220px|Input Devices.]]<br />
Mouse and Keybord operations are implemented in here.<br />
<br />
===Mouse===<br />
:;Click<br />
:: Click onto an element.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
:;Double Click<br />
:: Double-Click onto an element.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
:;Right Click<br />
:: Right-Click onto an element.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
===Keybord===<br />
:;Backspace<br />
:: Simulateing stroke onto backspace.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
:;Caps Lock<br />
:: Simulateing stroke onto caps lock.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
:;Enter<br />
:: Simulateing stroke onto enter.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
:;Esc<br />
:: Simulateing stroke onto escape.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
:;Space Bar<br />
:: Simulateing stroke onto the space bar.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
:;Tab<br />
:: Simulateing stroke onto tab.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
<br><br />
<br />
:;Any Key<br />
<br />
::; Send Key<br />
::: Simulateing stroke onto any key.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''key''' <String> - Key or text you want to simulate key strokes for.<br />
<br />
::; Send Key + CTRL<br />
::: Simulateing stroke onto a function key while ctrl is pressed.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''key''' <String> - Key or text you want to simulate key strokes for.<br />
<br />
::; Send Key + ALT<br />
::: Simulateing stroke onto a function key while alt is pressed.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''key''' <String> - Key or text you want to simulate key strokes for.<br />
<br />
::; Send Key + SHIFT<br />
::: Simulateing stroke onto a function key while shift is pressed.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''key''' <String> - Key or text you want to simulate key strokes for.<br />
<br />
::; Send Key + CTRL + ALT<br />
::: Simulateing stroke onto a function key while ctrl and alt are pressed.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''key''' <String> - Key or text you want to simulate key strokes for.<br />
<br />
::; Send Random Phrase<br />
::: Simulate the key stroes for the input of a random phrase.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
<br><br />
<br />
:;Arrow Key<br />
<br />
::; Up<br />
::: Simulateing stroke onto up.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::; Down<br />
::: Simulateing stroke onto down.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::; Right<br />
::: Simulateing stroke onto right.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::; Left<br />
::: Simulateing stroke onto left.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
<br><br />
<br />
:;Function Key<br />
<br />
::; F1 ... F12<br />
::: Simulateing stroke onto a function key.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
<br><br />
<br />
:;Numpad<br />
<br />
::; Num Lock<br />
::: Simulateing stroke onto numlock.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::; +<br />
::: Simulateing stroke onto plus.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::; -<br />
::: Simulateing stroke onto minus.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::; *<br />
::: Simulateing stroke onto times.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::; /<br />
::: Simulateing stroke onto divide.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::; End<br />
::: Simulateing stroke onto end.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::; Page Down<br />
::: Simulateing stroke onto page down.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::; Page UP<br />
::: Simulateing stroke onto page up.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::; Home<br />
::: Simulateing stroke onto pos1.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::; Insert<br />
::: Simulateing stroke onto insert.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
::; Delete<br />
::: Simulateing stroke onto delete.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
<br />
==Properties==<br />
[[Bild:WinAuto_properties.PNG|thumb|220px|Properties.]]<br />
Blocks to access propertie values.<br />
<br />
:;Get Property Value<br />
:: Get any property value.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
:: '''property''' <String> - The identifier for a property, for example to get the property value.<br />
:: Return: '''value''' <String> - The current property value.<br />
<br />
:;Get Name<br />
:: Get the name.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
:: Return: '''name''' <String> - The elements current name.<br />
<br />
:;Get Class Name<br />
:: Get the classname.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
:: Return: '''classname''' <String> - The elements current classname.<br />
<br />
:;Get Position<br />
:: Get the position.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
:: Return: '''position''' <String> - The elements current position.<br />
<br />
:;Is Enabled<br />
:: Check if the element is enabled.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
:: Return: '''isEnabled''' <Boolean> - Identifies if the element is enabled or not.<br />
<br />
:;Is Focusable<br />
:: Check if the element in focusable.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
:: Return: '''isFocusable''' <Boolean> - Identifies if the element is focusable or not.<br />
<br><br />
<br />
:;Boolean<br />
<br />
::; Get Property Value As Boolean<br />
::: Get any property value as boolean.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''property''' <String> - The identifier for a property, for example to get the property value.<br />
::: Return: '''isBoolean''' <Boolean> - Identifies whether the property has a boolean value or not. <br />
::: Return: '''value''' <String> - The current property value.<br />
<br />
::; Is Boolean Property<br />
::: Check if a property value is boolean.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''property''' <String> - The identifier for a property, for example to get the property value.<br />
::: Return: '''isBoolean''' <Boolean> - Identifies whether the property has a boolean value or not. <br />
<br />
::; Is True<br />
::: Check if a property value is true.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''property''' <String> - The identifier for a property, for example to get the property value.<br />
::: Return: '''isTrue''' <Boolean> - Identifies whether the property equals true or not. If the value is not true it does not equal false in either case!<br />
<br />
::; Is False<br />
::: Check if a property value is false.<br />
::: '''path''' <String> - Identifier for the element a command should be executed for.<br />
::: '''property''' <String> - The identifier for a property, for example to get the property value.<br />
::: Return: '''isFalse''' <Boolean> - Identifies whether the property equals false or not. If the value is not false it does not equal true in either case!<br />
<br />
==Search Subtree==<br />
[[Bild:WinAuto_subtree.PNG|thumb|220px|Search Subtree.]]<br />
Blocks to search the subtree of an element for children.<br />
<br />
:;Search For Property<br />
:: Search for any property value.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
:: '''propertyName''' <String> - The identifier for a property.<br />
:: '''propertyValue''' <String> - The value to identify the child element.<br />
:: Return: '''elementFound''' <Boolean> - True if the specified element could be found, false if not.<br />
:: Return: '''foundElement''' <String> - The xPath to the found element.<br />
<br />
:;Search For Bounding Rectangle<br />
:: Search for a specific name property.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
:: '''boundingRectangle''' <String> - The boundingRectangle of the element.<br />
:: Return: '''elementFound''' <Boolean> - True if the specified element could be found, false if not.<br />
:: Return: '''foundElement''' <String> - The xPath to the found element.<br />
<br />
:;Search For Name<br />
:: Search for a specific name property.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
:: '''name''' <String> - The name of the element.<br />
:: Return: '''elementFound''' <Boolean> - True if the specified element could be found, false if not.<br />
:: Return: '''foundElement''' <String> - The xPath to the found element.<br />
<br />
:;Search For Value<br />
:: Search for a specific value property.<br />
:: '''path''' <String> - Identifier for the element a command should be executed for.<br />
:: '''value ''' <String> - The value of the element.<br />
:: Return: '''elementFound''' <Boolean> - True if the specified element could be found, false if not.<br />
:: Return: '''foundElement''' <String> - The xPath to the found element.<br />
<br />
=Example=<br />
An tutorial on how to use the Windows Automation Plugin can be found here: [[First Steps with Windows Automation]]</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Themensammlung&diff=6055Themensammlung2016-03-09T09:19:20Z<p>Mb: </p>
<hr />
<div><br />
= expecco =<br />
<br />
== Release Notes ==<br />
<br />
* [[ Release Notes expecco]]<br />
* [[ Release Notes expecco/en ]]<br />
<br />
== General ==<br />
<br />
* [[ expecco Overview | Overview]] -- Empty!<br />
* [[ expecco Overview/en | Overview/en ]] -- empty!<br />
* [[ Installation ]] - initial installation, license files, patches<br />
* [[ Installation/en ]] - initial installation, license files, patches<br />
* [[ Configuration & Setup ]] - jre/jdk setup, pathes<br />
* [[ Configuration & Setup/en ]] - jre/jdk setup, pathes<br />
* [[ Personal Settings ]] - editor settings<br />
* [[ Personal Settings/en ]] - editor settings<br />
* [[ Report Generation ]]<br />
* [[ Report Generation/en ]]<br />
* [[ Concepts]] - concepts; testplan, testcase, activities, verdicts<br />
* [[ Concepts/en]] - concepts; testplan, testcase, activities, verdicts<br />
* [[ Command Line Options | Command Line Options and RPC Services ]]<br />
* [[ Command Line Options/en | Command Line Options and RPC Services/en ]]<br />
* [[ Glossary ]]<br />
* [[ Glossary/en ]]<br />
* [[ FAQ ]]<br />
* [[ FAQ/en ]]<br />
<br />
== expecco UI ==<br />
<br />
* [[ Menu ]] empty!<br />
* [[ Menu/en ]] empty!<br />
* [[ Toolbar ]] empty!<br />
* [[ Toolbar/en ]] empty!<br />
* [[ Navigation Tree ]] empty!<br />
* [[ Navigation Tree/en ]] empty!<br />
* [[ Settings ]] empty!<br />
* [[ Settings/en ]] empty!<br />
* [[ Testsuite Browser ]] empty!<br />
* [[ Testsuite Browser/en ]] empty!<br />
* [[ Expecco Remote Control APP ]]<br />
<br />
== Editors ==<br />
<br />
* [[ Scheme Editor ]] <br />
* [[ Scheme Editor/en ]]<br />
* [[ Documentation Editor ]] <br />
* [[ Documentation Editor/en ]]<br />
* [[ History Editor ]] <br />
* [[ History Editor/en ]]<br />
* [[ BlockFunctionalityTestEditor ]] <br />
* [[ BlockFunctionalityTestEditor/en ]]<br />
* [[ BlockFunctionalityRunner ]] <br />
* [[ BlockFunctionalityRunner/en ]]<br />
* [[ BlockSkill Editor ]] <br />
* [[ BlockSkill Editor/en ]]<br />
<br />
* [[ ElementaryBlock Editor-Code Editor ]] <br />
* [[ ElementaryBlock Editor-Code Editor/en ]]<br />
<br />
* [[ KeywordBlock Editor-KeywordActionList Editor ]] <br />
* [[ KeywordBlock Editor-KeywordActionList Editor/en ]]<br />
<br />
* [[ CompoundBlock Editor-CompoundWorksheet Editor ]] <br />
* [[ CompoundBlock Editor-CompoundWorksheet Editor/en ]]<br />
* [[ CompoundBlock Editor-Environment Editor ]] <br />
* [[ CompoundBlock Editor-Environment Editor/en ]]<br />
<br />
* [[ TestDataGeneratorBlock Editor-TestData Editor ]] <br />
* [[ TestDataGeneratorBlock Editor-TestData Editor/en ]]<br />
<br />
* [[ TableDrivenBlock Editor-Table Editor ]]<br />
* [[ TableDrivenBlock Editor-Table Editor/en ]]<br />
<br />
* [[ Testplan Editor-TestplanEnvironment Editor ]] <br />
* [[ Testplan Editor-TestplanEnvironment Editor/en ]]<br />
* [[ Testplan Editor-TestplanListView Editor ]] <br />
* [[ Testplan Editor-TestplanListView Editor/en ]]<br />
* [[ Testplan Editor-ReportParameter Editor ]] <br />
* [[ Testplan Editor-ReportParameter Editor/en ]]<br />
<br />
* [[ Testsuite Editor-Environment Editor ]] <br />
* [[ Testsuite Editor-Environment Editor/en ]]<br />
* [[ Testsuite Editor-ExecutionSettings Editor ]] <br />
* [[ Testsuite Editor-ExecutionSettings Editor/en ]]<br />
* [[ Testsuite Editor-ReportParameter Editor ]] <br />
* [[ Testsuite Editor-ReportParameter Editor/en ]]<br />
* [[ Testsuite Editor-Metadata Editor ]] <br />
* [[ Testsuite Editor-Metadata Editor/en ]]<br />
* [[ Testsuite Editor-StatisticData Editor ]] <br />
* [[ Testsuite Editor-StatisticData Editor/en ]]<br />
<br />
* [[ TestsuiteHistory Editor ]] <br />
* [[ TestsuiteHistory Editor/en ]]<br />
<br />
* [[ Datatype Editor ]] <br />
* [[ Datatype Editor/en ]]<br />
<br />
* [[ Inventory Editor ]] <br />
* [[ Inventory Editor/en ]]<br />
<br />
* [[ ReportParameter Editor]]<br />
* [[ ReportParameter Editor/en]]<br />
<br />
* [[ Resource Editor ]] <br />
* [[ Resource Editor/en ]]<br />
<br />
* [[ Skill Editor ]] <br />
* [[ Skill Editor/en ]] <br />
<br />
* [[ CategoryContainer Editor ]] <br />
* [[ CategoryContainer Editor/en ]]<br />
<br />
* [[ Documentation Editor ]] <br />
* [[ Documentation Editor/en ]]<br />
<br />
* [[ FileAttachment Editor ]] <br />
* [[ FileAttachment Editor/en ]]<br />
<br />
* [[ URLAttachment Editor ]] <br />
* [[ URLAttachment Editor/en ]]<br />
<br />
* [[ ReportTemplateAttachment Editor ]] <br />
* [[ ReportTemplateAttachment Editor/en ]]<br />
<br />
* [[ GUI Editor-GUICode Editor ]] <br />
* [[ GUI Editor-GUICode Editor/en ]]<br />
<br />
==Tree-Elements==<br />
<br />
* [[ Tree Elements ]]<br />
* [[ Tree Elements/en ]]<br />
<br />
* [[ Datatype Element ]] <br />
* [[ Datatype Element/en ]]<br />
* [[ Testplan Element ]] <br />
* [[ Testplan Element/en ]]<br />
* [[ ElementaryBlock Element ]] <br />
* [[ ElementaryBlock Element/en ]]<br />
* [[ CompoundBlock Element ]] <br />
* [[ CompoundBlock Element/en ]]<br />
* [[ Inventory Element ]]<br />
* [[ Inventory Element/en ]] <br />
* [[ Skill Element ]] <br />
* [[ Skill Element/en ]] <br />
* [[ Resource Element ]] <br />
* [[ Resource Element/en ]] <br />
* [[ Attachment Element ]] <br />
* [[ Attachment Element/en ]]<br />
* [[ ReportTemplate Element ]] <br />
* [[ ReportTemplate Element/en ]]<br />
* [[ KeywordBlock Element ]] <br />
* [[ KeywordBlock Element/en ]]<br />
* [[ TestDataGeneratorBlock Element ]] <br />
* [[ TestDataGeneratorBlock Element/en ]]<br />
* [[ VirtualBlock Element ]] <br />
* [[ VirtualBlock Element/en ]]<br />
* [[ UnimplementedBlock Element ]] <br />
* [[ UnimplementedBlock Element/en ]]<br />
* [[ GUIBlock Element ]] <br />
* [[ GUIBlock Element/en ]]<br />
* [[ Block Element ]] <br />
* [[ Block Element/en ]]<br />
* [[ Folder Element ]] <br />
* [[ Folder Element/en ]]<br />
<br />
==Diagram-Elements==<br />
<br />
Achtung: DiagramElements-XXXPin gehen nun alle nach DiagramElements-Pin#typeofPin. Also z.B. DiagramElements-Pin#Enable_Output_pin.<br />
entsprechende hash-tags müssen in DiagramElements-Pin erhalten bleiben.<br />
<br />
* [[ DiagramElements-Pin ]]<br />
* [[ DiagramElements-Pin/en ]]<br />
<br />
* [[ DiagramElements-Pin#Enable Input Pin ]]<br />
* [[ DiagramElements-Pin#Cancel Input Pin ]]<br />
* [[ DiagramElements-Pin#Iterate Input Pin ]]<br />
* [[ DiagramElements-Pin#Timelimit Input Pin ]]<br />
* [[ DiagramElements-Pin#Performer Input Pin ]]<br />
* [[ DiagramElements-Pin#Input Pin ]]<br />
* [[ DiagramElements-Pin#Exception Output Pin ]]<br />
* [[ DiagramElements-Pin#Enable Output Pin ]]<br />
* [[ DiagramElements-Pin#ExecutionTime Output Pin ]]<br />
* [[ DiagramElements-Pin#Output Pin ]]<br />
<br />
* [[ DiagramElements-Step ]]<br />
* [[ DiagramElements-Step/en ]]<br />
* [[ DiagramElements-AttachmentStep ]]<br />
* [[ DiagramElements-AttachmentStep/en ]]<br />
* [[ DiagramElements-Connection ]]<br />
* [[ DiagramElements-Connection/en ]]<br />
* [[ DiagramElements-PinDescription ]]<br />
* [[ DiagramElements-PinDescription/en ]]<br />
* [[ DiagramElements-Annotation ]] <br />
* [[ DiagramElements-Annotation/en ]] <br />
* [[ DiagramElements-Probe ]]<br />
* [[ DiagramElements-Probe/en ]]<br />
<br />
== Tools ==<br />
<br />
=== Additional tools in the "Extras"-Menu ===<br />
<br />
* [[Tools_Notepad/en | Notepad]]: A postIt-like text editor and code evaluation window<br />
* [[Tools_FileBrowser/en | File Browser]]: A tool to search for and manipulate files and their contents<br />
* [[Tools_ClassBrowser/en | Class Browser]]: Expert tool to investigate and manipulate class code<br />
* [[Tools_ProcessMonitor/en | Process Monitor]]: A tool to show active execution processes (threads)<br />
* [[Tools_Transcript/en | Transcript]]: A message and trace window<br />
<br />
* [[Tools_TestSuiteDifferenceBrowser/en | Test Suite Difference Browser]]: To find differences between two test suites<br />
<br />
=== Additional functions in the "Extras" Menu ===<br />
<br />
* "Explorer" / "Explorer In...": opens a Windows Explorer window on one of the common directories (Windows platform only)<br />
* "Finder" / "Finder In...": opens a Finder window on one of the common directories (Mac OSX platform only)<br />
* Screenshot: generates a file containing a screenshot image (in bmp, png or tiff format)<br />
* [[Tools_ModelTranslationEditor/en | Model Translation Editor]]: To define language-translations for model elements<br />
* [[Tools_ImportScripts/en | Import Shell or Batch Scripts]]: To generate blocks for existing test/automation scripts<br />
<br />
=== Low level debug functions found in the "Extras"-"Debugging" Menu ===<br />
<br />
* [[ToolsMenuFunctions#ShowAllExternalConnections/en | Show all External Connections]]: To find open handles <br />
* [[ToolsMenuFunctions#ShutDownBridgeConnections/en | Shut Down Bridge Connections]]: To tear down leftover JavaBridge connections<br />
* [[ToolsMenuFunctions#CloseAllSocketConnections/en | Close all Socket Connections]]: To tear down leftover Socket (interprocess communication) connections<br />
* [[ToolsMenuFunctions#CloseAllSerialConnections/en | Close all Serial Connections]]: To tear down leftover Serial connections<br />
<br />
* [[ToolsMenuFunctions#ShowMemoryUsageByObjectType/en | Show Memory Usage by Object Type]]: Detailed information about memory usage <br />
* [[ToolsMenuFunctions#Memory_Cleanup/en | Memory Cleanup]]: Force memory cleanup to release unused resources<br />
<br />
== Elementary Block API ==<br />
* [[ Expecco API/en | Expecco API ]] - Information for Elementary Block Developers<br />
<br />
== Standard Library Reference ==<br />
<br />
The following libraries are included in the base package. <br />
No additional exptension or plugin is required.<br />
<br />
* [[ Standard Library ]] -- A common, domain independent library<br />
* [[ Expecco Reflection Library ]] -- A library to automate expecco itself<br />
<br />
== Interfacing to the System Under Test ==<br />
<br />
* [[ COM/OLE ]] -- How to invoke COM interfaces<br />
* [[ Corba ]] -- How to invoke Corba interfaces<br />
* [[ FTP ]] -- FTP interface<br />
* [[ HTTP ]] -- HTTP interface<br />
* [[ HTTPS ]] -- HTTP (SSL) interface<br />
* [[ SOAP ]] -- SOAP interface<br />
* [[ XMLRPC ]] -- XML-RPC interface<br />
* [[ REST ]] -- REST interface<br />
* [[ Telnet ]] -- Telnet interface<br />
* [[ Sockets ]] -- Generic Low Level Socket interfaces<br />
* [[ Pipes ]] -- Pipes<br />
* [[ Shared Memory ]] - Shared Memory<br />
* [[ DLL Calls ]]<br />
<br />
== Plugins and Extensions ==<br />
<br />
=== UI Testing ===<br />
<br />
* [[ Selenium Web Test Plugin ]] -- Web Page Tests and Interaction (part of the base package)<br />
* [[ Selenium Web Test Plugin/en ]]<br />
* [[ SeleniumLibrary Reference ]] -- Library reference<br />
<br />
* [[ Appium Plugin Reference ]] -- Mobile UI Testing on Android and iOS using Appium<br />
* [[ Java GUI Plugins ]]<br />
<br />
* [[WindowsAutomation_Reference_1.0| Windows Automation GUI Access Interfacing Library]]<br />
<br />
=== Code Execution ===<br />
<br />
* [[ Groovy Code Execution Plugin/en ]] -- allows for Groovy code to be executed on the SUT<br />
* [[ VBScript | VisualBasic Script Plugin ]] -- allows VisualBasic code to be executed either locally or on the SUT<br />
* [[ VBScript/en | VisualBasic Script Plugin/en ]] -- allows VisualBasic code to be executed either locally or on the SUT* [[ Java Browser ]] -- allows for Java classes to be browsed in the SUT<br />
* [[ Java Browser/en ]]<br />
* [[ Java Debugger ]] -- allows to debug Groovy blocks and other code executed by Java Bridge in (remote) JVM<br />
* [[ Java Debugger/en ]]<br />
* [[ SmallSense ]] -- together with [[ Java Browser/en ]] provides basic completion support for Groovy code. <br />
* [[ SmallSense/en ]]<br />
<br />
=== Manual Test Support Plugins ===<br />
<br />
* [[ Manual Test Plugin ]] -- guides users through manual tests<br />
* [[ Manual Test Import Plugin ]] -- imports test specifications written in Word or Excel<br />
<br />
=== Misc Plugins ===<br />
<br />
* [[ GembirdPowerControlPlugin Reference ]] -- control a power plug (part of the base package)<br />
<br />
=== QM Interface Plugins ===<br />
<br />
* [[ PolarionPlugin Reference ]] - automate execution from & interact with Polarion<br />
* [[ expeccoNET Plugin Reference ]] - automate execution from & interact with expeccoNET<br />
* [[ HP Quality Center Plugin Reference ]] - automate execution from and interact with HP Quality Center<br />
* [[ Jira Plugin Reference/en]] - interact with Jira<br />
* [[ Jira Plugin Reference ]] - interact with Jira<br />
<br />
=== Specification Import/Export ===<br />
<br />
* [[ WSDL Service Import Plugin ]] -- import service actions from a WSDL service description<br />
* [[ XMI Diagram Import Plugin ]] -- import XMI activity diagrams from Enterprise Architect<br />
<br />
=== Data/Message/Document Formats ===<br />
<br />
* [[ ASN1 Support ]] -- parse ASN1 specifications; read/write/verify/modify ASN1 encoded messages<br />
* [[ GDMO Support ]] -- read/write/verify/modify GDMO objects<br />
* [[ DTD, XSD Support ]] -- read type specifications<br />
* [[ SWIFT Plugin ]] -- read/write/verify/modify SWIFT messages<br />
* [[ EDI/Edifact Plugin | EDI / Edifact Plugin ]] -- read/write/verify/modify EDI messages; parse message specifications in various formats;<br />
* [[ EDI/Idoc Plugin | EDI / Idoc Plugin ]] -- to be documented<br />
* [[ EDI/X12 Plugin | EDI / X12 Plugin ]] -- to be documented<br />
* [[ PDF Support ]] -- read PDF file structure; generate PDF documents<br />
* [[ ODF Support ]] -- read ODF file structure<br />
* [[ JSON Support ]] -- encode/decode JSON messages<br />
* [[ PEG Parser ]] -- to parse arbitrary messages/texts<br />
<br />
=== Communications/Protocols ===<br />
<br />
* [[ FTP Support ]] -- ftp client / ftp server / sftp client <br />
* [[ HTTP Support ]] -- http client / http server <br />
* [[ Telnet Protocol ]] -- client / server<br />
* [[ SSL Protocol ]]<br />
* [[ IMAP & POP3 Support ]]<br />
* [[ NFS Support ]] -- server<br />
* [[ SunRPC Support ]] -- client & server<br />
* [[ Thrift Support ]] <br />
* [[ MQueue Plugin ]] -- websphere/mainframe interface<br />
* [[ Serial Port Communication ]] <br />
* [[ Parallel Port Communication ]] <br />
* [[ USB Port Communication ]] <br />
* [[ ChipCard/SmartCard Package ]] - GSM, EC, ISO7816 cards and other standards via GemPlus, Oros and other interfaces<br />
* [[ GPIB Interface ]] - measurement device interface<br />
* [[ CanBUS Interface ]] - low level interface via serial or USB interface<br />
* [[ LDAP Interface ]]<br />
* [[ OLE Interface ]]<br />
<br />
=== Databases ===<br />
* [[ ODBC Interface ]] (part of the base package) <br />
* [[ SQLite Interface ]] (part of the base package) <br />
* [[ Oracle Native Interface ]]<br />
<br />
==== NoSQL ==== <br />
* [[ Cassandra Interface ]] <br />
* [[ CouchDB Interface ]]<br />
* [[ MongoDB Interface ]]<br />
* [[ SandstoneDB Interface ]]<br />
* [[ Goods-DB Interface ]]<br />
<br />
=== API ===<br />
* [[ Plugin API ]] - information for Plugin developers<br />
<br />
== Customization ==<br />
<br />
* [[ User Defined Menu Items ]]<br />
&nbsp;<br />
<br />
== Concepts, Hints, Tips and Tricks ==<br />
<br />
* [[ expecco API ]]<br />
* [[ expecco API/en ]]<br />
* [[ Executor]]<br />
* [[ Executor#Activity]]<br />
<br />
* [[ Generating Test Data ]]<br />
* [[ Parametrizing Tests ]]<br />
* [[ Organizing Libraries ]]<br />
* [[ Reimporting a Library]]<br />
* [[ User Defined Menu Items ]]<br />
* [[ Uses of Tags ]]<br />
<br />
== Tutorials ==<br />
<br />
* [[Testing Java Applications using Groovy blocks]]<br />
* [[Testing Java Applications using Groovy blocks/en]]<br />
<br />
= expecco ALM =<br />
== Überblick ==<br />
expecco ALM (Application Lifecycle Management) <br />
<br />
=== Glossary ===<br />
<br />
=== Konzepte ===<br />
* [[ expecco ALM Concepts |Concepts ]] - concepts; testsuite, testdefinition, testschedule, testrun, testequipment<br />
* [[ expecco ALM Concepts/en | Concepts/en ]] - concepts; testsuite, testdefinition, testschedule, testrun, testequipment<br />
* [[ expecco ALM Configuration & Setup | Configuration & Setup ]] - setting up users, roles and projects<br />
* [[ expecco ALM Configuration & Setup/en | Configuration & Setup/en ]] - setting up users, roles and projects<br />
<br />
=== Release Notes ===<br />
* [[ expecco ALM Release Notes 1.9.5 | 1.9.5]]<br />
* [[ expecco ALM Release Notes/en 1.9.5 | 1.9.5/en ]]<br />
* [[ expecco ALM Release Notes 2.0.0 | 2.0.0]]<br />
* [[ expecco ALM Release Notes/en 2.0.0 | 2.0.0/en ]]<br />
<br />
== [[ expecco ALM Installation | Installation ]] ==<br />
<br />
== Webanwendung (HTTP) ==<br />
* [[ expecco ALM Personal Settings | Personal Settings ]] - editor settings<br />
* [[ expecco ALM Personal Settings/en | Personal Settings/en ]] - editor settings<br />
* [[ expeccoNET Master Menu | Master Menu]]<br />
* [[ expeccoNET Master Menu/en | Master Menu/en ]]<br />
* [[ expeccoNET Requirements UI | Requirements UI ]]<br />
* [[ expeccoNET Requirements UI/en | Requirements UI/en ]]<br />
* [[ expeccoNET Defects UI | Defects UI]]<br />
* [[ expeccoNET Defects UI/en | Defects UI/en ]]<br />
* [[ expeccoNET Actions UI | Actions UI ]]<br />
* [[ expeccoNET Actions UI/en |Actions UI/en ]]<br />
* [[ expeccoNET Tests UI | Tests UI ]]<br />
* [[ expeccoNET Tests UI/en | Tests UI/en ]]<br />
* [[ expeccoNET Projects UI | Projects UI ]]<br />
* [[ expeccoNET Projects UI/en | Projects UI/en ]]<br />
* [[ expeccoNET Organization UI | Organization UI ]]<br />
* [[ expeccoNET Organization UI/en | Organization UI/en ]]<br />
* [[ expeccoNET Settings UI | Settings UI ]]<br />
* [[ expeccoNET Settings UI/en | Settings UI/en ]]<br />
<br />
== Mobile Anwendung (Android) ==<br />
* [[expecco ALM App]]<br />
<br />
= Lizenzservice =<br />
== Allgemein ==<br />
* [[ License Server Overview | Overview]]<br />
* [[ License Server Overview/en | Overview/en ]] <br />
* [[ License Server Release Notes | Release Notes]]<br />
* [[ License Server Release Notes/en | Release Notes/en ]] <br />
* [[ Lizenzservice Installation | Installation]] - initial installation, license files, updates<br />
* [[ Lizenzservice Installation/en | Installation/en ]] - initial installation, license files, updates <br />
* [[ License Server Configuration & Setup | Configuration & Setup ]] - setting up ports and users<br />
* [[ License Server Configuration & Setup/en | Configuration & Setup/en ]] - setting up ports and users <br />
* [[ License Server Glossary | Glossary]]<br />
* [[ License Server Glossary/en | Glossary/en]]<br />
<br />
== Benutzerinterface ==<br />
* [[ License Server License Menu | License Menu ]]<br />
* [[ License Server License Menu/en | License Menu/en]]<br />
<br />
= Smalltalk =<br />
<br />
== Packages ==<br />
* [[ SOAP ]]<br />
* [[ SOAP WSDL ]]</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Release_Notes_expecco/en&diff=5808Release Notes expecco/en2015-12-18T07:42:05Z<p>Mb: /* Release 2.8 (Q3/2015) */</p>
<hr />
<div>See also: [[ StandardLibrary_ReleaseNotes | StandardLibrary Release Notes ]]<br />
<br />
== Future Releases ==<br />
Release date: to be announced<br />
<br />
* Compound GUI Blocks, enhanced GUI Construction Toolkit (PRO version) [-> [[MeasurementValueGUI|example]]]<br />
* User-Constructable Control & Monitoring Window (PRO version)<br />
* User-Constructable Control & Monitoring WebInterface (PRO version)<br />
* Object Repository (central mapping of gui-element names - also for cross-platform tests sap)<br />
* Enterprise Version (central database for team development)<br />
* Manual Tests: can run in web GUI (also android, ipad, iphone...), control window on extra screen<br />
* Manual Tests: in expecconet<br />
* Manual Tests: generate original word document as report <br />
* Expecco control window on second screen (dual screen support)<br />
* Expecco control window in web GUI<br />
* Separate monitor/visualisation gui (via background action with gui)<br />
* More detail in modification history (both project and per block)<br />
* Attach probe(s) to monitor views (oscilloscope and chart views)<br />
&nbsp;<br />
<br />
== Release 2.8 (Q3/2015) ==<br />
* Fix: freeze value menu of unions of enums did not merge the individual enum values<br />
* Fix: freeze value menu of unions of constraint dataType-types<br />
* Fix: the search breakpoints function (in the errors-tab of the treeview) now also finds statement breakpoints.<br />
* Fix: Fixes and improvements in the Soap, REST and WSDL frameworks<br />
* Fix: enum numeric value assignments were lost sometimes when saving/restoring<br />
* Fix: search for references of a variable did not find them in imported libraries<br />
* Fix: report of looped testplans (pre-action was reported multiple times)<br />
* Fix: behavior of cancel pin (did neither drive triggerOut-pin, nor exception-pin)<br />
* Fix: Fixes for crashes in follow mouse and backward (xPath) compatiblity in WindowsAutomation Plugin <br />
<br />
* Fix/Feature: compatibility of indexOf() / lastIndexOf() javaScript functions (allow substring search)<br />
<br />
* Feature: Enum datatype: support for individual assigned enum values, described in the [[ Datatype_Editor/en#Enumeration_Types | Datatype Editor Documentation ]] and the [[ Datatype_Element/en#Enumeration_Types | Datatype Element Documentation ]] and also the [[ Expecco_API/en#Enum Type Functions | API Documentation ]].<br />
* Feature: [[ Starting_expecco_via_Command_Line#Expecco_Rest_Service_Interface | Rest service ]] for remote controlling expecco execution<br />
* Feature: Variable number of pins in groups ([[DiagramElements-Pin/en#Variable_Number_of_Pins | "Variable Pin Groups"]])<br />
* Feature: First release of the [[User_Defined_Menu_Items#Useful_Building_Blocks_for_Custom_Menu_Operations | Expecco Reflection Library]] (to automate expecco itself) <br />
* Feature: First release of the [[EDI/Edifact Plugin | EDI-Edifact]] plugin<br />
* Feature: New keyword actions; these offer a simpler, table oriented interface<br />
* Feature: [[ PolarionPlugin Reference | Polarion plugin ]] <br />
* Feature: [[ Docuprint plugin ]]<br />
* Feature: New [[ElementaryBlock_Element/en#Ruby_Script_Blocks|Ruby actions]]<br />
* Feature: Better execution directory settings for [[ElementaryBlock Element/en#Shell_Script_Blocks|Shell blocks]]<br />
* Feature: New step attributes for more specific [[ CompoundBlock_Editor-CompoundWorksheet_Editor/en#Step_Specific_Options_.28Context_Menu.29 | "skip in log/trace"]] options (for looping actions)<br />
* Feature: New user preference setting to ignore all [[CompoundBlock_Editor-CompoundWorksheet_Editor/en#Step_Specific_Options_.28Context_Menu.29 | skip-in-log]] attributes (for debugging)<br />
* Feature: "immediate fork new process" flag now also in block description or dynamically from elementary code<br />
* Feature: Improved performer data type handling; virtual steps now only accept valid performers, and freeze value choices are filtered for valid performers.<br />
* Feature: option to start background action before or after pre-action<br />
* Feature: new constraint datatype type (for better freeze value selection)<br />
* Presentation: Multiline labels in steps (use "\" as line-separator)<br />
* Presentation: Additional custom headline and custom text block in reports (can be filled in right before printing).<br />
<br />
* UI enhancement: can now also set breakpoints on steps and code lines of readonly actions (e.g. in an imported library)<br />
* UI enhancement: undo gives a warning when about to undo past the previous file-save state<br />
* UI enhancement: added a menu item in "Extras" - "Debugging" to stop [[ User_Defined_Menu_Items#Asynchronous_.28Background.29_Actions | background menu actions ]]<br />
* UI enhancement: added more convenient pin-comment editing support to the schema editor<br />
* UI enhancement: text editor has a new "split" menu function in its tools-submenu<br />
* UI enhancement: better "New Step" and "Replace Step" dialogs in the diagram editor (showing preview, code and contents; also show attachements).<br />
* UI enhancement: better autoconnect and matching blocks search algorithm in the "Place and Select New Step" function (i.e. New Step function, when an output pin is selected)<br />
* UI enhancement: new scale diagram function (scale and spread multiple steps)<br />
* UI enhancement: lint performs a number of checks on a block being edited and gives immediate warnings in the info line (same checks as in the tree's error- and special search tabs)<br />
* UI enhancement: new lint-error check rules to detect consumed pin values in loops and multi-triggered chains.<br />
* UI enhancement: double click on a search item to navigate to it in the tree<br />
* UI enhancement: codeview and network view in the activitylog indicate that they are readonly.<br />
* UI enhancement: secondary navigation tree for drag&drop.<br />
* UI enhancement: warn if it is due time to check for updates.<br />
<br />
* STD-LIB: collection creator and multi-setter blocks with variable number of pins (alternating key-value pairs)* STD-LIB: New DLL-Mapping block<br />
* STD-LIB: new blocks "File [modification time]", "File [access time]" and "File [creation time]"; new * STD-LIB: Additional blocks for event queue handling.<br />
* STD-LIB: Additional blocks for static step-local storage.<br />
* STD-LIB: Better versions for FAIL/WARN/INFO, LogFAIL, logWARNING and logINFO. New "Transcriber with Timestamp" action.<br />
* STD-LIB: fixed some collection-type issues (now pins are #-template-typed, instead of Collection), which required a downcast in many suites.<br />
* STD-LIB: new blocks: "Trigger Periodically" and "Counter"<br />
* STD-LIB: new blocks: "Enumtype symbol<->integer"<br />
* Tool enhancement: data inspector for strings shows another (XML-DOM) tab if the string is an XML string. This tab shows the parsed XML Dom-tree.<br />
&nbsp;<br />
<br />
== Release 2.7.5 (2015-06-09) ==<br />
<br />
'''New features''':<br />
* The JavaFX plugin now supports keyboard input. Use the block "Request Focus" to focus an input field and the block "Type Text" to enter any text.<br />
<br />
'''Bugfixes''':<br />
* The JavaFX plugin now provides improved connection handling.<br />
<br />
<br />
For expecco running under Linux you need GLIBC >= 2.14<br />
<br />
Tested technology versions:<br />
* Selenium<br />
* The Java Bridge requires a JDK version 1.6 or higher<br />
** JavaFX testing requires JavaFX 8<br />
* QT: Qt 2.6.3 (mingw,vs2008), Qt 4.8.4 (mingw, vs2008, vs2010, vs2013), Qt 5.4.2 (vs2010, vs2013)<br />
* .NET<br />
* MFC<br />
* HTML 5<br />
* DevExpress<br />
* Android<br />
* iOS<br />
* Windows CE/Mobile Phone<br />
* CANoe: 8.2 SP4<br />
* WSDL-Import: it is required that you re-import your WSDL-Definitions in your Testsuites<br />
&nbsp;<br />
<br />
==Release 2.7.1 ==<br />
* Convenient menu functions to add the special [[ Expecco_API#Using a Particular JVM Connection / Executing Groovy on a Possibly Remote Machine | "java" and "groovy" ]] input pins to a Groovy elementary block.<br />
* Standard library: new blocks: "Directory [ Contents as Filenames ]", "Directory [ Contents as Pathnames ]", "Directory [ Contents as Basenames ]", "File [ isReadable? ]" and "File [ isWritable? ]"<br />
&nbsp;<br />
<br />
==Release 2.7 ==<br />
* Patches go into a release specific directory (e.g. patches-2.7.0.5)<br />
* configurable external editor for attachments and csv data (eg. excel or openoffice calculator)<br />
* tree view: markers in search lists; add to/remove from remembered list menu items<br />
* tree view: folders can have tags, too<br />
* tree view: per-tag icons in tree<br />
* [[ Starting_expecco_via_Command_Line/en#Utility_Functions | "--diff" command line option ]]<br />
* [[ Starting_expecco_via_Command_Line/en#Startup | "--settings" command line option ]]<br />
* Scatter/Gather composition of test plans from multiple suites [[ Starting_expecco_via_Command_Line/en#Scatter Gather Test Suite Composition | via command line arguments ]]<br />
* library: background OS process and background block actions<br />
* improved type checks and preference settings<br />
* schema editor: cursor up/down keys in pin name fields<br />
* schema and diagram editor: additional menu functions in multiple-pin selection menu<br />
* new blocks in the StandardLibrary: ExceptionClassifier, WriteCSV, Load/Save Environment from/to CSV<br />
* [[ SAP Testing | SAP plugin and VBScript action blocks ]]<br />
* change in the handling of Groovy callbacks. Please read [[ Expecco_API/en#Attention_.2F_Warning | "Attention / Warning" ]] and [[ Expecco_API/en#Special_Functions | "Special Functions"]] in the Groovy API documentation.<br />
* improved Groovy debugging support<br />
* new common Android and iPhone/iPad testing framework<br />
* option to save a per-run report, when a suite is executed in a loop (especially useful, when running until fail or until success)<br />
* block assertions: assert-executed / assert-all outputs written / assert any output written<br />
* License server support<br />
&nbsp;<br />
<br />
==Release 2.6.2 bugfix release - April 2014 ==<br />
Thus is a stable release consisting of the 2.6.1 base version INCLUDING all 2.6.1 patches (up to April).<br />
<br />
&nbsp;<br />
<br />
==Release 2.6.1 update - Januar 2014 ==<br />
* [[ Expecco_API#Groovy_Elementary_Blocks | groovy action]]: the java-bridge can be passed in via pin named "java" or environment var named "JAVA". GroovyShell can be passed in via pin named "groovy" or variable named "GROOVY". Pins are optional for backward compatibility.<br />
&nbsp;<br />
<br />
==Release 2.6 - November 2013 ==<br />
* New testplan execution loop mode: "loop until required test fails"<br />
* More options for automatic check for and installation of updates & patches<br />
* Better default directories in file open/save/import dialogs.<br />
* Tuned automatic reimport when multiple libraries are imported.<br />
* Improved Java object inspector<br />
* New attachment contents representation modes.<br />
* Step tooltips include the underlying block's tree location.<br />
* Shift click on connection selects all underlying connections.<br />
* Give an indication (colorize menubar) if running with root/Admin rights.<br />
* Option to put the custom operations menu into the top menu<br />
* Additional tab in tree view to search by item-type<br />
* Additional search options for interfaces and concrete actions<br />
* Various bug fixes & enhancements:<br />
** handle duplicate attachment filenames, <br />
** fixed some type conversions, <br />
** fixed clipboard handling under XWindow/Qt desktop, <br />
** fixed non-changing testplan/testitem spec page.<br />
** added string search in resources, skills and inventories<br />
** no longer close expanded tree items when reimporting<br />
** fixed making an imported library writable, which is imported by another sub-import<br />
** fixed freeze of template pin to boolean/enum<br />
** fixed enum values which start with a digit (aka '001 aaa')<br />
** remove freeze value connection via menu<br />
&nbsp;<br />
<br />
==Release 2.5 ==<br />
* Can refer to [[ Environment_Editor#Initialization Types | shell environment variables ]] in an environment variable's initializer.<br />
* New elementary block type: Groovy Code. Installs script code to be executed in a Java target or a local JVM.<br />
* New keyword driven actions<br />
* Additional checks in save dialogs to prevent overwriting another testsuite/library<br />
* Optional automatic reimport or check for reimportable imports (configure via settings dialog)<br />
* Additional freeze value validation when types are edited<br />
* New plugin: Jar Import<br />
* New and much improved manual test import plugin<br />
* Speedup, impovements and fixes in the JavaBridge plugin<br />
* Menu actions can [[ Misc_Editor#Background_Actions | execute in the background ]] (name as "...&")<br />
* Background actions in testplan and testcase<br />
* Much faster: startup, plugin loading and bridge communication<br />
* Multiple freeze value menu organizations for enum types (hierachical selection)<br />
<br />
===Release 2.5.1 - July 2013 ===<br />
<!-- This is a bugfix release, in which various patches and small enhancements from the past few months have been integrated. <br />
<br><br />
--><br />
* Automatic & semiautomatic update from server<br />
&nbsp;<br />
<br />
==Release 2.4 - Februar 2013 ==<br />
This is a bugfix release, in which various patches and small enhancements from the past few months have been integrated.<br />
<br>&nbsp;<br />
<br>&nbsp;<br />
<br />
==Release 2.3 - December 2012 ==<br />
* New integrated GUI Browser<br />
* New menu functions: "minimize/restore all Windows"<br />
* Polarion compatible report<br />
* Improved Project-Diff-Browser<br />
&nbsp;<br />
<br />
==Release 2.2==<br />
* New SchemaEditor menu functions: copy/paste pin interface<br />
* New plugin: [[GembirdPowerControlPlugin_Reference#|Gembird Power Control Plugin]]<br />
* New debug-menu function: "close all temporary windows"<br />
* [[Probe | Probes]]; easy recording and check of pinValues<br />
* Junit compatible report<br />
* HTTP and SOAP transmission log (optional on Transcript)<br />
* Fixed WSDL/SOAP for document-style operations<br />
* Better inspector (hex dump tab, hex representation of floats)<br />
&nbsp;<br />
<br />
==Release 2.1 - November 2011== <br />
* Condition variables for simple (and easy to use) control of testcase execution<br />
* [[Webservices#REST_Baustein|REST-Call]] blocks<br />
* Option to disable logging of activityNotifications (from the underlying language framework)<br />
* URL-override for SOAP service call blocks via the SOAP_URL environment variable.<br />
* Access to the certificate store (for SSL/HTTPS), allows adding and removing individual certificates<br />
* Elementary steps can have a variable number of output-pins (for multiplexer, dispatcher, round-robin generators etc.) <br />
* New menu function: "Generate Value Extractor" for Dictionary-typed pin values. (in the activityLog, output pin-data menu)<br />
* New tree-menu function: "Refactor"->"Change Variable Access", to search for and replace environment variable references.<br />
* New datatype [[Datatype_Element#Special_Types | "struct" ]], to represent arbitrary compound (struct) values.<br />
* GUI improvements: better annotation-text editors; line numbers, tags in file viewer<br />
* Allow for multi pin-value parametrization in testplan (block with multiple inputs in a testplan item) <br />
* Proxy support for HTTP-fetch blocks<br />
* Recording feature for Java Swing GUIs <br />
* Enhanced Java Swing Function Block Library<br />
* GUI Browser improvements: tree view with widget specific icons, record tree actions <br />
&nbsp;<br />
<br />
==Release 2.0==<br />
* Elementary steps can have a variable number of input-pins (improves the format, plus, string-concat and many other blocks)<br />
* Statistic page added to the project editor<br />
* Improved manual test import plugin; nicer Manualtest runner GUI; user definable manual test GUI<br />
* Allow for pin-value parametrization in testplan (block with a single input parameter in a testplan item)<br />
* Configurable max. cleanup time after terminating a run; Confirmation Dialog when longer.<br />
* ActivityLog: added "Select in Tree" from log-entry<br />
* HTTPS / SSL Support for HTTP blocks<br />
&nbsp;<br />
<br />
== Update Patch 1.9.1.1 ==<br />
(patch applied to the iX-Demo CD)<br />
<br />
* fixed the settings dialog's "mark new items" checkbox.<br />
* improved the termination timeout handling (long time spent in post action)<br />
* fixed the "search for active block" button's function<br />
* fixed a scroll-offset bug in the diagram editor<br />
&nbsp;<br />
<br />
== Release 1.9.1 ==<br />
Release date: Jan 2011<br />
<br>(release candidate: 1.8.3.30)<br />
<br />
* New blocks in the [[ StandardLibrary_ReleaseNotes#1.8.3 | StandardLibrary 1.8.3 ]] and [[ StandardLibrary_ReleaseNotes#1.9.1 | StandardLibrary 1.9.1 ]]<br />
* Separate model language translations<br />
* URL attachments<br />
* EBCDIC support<br />
* HP Quality Center Interface improved (up/download of tests and test-sets, autologout)<br />
* New plugin: Android Mobile Apps Interface<br />
* XMI import plugin improved (can now import test cases from Enterprise Architect models)<br />
* [[JavaSwing_Reference|JavaSwing plugin]] improved<br />
* Much improved Java-Bridge functionality: can now inject code dynamically<br />
* [[SeleniumLibrary_Reference|Web Interfacing]] updated to use newest Selenium Version.<br />
* Improved browser profile handling (for example for proxy setup)<br />
* Firefox profile now includes Firebug and Firepath for web page analysis<br />
* additional [[SeleniumLibrary_Reference|Web interface]] blocks (waitForAndXXX, table-accessors, table enumerators)<br />
* Optional cyclePeriod when looping a testplan<br />
* Suspend new activities when a debugger is open (option)<br />
* [[ WebSphere_MQ | WebSpere MQ (IBM Middleware interface)]] client interface plugin/library<br />
* Tagsearch includes Step-Tags<br />
* Can now save individual TestCase- and ActivityLog results to a file<br />
* New elementary block-type: Batch-script<br />
* Search for steps by name in result log<br />
* New variable-types in environment: [[ Environment Editor#Initialization_Types | SecretConstant, RequestFromUserWhenFirstUsed and SecretFromUserWhenFirstUsed ]] <br />
* Screenshot also via main menu<br />
* Code-editor now supports code completion (CTRL-Shift) and variable-correction (define as local or pin)<br />
* Optional sound when operator input is required<br />
* More execution control in the Control & Monitoring Window.<br />
* "Abort TestPlan" function in debugger.<br />
* Search for modified actions, search for values in tree<br />
* Improved XML-inspector (skip empty text, xml-text display)<br />
* Can now disable a plugin in the settings (will hide its menus)<br />
* Paste step with selected connection inserts the pasted step into the flow<br />
* improved single step function & breakpoint behavior<br />
* prerequisite package loading and prerequisite plugin checking<br />
* much improved [[AndroidLibrary_Reference | Android mobile-phone testing support]]<br />
* rename variable menu-function<br />
* improved references to variable search function (looks into code)<br />
* embedded inspector (better environment variable value display) in the activity log<br />
* webtest functionality upgraded to current selenium/firefox versions<br />
* regex matching text search in tree (in addition to existing glob-matching search)<br />
* search for consumed input value in cycles (lint)<br />
* pause on error option in blockTester<br />
* default parallelity of new steps is now "limited to 1"<br />
* grouping of user defined types<br />
* shrink-wrap of imported libraries<br />
* colorize by tag configuration<br />
* customizable operation menu<br />
* improved the diff-viewer, added attachment diffs<br />
&nbsp;<br />
<br />
== Release 1.8.2 ==<br />
Release date: Jul 2010 <br />
<br />
* Network Editor: allow connecting to a frozen pin (freeze to same value)<br />
* Network Editor: new menu function: "Extract Compound Action" (without replacing the selection)<br />
* Network Editor: new menu function: "Insert Step at Connection"<br />
* Network Editor: automatic "connect-through" when deleting steps from eni-eno chains<br />
* More testplan information for expeccoNET: operator needed; selectable testCases.<br />
* Search for halts and breakpoints<br />
* Breakpoint-toggling also in the log-viewer<br />
* Load resources from expeccoNET<br />
* New plugin: JIRA Interface (for issue validation)<br />
* New plugin: HP Quality Center Interface (up/download of test-suites)<br />
* New plugin/library: Swift-Message Handling<br />
* Fixed CTRL-a in some subviews<br />
* More attributes in annotations<br />
&nbsp;<br />
<br />
== Release 1.8.1 ==<br />
Release date: May 2010 (skipped for 1.8.2)<br />
<br />
* New blocks in the [[ StandardLibrary_ReleaseNotes#1.8.1 | StandardLibrary 1.8.1 ]]<br />
* Triggering Mailbox Pins (see Collect Block as an example)<br />
* ExecutionTime-Output pin<br />
* More search options (search for virtual, iterated and exception handling steps)<br />
* New step flags: "Skip Children in Trace", "Assert Output Written" and "Assert Executed"<br />
* New Settings flag "Open Debugger for Handled Exceptions"<br />
* Report: can now include screenshots and other images<br />
* Report: new "Print as Flat List" option.<br />
* Report: speedup for big PDF reports<br />
* Elementary Code Editor: Senders and References search now includes elementary code in search<br />
&nbsp;<br />
<br />
== Release 1.8.0 ==<br />
Release date: April 2010 (skipped for 1.8.1)<br />
<br />
* Different connection styles (direct, curved)<br />
* WSDL import plugin fixed and enhanced.<br />
* Some report improvements (more variables)<br />
* XML-RPC Blocks<br />
* Jira Plugin<br />
* Skill, Resource and Inventory Interface for expeccoNET<br />
&nbsp;<br />
<br />
== Release 1.7.4 ==<br />
Release date: Februrary 2010<br />
<br />
* New blocks in the [[ StandardLibrary_ReleaseNotes#1.7.4 | StandardLibrary 1.7.4 ]]<br />
* Implicit virtual block resolving specified in environment<br />
* Implicit virtual block resolving via virtual library specified in environment<br />
* Resource & skill access API fixed & enhanced<br />
* Enhanced display of virtual action in execution log<br />
* Fixed error-display in network if error occurs in action setup<br />
* Virtual blocks can now also be used as pre- and post-action<br />
* Fixed the input-pin handling of virtual blocks<br />
* [[Tools_TestSuiteDifferenceBrowser | TestSuite diff viewer]] (to compare two project versions)<br />
* New tree-menu-functions: "Generate Instance Creator" & "Generate Field Extractor"<br />
* New tree-menu-function: "Sort Children"<br />
* New type-kind: CType.<br />
* Added a new kind of inspector-view: CDatumInspector to show C-data in a structured, hierarchical list<br />
* Non-Blocking DLL-calls<br />
&nbsp;<br />
<br />
== Release 1.7.3 ==<br />
Internal Release date: January 2010<br />
<br />
* New blocks in the [[ StandardLibrary_ReleaseNotes#1.7.3 | StandardLibrary 1.7.3 ]]<br />
* Can now force connect of incompatible pins with CTRL-key<br />
* Default inventory now in testSuite (moved up from the testplan)<br />
* PostLoad & preUnload actions for suite and imported libraries<br />
&nbsp;<br />
<br />
== Release 1.7.2 ==<br />
Release date: October 2009<br />
<br />
* VariableList: added nameFilter and sortability<br />
* New blocks in the [[ StandardLibrary_ReleaseNotes#1.7.2 | StandardLibrary 1.7.2 ]]<br />
&nbsp;<br />
<br />
== Release 1.7.1 ==<br />
Release date: September 2009<br />
<br />
* When saving test suites that were originally signed with a expecco demo version, convert all demo signatures to final signatures - if you have got a dongle.<br />
* Now can load test suites saved with expecco-developer with expecco-pro (and developer with pro - as long as you do not features that are supported only by expecco-pro in your test suite)<br />
* all blocks tagged in the [[ StandardLibrary_ReleaseNotes#1.7.1 | StandardLibrary 1.7.1 ]]<br />
* new blocks in the [[ StandardLibrary_ReleaseNotes#1.7.1 | StandardLibrary 1.7.1 ]]<br />
&nbsp;<br />
<br />
== Release 1.7.0 ==<br />
Release date: July 2009<br />
<br />
* RunTimeLimit for individual testCases<br />
* Better flyby info for steps and actions<br />
* Folders in the tree can have a documentation<br />
* Log files (.elf) are now zipped ([[HowtoReadZippedElf|Reading zipped .elf files with expecco < Rel1.7]])<br />
* WebTest: SeliniumRc has been updated to V1.0.1 and supports now Firfox3.5, Interne Explorer 8 and Google Chrome<br />
* New functions in network-editor: <br />
** Exchange connections of two pins; <br />
** Resize to min/max; <br />
** Better chooser for new steps; <br />
** Insert & connect function (find best match for selected pins);<br />
** "insert step" function ("select step and connection")<br />
** Can place and connect new steps via the menu without drag&drop (intelligent selection list)<br />
** Multiple pin variable-freeze<br />
** Drop connection onto a step (for trigger-in/trigger-out connection)<br />
** Connection-colors<br />
*In code-editor<br />
** F4/F5 (comment / uncomment) now also work with JavaScript code<br />
** Syntax color configuration in preferences dialog<br />
** "Implementors" menu-function fixed<br />
&nbsp;<br />
Bug Fixes and Improvements:<br />
* Sound file access fixed<br />
* Activity-log display update speed improved<br />
* Keep dialogs visible (auto raise windows from dialog-blocks)<br />
&nbsp;<br />
<br />
== Release 1.6 ==<br />
Release date: Mar 2009<br />
* Improved report, allows multiple report templates<br />
* Search for Missing Attachments<br />
* Optional Debug-Check of Pin Value against Pin Type (in elementary code)<br />
* Scripting (Remote Control)<br />
* "execute until success" loop feature<br />
* Attachment output can provide contents of file (instead of pathname)<br />
* SOA Testing: Generation of SOAP Call EB's from an imported WSDL (PRO Version only)<br />
* CodeGenerator can generate EB from a CB (PRO Version only)<br />
* More command line options for report generation (if executed via batch script)<br />
* "make your own elementary GUI" blocks with the UI Editor (PRO Version only)<br />
* Both console (expecco.com) and non-console (expecco.exe) executables are provided<br />
* --noBanner option<br />
* New blocks in the [[ StandardLibrary_ReleaseNotes#1.6.2 | StandardLibrary 1.6.2 ]]<br />
&nbsp;<br />
<br />
== Release 1.5 ==<br />
Release date: 13.08.2008<br />
* File Attachment<br />
* Drag & Drop of Attachment<br />
* New ZIP-File Format<br />
* Improved Routing and Editor Functions<br />
* More Search Functions<br />
* Drag&Drop from Search<br />
&nbsp;<br />
<br />
== Release 1.4 ==<br />
<br />
* XML Parser Speedup<br />
* FileBrowser, Notebook and ProcessMonitor added<br />
* Acoustic test-execution feedback<br />
* Stop-on-Error can be turned off when running a TestSuite<br />
* Filter data messages in the Log-Viewer<br />
* Better presentation of detail-data in the Log-Viewer when double-clicking (Inspector)<br />
* Timelimit for testSuite execution<br />
* Looping & Loopcount for testSuite execution<br />
&nbsp;<br />
<br />
== Release 1.3 ==<br />
* Acoustic test-execution feedback <br />
* Stop-on-Error can be turned off when running a TestSuite <br />
* Filter data messages in the Log-Viewer <br />
* Better presentation of detail-data in the Log-Viewer when double-clicking (Inspector) <br />
* Timelimit for testSuite execution <br />
* Looping & Loopcount for testSuite execution <br />
* FileBrowser, Notebook and ProcessMonitor added<br />
&nbsp;</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Settings_GUIBrowserSettings&diff=5763Settings GUIBrowserSettings2015-12-08T11:45:19Z<p>Mb: Die Seite wurde neu angelegt: „ == Show GUI Browser Items in Main Menu == Show the GUI Browser Items in the Main Menu of the expecco Browser if checked“</p>
<hr />
<div><br />
<br />
== Show GUI Browser Items in Main Menu ==<br />
<br />
Show the GUI Browser Items in the Main Menu of the expecco Browser if checked</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Settings_PluginSettings/en&diff=5762Settings PluginSettings/en2015-12-08T11:42:35Z<p>Mb: /* Available Plugins and Extensions */</p>
<hr />
<div>== PlugIn Settings ==<br />
Expecco supports extensions called plugins.<br />
These can be loaded and unloaded dynamically using this plugin settings dialog.<br />
Plugins are provided by eXept or third party sources.<br />
For more information, please refer to the<br />
[[:Category:Plugins| "Plugins Documentation"]] or the documentation as provided with the plugin.<br />
<br />
=== Available Plugins and Extensions ===<br />
At the time of writing of this document, the following plugins and extensions<br />
are available or being developed by eXept:<br />
<br />
* [[Settings AndroidGUITestPluginSettings]]<br />
* [[Settings BPELImportPluginSettings]]<br />
* [[Settings DLLCallGeneratorPluginSettings]]<br />
* [[Settings DotNetBridgePluginSettings]]<br />
* [[Settings FreemindImportPluginSettings]]<br />
* [[Settings GUITestPlatformSettings]]<br />
* [[Settings GembirdPluginSettings]]<br />
* [[Settings JavaBridgePluginSettings]]<br />
* [[Settings JavaJarImportPluginSettings]]<br />
* [[Settings JavaSwingSettings]]<br />
* [[Settings JiraInterfacePluginSettings]]<br />
* [[Settings ManualTestImport1PluginSettings]]<br />
* [[Settings ManualTestImport2PluginSettings]]<br />
* [[Settings PolarionInterfacePluginSettings]]<br />
* [[Settings PoloniumGUITestPluginSettings]]<br />
* [[Settings QCInterfacePluginSettings]]<br />
* [[Settings QtGUITestPluginSettings]]<br />
* [[Settings SeleniumSettings]]<br />
* [[Settings WindowsAutomationGUITestPluginSettings]]<br />
* [[Settings WSDLImportPluginSettings]]<br />
* [[Settings XMIImportPluginSettings]]<br />
* [[Settings XPDLImportPluginSettings]]<br />
<br />
=== Plugin Overview ===<br />
<br />
;[[ Settings_AndroidGUITestPluginSettings | Android Bridge Extension ]]<br />
: Similar to the other GUI Test extensions, this allows for an Android application's widget hierarchy to be inspected, manipulated and checked. The application may run both on real or emulated hardware. Multiple devices and their interaction may be handled and controlled in a single test suite.<br />
<br />
;[[ Settings_BPELImportPluginSettings | BPEL Import Extension ]]<br />
: Imports BPEL diagrams<br />
<br />
;[[ Settings_DLLCallGeneratorPluginSettings | DLL Callgenerator Extension ]]<br />
: Generates function blocks for entries in a dynamic link library.<br />
<br />
;[[ Settings_DotNetBridgePluginSettings | DotNet Bridge Extension ]]<br />
:The dotNET bridge extension allows for a dotNET (CLR) program to be executed as a slave under the control of expecco. You can access globals, classes, instantiated objects, threads and GUI components of the program, and define arbitrary elementary blocks to manipulate them. Multiple applications and their interaction may be handled and controlled in a single test suite. The target applications may execute both on the local or on remote hosts.<br />
<br />
;[[ Settings_FreemindImportPluginSettings | Freemind-MM Import Extension ]]<br />
: Imports FreeMind Mindmap diagrams<br />
<br />
;[[ Settings_GembirdPluginSettings | Gembird Power Manager Control Plugin ]]<br />
: This plugin controls a set of lamps (red, green, yellow) via a LAN-controlled power control unit (gembird). This can be used as an optical indicator for running tests (yellow), and the tests outcome (red or green).<br />
<br />
;[[ Settings_JavaBridgePluginSettings | Java Bridge Extension ]]<br />
: Similar in function to the dotNET bridge, this extension allows for a Java program to be executed as a slave under the control of expecco. You can access globals, classes, instantiated objects, threads and GUI components of the program, and define arbitrary elementary blocks to manipulate them. Multiple applications and their interaction may be handled and controlled in a single test suite. The target applications may execute both on the local or on remote hosts.<br />
<br />
;[[ Settings_AndroidGUITestPluginSettings | Java JAR Import Extension ]]<br />
: Similar in function to the DLL call generator plugin, this extension allows for a JAR file containing Java classes to be scanned and elementary blocks to be generated which call static or member functions.<br />
<br />
;[[ Settings_AndroidGUITestPluginSettings | JavaSwing GUI Test Extension ]]<br />
: Provides a visualization of the widget hierarchy of a Java+Swing application. GUI elements can be searched, inspected and validation actions can be added interactively to a test suite's activity diagram. Multiple applications and their interaction may be handled and controlled in a single test suite. The target applications may execute both on the local or on remote hosts.<br />
<br />
;[[ Settings_JavaSWTGUITestPluginSettings | JavaSWT GUI Test Extension ]]<br />
: Provides a visualization of the widget hierarchy of a Java+SWT application. GUI elements can be searched, inspected and validation actions can be added interactively to a test suite's activity diagram. Multiple applications and their interaction may be handled and controlled in a single test suite. The target applications may execute both on the local or on remote hosts.<br />
<br />
;[[ Settings_JiraInterfacePluginSettings | JIRA Testresult Reporting ]]<br />
: This plugin creates a link between an expecco test case and an issue in a JIRA database. The issue can be automatically closed/reopened, whenever the test case is executed.<br />
<br />
;[[ Settings_ManualTestImport1PluginSettings | Manual Test Import ]]<br />
: This plugin imports test specifications for manual tests. These must be present as word (OpenOffice) document with a particular (tabular) format. After the import, a manual test GUI can be used to guide the tester through the test cases, or the resulting test plan can be used as a template for partial or full automation.<br />
<br />
;[[ Settings_PolarionInterfacePluginSettings | Polarion Interface ]]<br />
: This plugin allows for test-suites to be up-/downloaded to/from a Polarion QM server, to fetch and execute Polarion test runs, and to update a tests state to PASS/FAIL, whenever the test case is executed. Also, Polarion itself is extended for the definition and execution of expecco tests.<br />
<br />
;[[ Settings_PoloniumGUITestPluginSettings | Polonium ST/X Application''' Test Plugin ]]<br />
: The Polonium plugin adds an interface to the Polonium ST/X GUI test framework. Polonium does for an ST/X fat-client application what Selenium does for a browser based web application. It allows for capture/replay of ST/X GUI application sessions and the validation of a GUI's window contents.<br />
<br />
;[[ Settings_QtGUITestPluginSettings | Qt GUI Test Extension ]]<br />
: Similar to the JavaSwing GUI Test extension, this allows for a Qt (-> Trolltech) application's widget hierarchy to be inspected, manipulated and checked. Multiple applications and their interaction may be handled and controlled in a single test suite. The target applications may execute both on the local or on remote hosts.<br />
<br />
;[[ Settings_QCInterfacePluginSettings | Quality Center (QC) Interface ]]<br />
: This plugin allows for test-suites to be up-/downloaded to/from a Quality-Center server, to fetch and execute QC test sets, and to update a tests state to PASS/FAIL, whenever the test case is executed.<br />
<br />
;[[ Settings_SeleniumGUITestPluginSettings | WEBTest Plugin (Selenium Interface) ]]<br />
: The WEBTest plugin adds an interface to the Selenium Webtest framework. Selenium allows for capture/replay of web sessions and the validation of a web pages' contents. This plugin contains an import feature, which converts captured selenium sessions into an activity diagram. Also, a library consisting of web-page activities is included. Together, they allow for a recorded web session to be enhanced, refactored, reused or parametrized like any ordinary expecco activity diagram.<br />
<br />
:Beside many other possible uses, two extra functionalities of this plugin add much to the value of the expecco product:<br />
:* recorded web sessions can be augmented by semantic checks in the system under test. Especially the real effect of a web-transaction can be checked against the back-end of a web application.<br />
:* by feeding a recorded session's parameters through either a generator-block, or by reading a CSV-file or a database, web-sessions can be parametrized. This can even be done dynamically on the fly, depending upon previous response data. For example, a set of boundary values can be read from a file and feeded as input parameter sets to a prerecorded web session, or the output of a web page can be analyzed, transformed and used as input to another session or for a follow up test case.<br />
<br />
;[[ Settings_WindowsAutomationGUITestPluginSettings | Windows Automation Extension ]]<br />
: Similar to the other GUI Test extensions, this allows for Microsoft MFC/Forms application's widget hierarchies to be inspected, manipulated and checked. Multiple applications and their interaction may be handled and controlled in a single test suite. The target applications may execute both on the local or on remote hosts.<br />
<br />
;[[ Settings_WSDLImportPluginSettings | WSDL Import Extension ]]<br />
: Imports WSDL service description and automatically generates libraries containing types and actions to access these operations.<br />
<br />
;[[ Settings_XMIImportPluginSettings | XMI Import / Export Extension ]]<br />
: Import/Export of XMI UML diagrams<br />
<br />
;[[ Settings_XPDLImportPluginSettings | XPDL Import Extension ]]<br />
: Imports XPDL diagrams<br />
<br />
[[Category:Settings]]</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Settings_PluginSettings/en&diff=5761Settings PluginSettings/en2015-12-08T11:39:25Z<p>Mb: /* Available Plugins and Extensions */</p>
<hr />
<div>== PlugIn Settings ==<br />
Expecco supports extensions called plugins.<br />
These can be loaded and unloaded dynamically using this plugin settings dialog.<br />
Plugins are provided by eXept or third party sources.<br />
For more information, please refer to the<br />
[[:Category:Plugins| "Plugins Documentation"]] or the documentation as provided with the plugin.<br />
<br />
=== Available Plugins and Extensions ===<br />
At the time of writing of this document, the following plugins and extensions<br />
are available or being developed by eXept:<br />
<br />
* [[Settings AndroidGUITestPluginSettings]]<br />
* [[Settings BPELImportPluginSettings]]<br />
* [[Settings CommonJavaGUITestPluginSettings]]<br />
* [[Settings DLLCallGeneratorPluginSettings]]<br />
* [[Settings DotNetBridgePluginSettings]]<br />
* [[Settings FreemindImportPluginSettings]]<br />
* [[Settings GUITestPlatformSettings]]<br />
* [[Settings GembirdPluginSettings]]<br />
* [[Settings JavaBridgePluginSettings]]<br />
* [[Settings JavaJarImportPluginSettings]]<br />
* [[Settings JavaSwingGUITestPluginSettings]]<br />
* [[Settings JavaSWTGUITestPluginSettings]]<br />
* [[Settings JiraInterfacePluginSettings]]<br />
* [[Settings ManualTestImport1PluginSettings]]<br />
* [[Settings ManualTestImport2PluginSettings]]<br />
* [[Settings PolarionInterfacePluginSettings]]<br />
* [[Settings PoloniumGUITestPluginSettings]]<br />
* [[Settings QCInterfacePluginSettings]]<br />
* [[Settings QtGUITestPluginSettings]]<br />
* [[Settings SeleniumSettings]]<br />
* [[Settings WindowsAutomationGUITestPluginSettings]]<br />
* [[Settings WSDLImportPluginSettings]]<br />
* [[Settings XMIImportPluginSettings]]<br />
* [[Settings XPDLImportPluginSettings]]<br />
<br />
=== Plugin Overview ===<br />
<br />
;[[ Settings_AndroidGUITestPluginSettings | Android Bridge Extension ]]<br />
: Similar to the other GUI Test extensions, this allows for an Android application's widget hierarchy to be inspected, manipulated and checked. The application may run both on real or emulated hardware. Multiple devices and their interaction may be handled and controlled in a single test suite.<br />
<br />
;[[ Settings_BPELImportPluginSettings | BPEL Import Extension ]]<br />
: Imports BPEL diagrams<br />
<br />
;[[ Settings_DLLCallGeneratorPluginSettings | DLL Callgenerator Extension ]]<br />
: Generates function blocks for entries in a dynamic link library.<br />
<br />
;[[ Settings_DotNetBridgePluginSettings | DotNet Bridge Extension ]]<br />
:The dotNET bridge extension allows for a dotNET (CLR) program to be executed as a slave under the control of expecco. You can access globals, classes, instantiated objects, threads and GUI components of the program, and define arbitrary elementary blocks to manipulate them. Multiple applications and their interaction may be handled and controlled in a single test suite. The target applications may execute both on the local or on remote hosts.<br />
<br />
;[[ Settings_FreemindImportPluginSettings | Freemind-MM Import Extension ]]<br />
: Imports FreeMind Mindmap diagrams<br />
<br />
;[[ Settings_GembirdPluginSettings | Gembird Power Manager Control Plugin ]]<br />
: This plugin controls a set of lamps (red, green, yellow) via a LAN-controlled power control unit (gembird). This can be used as an optical indicator for running tests (yellow), and the tests outcome (red or green).<br />
<br />
;[[ Settings_JavaBridgePluginSettings | Java Bridge Extension ]]<br />
: Similar in function to the dotNET bridge, this extension allows for a Java program to be executed as a slave under the control of expecco. You can access globals, classes, instantiated objects, threads and GUI components of the program, and define arbitrary elementary blocks to manipulate them. Multiple applications and their interaction may be handled and controlled in a single test suite. The target applications may execute both on the local or on remote hosts.<br />
<br />
;[[ Settings_AndroidGUITestPluginSettings | Java JAR Import Extension ]]<br />
: Similar in function to the DLL call generator plugin, this extension allows for a JAR file containing Java classes to be scanned and elementary blocks to be generated which call static or member functions.<br />
<br />
;[[ Settings_AndroidGUITestPluginSettings | JavaSwing GUI Test Extension ]]<br />
: Provides a visualization of the widget hierarchy of a Java+Swing application. GUI elements can be searched, inspected and validation actions can be added interactively to a test suite's activity diagram. Multiple applications and their interaction may be handled and controlled in a single test suite. The target applications may execute both on the local or on remote hosts.<br />
<br />
;[[ Settings_JavaSWTGUITestPluginSettings | JavaSWT GUI Test Extension ]]<br />
: Provides a visualization of the widget hierarchy of a Java+SWT application. GUI elements can be searched, inspected and validation actions can be added interactively to a test suite's activity diagram. Multiple applications and their interaction may be handled and controlled in a single test suite. The target applications may execute both on the local or on remote hosts.<br />
<br />
;[[ Settings_JiraInterfacePluginSettings | JIRA Testresult Reporting ]]<br />
: This plugin creates a link between an expecco test case and an issue in a JIRA database. The issue can be automatically closed/reopened, whenever the test case is executed.<br />
<br />
;[[ Settings_ManualTestImport1PluginSettings | Manual Test Import ]]<br />
: This plugin imports test specifications for manual tests. These must be present as word (OpenOffice) document with a particular (tabular) format. After the import, a manual test GUI can be used to guide the tester through the test cases, or the resulting test plan can be used as a template for partial or full automation.<br />
<br />
;[[ Settings_PolarionInterfacePluginSettings | Polarion Interface ]]<br />
: This plugin allows for test-suites to be up-/downloaded to/from a Polarion QM server, to fetch and execute Polarion test runs, and to update a tests state to PASS/FAIL, whenever the test case is executed. Also, Polarion itself is extended for the definition and execution of expecco tests.<br />
<br />
;[[ Settings_PoloniumGUITestPluginSettings | Polonium ST/X Application''' Test Plugin ]]<br />
: The Polonium plugin adds an interface to the Polonium ST/X GUI test framework. Polonium does for an ST/X fat-client application what Selenium does for a browser based web application. It allows for capture/replay of ST/X GUI application sessions and the validation of a GUI's window contents.<br />
<br />
;[[ Settings_QtGUITestPluginSettings | Qt GUI Test Extension ]]<br />
: Similar to the JavaSwing GUI Test extension, this allows for a Qt (-> Trolltech) application's widget hierarchy to be inspected, manipulated and checked. Multiple applications and their interaction may be handled and controlled in a single test suite. The target applications may execute both on the local or on remote hosts.<br />
<br />
;[[ Settings_QCInterfacePluginSettings | Quality Center (QC) Interface ]]<br />
: This plugin allows for test-suites to be up-/downloaded to/from a Quality-Center server, to fetch and execute QC test sets, and to update a tests state to PASS/FAIL, whenever the test case is executed.<br />
<br />
;[[ Settings_SeleniumGUITestPluginSettings | WEBTest Plugin (Selenium Interface) ]]<br />
: The WEBTest plugin adds an interface to the Selenium Webtest framework. Selenium allows for capture/replay of web sessions and the validation of a web pages' contents. This plugin contains an import feature, which converts captured selenium sessions into an activity diagram. Also, a library consisting of web-page activities is included. Together, they allow for a recorded web session to be enhanced, refactored, reused or parametrized like any ordinary expecco activity diagram.<br />
<br />
:Beside many other possible uses, two extra functionalities of this plugin add much to the value of the expecco product:<br />
:* recorded web sessions can be augmented by semantic checks in the system under test. Especially the real effect of a web-transaction can be checked against the back-end of a web application.<br />
:* by feeding a recorded session's parameters through either a generator-block, or by reading a CSV-file or a database, web-sessions can be parametrized. This can even be done dynamically on the fly, depending upon previous response data. For example, a set of boundary values can be read from a file and feeded as input parameter sets to a prerecorded web session, or the output of a web page can be analyzed, transformed and used as input to another session or for a follow up test case.<br />
<br />
;[[ Settings_WindowsAutomationGUITestPluginSettings | Windows Automation Extension ]]<br />
: Similar to the other GUI Test extensions, this allows for Microsoft MFC/Forms application's widget hierarchies to be inspected, manipulated and checked. Multiple applications and their interaction may be handled and controlled in a single test suite. The target applications may execute both on the local or on remote hosts.<br />
<br />
;[[ Settings_WSDLImportPluginSettings | WSDL Import Extension ]]<br />
: Imports WSDL service description and automatically generates libraries containing types and actions to access these operations.<br />
<br />
;[[ Settings_XMIImportPluginSettings | XMI Import / Export Extension ]]<br />
: Import/Export of XMI UML diagrams<br />
<br />
;[[ Settings_XPDLImportPluginSettings | XPDL Import Extension ]]<br />
: Imports XPDL diagrams<br />
<br />
[[Category:Settings]]</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Settings_JavaSwingSettings/en&diff=5760Settings JavaSwingSettings/en2015-12-08T11:32:28Z<p>Mb: Die Seite wurde neu angelegt: „ == JDK Path == Please enter here the path to your JDK. This Path is used to inject expecco code in the Java AUT. Please specify here the JDK which fits your …“</p>
<hr />
<div><br />
== JDK Path ==<br />
<br />
Please enter here the path to your JDK. This Path is used to inject expecco code in the Java AUT. Please specify here the JDK which fits your app architecture - either x86 or x64<br />
<br />
<br />
== Installed Technologies ==<br />
<br />
The list shows the available technologies (licensed plugins)</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Settings_SeleniumSettings&diff=5759Settings SeleniumSettings2015-12-08T11:26:43Z<p>Mb: Die Seite wurde neu angelegt: „ == Show Menu in Main Menu == If checked, the Webtest plugin's menu functions are shown in the main menu. Otherwise, these are found in a submenu of the "plug…“</p>
<hr />
<div><br />
== Show Menu in Main Menu ==<br />
<br />
If checked, the Webtest plugin's menu functions are shown in the main menu. Otherwise, these are found in a submenu of the "plugins"-menu.<br />
<br />
<br />
== Firefox Setup ==<br />
<br />
Firefox is used to record tests with selenium ide and then export them to expecco for playback & refactoring. Afterward, you can playback the tests with different browsers. Note: If you playback test with Internet Explorer (IE), the current settings of your installed IE browser were taken - like installed certificates and others. Here you need to define the profile which is used for Record/Playback in firefox. If no profile is specified, we use a default profile prepared by exept. This is the right choice, if you need no SUT specific stuff like certificates, extensions and others to record and/or playback the tests with firefox.<br />
<br />
<br />
== Use Firefox Template ==<br />
<br />
If checked, you can specify a firefox profile which is used as template for recording an playback. Otherwise a default profile delivered by exept is used. You need this, if you have already setup a profile with the certificates, proxy settings, security settings and others stuff required by your SUT.<br />
<br />
== Firefox Profile Template ==<br />
<br />
The path to your firefox profile. As default, it is stored in the user directory + AppData\Roaming\expecco\<br />
<br />
== Define Profile... ==<br />
<br />
Here you can make changes to the profile in the "Firefox Profile Template". You get a browser opened on the profile and there you can add additional certificates, plugins, settings and so on. The changes will be stored after closing the browser and will be used in the following recording & playback sessions.<br />
<br />
== Reset Profile... ==<br />
<br />
Here you can reset the profile to the profile delivered by exept. All changes in the profile specified in "Firefox Profile Template" will be lost! A new copy of the exept profile will be copied to that destination. Afterwards, you can add custom stuff. You can this also do later by clicking the "Define Profile..." button.<br />
<br />
== Choose Free Port on Localhost ==<br />
<br />
If this option is checked, you don't need to specify Selenium RC Host/Port. Expecco searches automatically for a free port on "localhost" which is then used for communication between expecco and selenium.<br />
<br />
== Selenium RC Host ==<br />
<br />
Defines the machine on which the Selenium RC Server is running. By default the local machine ("localhost") is used.<br />
<br />
== Selenium RC Port ==<br />
<br />
This specifies the port number of the Selenium RC Server on the specified host. By default, the 4444 port is used for communiation between expecco and selenium.<br />
This communication path is only used when replaying a web session (test execution).<br />
Change this, if the 4444 port csnnot be used for some reason (for example, if another service on your machine uses this port).<br />
<br />
== Timeout ==<br />
<br />
This sets a limit on the maximum execution time of a selenium command. A command which does not finish in this number of seconds, is considered to be failed, and the corresponding activity treated like a failed activity. This option is used when the server starts and could be redefined in the tests.<br />
<br />
== ProxyInjectionMode ==<br />
<br />
If this option is checked, all the HTTP traffic goes through the Selenium Proxy. Disabling this option makes the test execution faster, but less compatible with certain sites.<br />
Also sites with cross-domain links always require ProxyInjectionMode to be enabled.<br />
For more information, please refer to the Selenium documentation.<br />
<br />
== AvoidProxy ==<br />
<br />
With this option, only the necessary part goes through the proxy - a bit more speed..... For more information, please refer to the Selenium documentation.</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Installation&diff=5056Installation2015-06-19T07:49:35Z<p>Mb: /* Zusätzlich symbolische Links (libodbc,...) */</p>
<hr />
<div>== Installation von expecco unter Windows ==<br />
<br />
Sie erhalten eine Email mit dem Link zu den expecco-Installationsdateien. Die Installationsdateien haben die Namen<br />
<br />
* expeccoSetup-2.7.0.22.exe -> für die expecco-Basisinstallation<br />
* expeccoPluginSetup-27.0.22.exe -> für optionale Plugins.<br />
<br />
wobei hier 2.7.0 der Versionsnummer von expecco entspricht und 22 der Build-Nummer. <br />
Die Installationsdatei für die Plugins benötigen Sie nur dann, wenn Sie optionale Plugins lizensiert haben. <br />
Die Versionsnummer von ''expeccoSetup'' und ''expeccoPluginSetup'' muss gleich sein. <br />
<br />
Bitte laden Sie die Installationsprogramme auf Ihren Rechner.<br />
Führen Sie zuerst das Installationsprogramm für die expecco-Basisinstallation aus (''expeccoSetup-***.exe''). <br />
Folgen Sie dabei dem Installationsassistenten. <br />
Sie können hier das Laufwerk und das Verzeichnis angeben, unter dem expecco installiert werden soll. <br />
Außerdem können Sie die Komponenten angeben, die sie installieren wollen.<br />
<br />
Falls Sie Plugins für expecco lizensiert haben, führen sie jetzt das Installationsprogramm für die expecco-Plugins aus (''expeccoPluginSetup-***.exe''). <br />
Im Installationsassistenten können Sie zu installierende Plugins auswählen. <br />
Angeboten werden alle Plugins - auch solche für die Sie keine Lizenzen erworben haben.<br />
Falls Sie nicht lizenzierte Plugins installieren, ist deren Funktion in expecco nicht verfügbar und entsprechende Menu-Einträge entweder unsichtbar oder ausgegraut.<br />
Installierte, aber nicht lizenzierte Plugins sind erst dann verfügbar, wenn die dazu passenden Lizenzen (nach-)installiert wurden. <br />
Ansonsten belegen Sie nur Platz auf der Festplatte. <br />
Weitere Plugins können auch jederzeit nachträglich installiert werden. Auch können weitere Lizenzen jederzeit später erworben werden.<br />
<br />
Nach der Installation finden Sie auf Ihrem Desktop das expecco-Symbol. <br />
Über dieses Symbol können Sie expecco nun starten.<br />
Beim erstmaligen Ausführen, erscheint ein Fenster, in dem eine Lizenz verlangt wird. <br />
Je nachdem, ob Sie eine Einzellizenz oder eine Floating-Lizenz (per Lizenzserver) nutzen, müssen Sie die Lizenz entsprechend nachfolgender Beschreibung installieren.<br />
<br />
=== Konfiguration der Einzellizenz ===<br />
<br />
Einzellizenzen werden üblicherweise mit einem USB-Dongle genutzt. <br />
Ausnahmsweise können auch zeitlich limitierte Einzellizenzen ohne Dongle verwendet werden. <br />
In beiden Fällen erhalten Sie eine Lizenzdatei. <br />
Lizenzdateien und Dongle müssen jeweils zusammenpassen, wobei eine Lizenzdatei auch zu mehreren Dongles desselben Kunden passen kann.<br />
<br />
# falls Sie einen Dongle erhalten haben, stecken Sie ihn in einen freien USB-Port in ihrem Rechner.<br />
# Speichern Sie die Lizenzdatei auf ihrem Rechner<br />
# Ziehen Sie dann entweder die Datei mit der Maus aus dem Windows-Explorer in den Lizenzdialog, oder Sie wählen im Lizenzdialog Ihre Lizenzdatei direkt aus.<br />
# Sie werden aufgefordert, expecco neu zu starten. Nach dem Neustart können Sie expecco nutzen.<br />
<br />
Lizenzdateien ohne Dongle sind zeitlich beschränkt. <br />
Wenn Sie versehentlich den expecco-Dongle nicht in Ihren Rechner eingesteckt haben und expecco starten, erhalten Sie einen Hinweis, dass die Lizenz abgelaufen sei. <br />
Sobald Sie den Dongle einstecken, erscheint dieser Hinweis beim Start von expecco nicht mehr.<br />
<br />
Solange sie mit expecco arbeiten, wird überwacht, ob der Dongle vorhanden ist. <br />
Wenn Sie den Dongle während dessen aus ihrem Rechner entfernen, erhalten Sie einen Hinweis und können keine Tests mehr ausführen oder verändern. <br />
Sie können allerdings die gerade bearbeitete Testsuite noch abspeichern, so dass keine Änderungen verloren gehen.<br />
<br />
=== Konfiguration der Floating-Lizenz ===<br />
<br />
Um eine Floating-Lizenz zu nutzen, benötigen Sie einen expecco-Lizenzserver. <br />
Der Lizenzserver ist unter einem Rechnername bzw. IP-Adresse und einer Portnummer zu erreichen. <br />
Der Administrator des Lizenzservers kann Ihnen diese Informationen geben, falls er eine andere als die default-Portnummer konfiuriert hat. <br />
Es muss sichergestellt sein, dass eine TCP-Verbindung zum entsprechenen Port im Lizenzserver aufgebaut werden kann. <br />
Router und Firewalls sind entsprechen zu konfigurieren bzw. Ports freizuschalten.<br />
<br />
Beim Start von expecco öffnet sich der Lizenzdialog. <br />
Wählen Sie hier die Lizenzserver-Kachel aus. <br />
Tragen Sie den Rechnernamen bzw. die IP-Adresse sowie die Portnummer des Lizenservers ein. <br />
Im allgemeinen kann die vorgeschlagene default Portnummer unverändert übernommen werden.<br />
Lediglich in Netzwerken, bei denen nur bestimmte Ports durch Firewalls oder Router durchgeschaltet werden ist es u.U. notwendig, eine andere Portnummer zu verwenden.<br />
Der Administrator des Lizenzservers kann Ihnen in diesem Fall diese Informationen geben<br />
<br />
Sie können jetzt auswählen, welche expecco-Ausprägung Sie verwenden wollen: ''expecco-developer'' oder ''expecco-runtime''. <br />
Über die Schaltfläche ''Plugin-Liste vom Server aktualisieren'' erhalten Sie die verfügbaren Plugins (bzw. Plugins für die noch floating Lizenzen verfügbar sind). <br />
Wählen Sie die Plugins aus, die Sie für ihre Tests benötigen. <br />
Von den meisten Plugins benötigen Sie nur eine Lizenz. <br />
Einzelne Plugins können für auf mehrere Rechner verteilte Tests mehr als eine Lizenz von einem Plugin benötigen - Sie können das für derartige Plugins angeben. <br />
Im Dialog wird angezeigt, wieviele Lizenzen für ein bestimmtes Plugin auf dem Lizenzserver momentan noch zur Verfügung stehen. <br />
Per Tooltip können Sie auch in Erfahrung bringen, wie viele Lizenzen generell vorhanden sind. <br />
Die Differenz sind die momentan von anderen Benutzern verwendeten Lizenzen.<br />
<br />
Über die Schaltfläche ''Lizenzdatei installieren'' werden die Lizenzen vom Lizenzserver abonniert. <br />
Starten Sie jetzt expecco neu, damit die lizenzierten Plugins geladen werden.<br />
<br />
Wenn expecco beendet wird, werden alle Lizenzen wieder an den Lizenzserver zurück gegeben. <br />
Expecco erneuert regelmäßig die Lizenzen vom Lizenzserver. <br />
Wenn der Lizenzserver über einen gewissen Zeitraum nicht mehr erreichbar sein sollte (ca. 15 Minuten), wird expecco gesperrt, so dass keine Tests mehr ausgeführt oder verändert werden können. Geänderte Testsuiten können aber noch abgespeichert werden.<br />
<br />
Wenn expecco nicht regulär beendet wurde, z.B. wenn der Rechner einfach ausgeschaltet wird, fallen die Lizenzen nach diesem Zeitraum an den Lizenzserver zurück und können dann von anderen Benutzern genutzt werden. <br />
<br />
expecco merkt sich, welche Lizenzen zuletzt abonniert wurden. <br />
Wenn expecco gestartet wird, versucht es, die zuletzt abonnierten Lizenzen wieder zu erhalten. <br />
Sollte das nicht möglich sein, da alle Lizenzen momentan vergeben sind, erscheint der Lizenzdialog, in dem die nicht oder nur teilweise erhaltenen Lizenzen rot unterlegt sind.<br />
<br />
Wenn Sie neue Lizenzen benötigen oder bisher verwendete Lizenzen nicht mehr benötigen, <br />
können Sie die anzufordernden Lizenzen jederzeit über den Lizenzdialog anpassen. <br />
Sie erreichen ihn über das Menu ''Extras -> Einstellungen -> Lizenzinstallation''.<br />
<br />
=== Update Installation von expecco unter Windows ===<br />
<br />
Wie bei der Erstinstallation erhalten eine Email mit dem Link zu den neuen expecco-Installationsdateien.<br />
Bitte laden Sie die Installationsprogramme herunter. <br />
Bei der Ausführung des Basis-Installationsprogramms ''expeccoSetup-***.exe'' erkennt expecco, dass es bereits installiert ist, und zeigt einen Dialog an, in dem Sie um eine Bestätigung gebeten werden, dass die alte expecco-Version deinstalliert werden darf. <br />
Bestätigen Sie bitte diesen Dialog. Die alte expecco-Version wird mit allen Plugins deinstalliert. <br />
Ihre Einstellungen, Lizenzdateien und Ihre Testsuiten bleiben erhalten. <br />
Anschließend wir die neue expecco-Version wie bei der Erstinstallation (s.o.) installiert. <br />
Installieren Sie ggfs. die Plugins über die neue Installationsdate ''expeccoPluginSetup-***.exe''.<br />
<br />
== Installation unter Linux ==<br />
<br />
=== Benötigte Linux Sofwarepakete ===<br />
<br />
expecco läuft sowohl auf 32- als auch auf 64-bit Linux Systemen. Es ist als 32-bit-Programm übersetzt, und benötigt daher auch auf amd64/x86-64 - Installationen die Bibliotheken in der 32-bit Version. Es wird eine glibc in der Version >= 2.9 benötigt.<br />
<br />
Installieren Sie über Ihren Paketmanager Ihrer Linux-Distribution folgende Pakete (alle als 32-bit-Pakete):<br />
<br />
* libXinerama<br />
* libXft<br />
* libusb <br />
* unixODBC<br />
<br />
Diese Pakete hängen von weiteren Paketen ab, die der Paketmanager automatisch mit installiert.<br />
<br />
=== Installation von expecco unter linux ===<br />
<br />
Sie erhalten eine Email mit dem Link zu der expecco-Installationsdatei. Die Installationsdatei hat den Namen:<br />
<br />
* expecco-2.7.0.22.x86.package<br />
<br />
wobei hier 2.7.0 der Versionsnummer von expecco entspricht und 22 der Build-Nummer. Die Installationsdatei enthält das expecco-Basispaket sowie die Plugins.<br />
<br />
Für die Installation benötigen Sie bei einer erstmaligen Installation außerdem noch das ''autopackage'' Paket. Sie können es hier herunterladen: http://download.exept.de/transfer/autopackage/autopackage.tar.bz2<br />
<br />
Laden Sie die expecco-Installationsdatei und ggfs. ''autopackage.tar.bz2'' in dasselbe Verzeichnis auf ihrem Rechner. <br />
<br />
Sie können die Installation als Benutzer ''root'' oder als normaler Benutzer ausführen. Wenn Sie expecco als Benutzer ''root'' installieren, wird expecco im Verzeichnis ''/opt/expecco/bin'' installiert. Bei einer Installation als normaler Benutzer, wird expecco in ihrem Home-Verzeichnis nach ''.local/bin'' installiert.<br />
<br />
Führen Sie aus:<br />
<br />
sh expecco-2.7.0.22.x86.package<br />
<br />
expecco wird daraufhin installiert, es erscheint folgende Ausgabe:<br />
<br />
<br />
# Preparing package: expecco - Graphical Test Modeling <br />
# Checking for required C library versions ... passed<br />
This may take a moment, please wait ... done<br />
# Installing package: expecco - Graphical Test Modeling (package 1 of 1) <br />
# 100%[==================================================] Extracting<br />
# Copying files to /opt/expecco/plugin<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/packages/exept/technologyBridge<br />
# Copying files to /opt/expecco/packages/exept/technologyBridge/javaBridge<br />
# Copying files to /opt/expecco/packages/exept/technologyBridge/javaBridge/javaBridge_Server_Client<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/packages/stx/libsnmp<br />
# Copying files to /opt/expecco/packages/stx/libsnmp/net-snmp-5.7.2/mibs<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/testsuites/libraries<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/bin<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/lib<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/packages/exept/expecco/doc<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/testsuites/libraries<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/testsuites/examples<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/packages/exept/expecco/reportGenerator/tools<br />
# Copying files to /opt/expecco/packages/exept/pdf/afm<br />
# 100%[==================================================] Copying<br />
# Installing USB Dongle access...<br />
# Updating package database...<br />
The following package was successfully installed:<br />
* expecco - Graphical Test Modeling<br />
This installation used 478.74 MiB (502.00 MB) of disk space.<br />
Remove this package by running package remove expecco from the command line.<br />
<br />
=== Spezielle Installations-Optionen ===<br />
<br />
Sie können das Verzeichnis, in das expecco installiert wird, wie folgt festlegen:<br />
<br />
sh expecco-2.7.0.22.x86.package<br />
Installation als root nach /opt/expecco (Starten mit: /opt/expecco/bin/expecco)<br />
<br />
sh expecco-2.7.0.22.x86.package --prefix /opt/expecco-1.7<br />
Installation als root nach /opt/expecco-1.7 (Starten mit: /opt/expecco-1.7/bin/expecco)<br />
<br />
sh expecco-2.7.0.22.x86.package --local-only<br />
Installation als Benutzer nach $HOME/.local (Starten mit ~/.local/bin/expecco)<br />
<br />
sh expecco-2.7.0.22.x86.package --local-only --prefix ~/expecco<br />
Installation als Benutzer nach $HOME/expecco (Starten mit ~/expecco/bin/expecco)<br />
<br />
=== Konfiguration der Lizenz ===<br />
<br />
Beim erstmaligen Ausführen, erscheint ein Fenster, in dem eine Lizenz verlangt wird. Je nachdem, ob Sie eine Einzellizenz oder eine Floating-Lizenz (per Lizenzserver) nutzen, können Sie die Lizenz konfigurieren. <br />
<br />
[[#Konfiguration der Einzellizenz | Konfiguration der Einzellizenz]] (wie oben beschrieben)<br />
<br />
[[#Konfiguration der Floating-Lizenz | Konfiguration der Floating-Lizenz]] (wie oben beschrieben)<br />
<br />
=== Update Installation von expecco unter Linux ===<br />
<br />
Wie bei der Erstinstallation erhalten eine Email mit dem Link zu der neuen expecco-Installationsdatei.<br />
Bitte laden Sie das Installationsprogramme herunter. Bei der Ausführung des Installationsprogramms ''sh expecco-***.x86.package'' erkennt expecco, dass eine andere Version bereits installiert wurde. Die alte expecco-Version wird mit allen Plugins automatisch deinstalliert. Ihre Einstellungen, Lizenzdateien und Ihre Testsuiten bleiben erhalten. Anschließend wir die neue expecco-Version wie bei der Erstinstallation (s.o.) installiert.<br />
<br />
=== Zusätzlich symbolische Links (libodbc,...) ===<br />
<br />
Auf einigen Systemen werden zusätzliche Symbolische Links benötigt:<br />
<br />
libodbc.so.1 & libodbcinst.so.1:<br />
<br />
z.B unter Ubuntu im Verzeichnis /usr/lib/i386-linux-gnu<br />
<br />
Dort können die Links wie folgt angelegt werden:<br />
<br />
sudo ln -s libodbc.so.1 libodbc.so.2<br />
<br />
sudo ln -s libodbcinst.so.1 libodbcinst.so.2</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Installation&diff=5055Installation2015-06-19T07:46:51Z<p>Mb: /* Zusätzlich symbolische Links */</p>
<hr />
<div>== Installation von expecco unter Windows ==<br />
<br />
Sie erhalten eine Email mit dem Link zu den expecco-Installationsdateien. Die Installationsdateien haben die Namen<br />
<br />
* expeccoSetup-2.7.0.22.exe -> für die expecco-Basisinstallation<br />
* expeccoPluginSetup-27.0.22.exe -> für optionale Plugins.<br />
<br />
wobei hier 2.7.0 der Versionsnummer von expecco entspricht und 22 der Build-Nummer. <br />
Die Installationsdatei für die Plugins benötigen Sie nur dann, wenn Sie optionale Plugins lizensiert haben. <br />
Die Versionsnummer von ''expeccoSetup'' und ''expeccoPluginSetup'' muss gleich sein. <br />
<br />
Bitte laden Sie die Installationsprogramme auf Ihren Rechner.<br />
Führen Sie zuerst das Installationsprogramm für die expecco-Basisinstallation aus (''expeccoSetup-***.exe''). <br />
Folgen Sie dabei dem Installationsassistenten. <br />
Sie können hier das Laufwerk und das Verzeichnis angeben, unter dem expecco installiert werden soll. <br />
Außerdem können Sie die Komponenten angeben, die sie installieren wollen.<br />
<br />
Falls Sie Plugins für expecco lizensiert haben, führen sie jetzt das Installationsprogramm für die expecco-Plugins aus (''expeccoPluginSetup-***.exe''). <br />
Im Installationsassistenten können Sie zu installierende Plugins auswählen. <br />
Angeboten werden alle Plugins - auch solche für die Sie keine Lizenzen erworben haben.<br />
Falls Sie nicht lizenzierte Plugins installieren, ist deren Funktion in expecco nicht verfügbar und entsprechende Menu-Einträge entweder unsichtbar oder ausgegraut.<br />
Installierte, aber nicht lizenzierte Plugins sind erst dann verfügbar, wenn die dazu passenden Lizenzen (nach-)installiert wurden. <br />
Ansonsten belegen Sie nur Platz auf der Festplatte. <br />
Weitere Plugins können auch jederzeit nachträglich installiert werden. Auch können weitere Lizenzen jederzeit später erworben werden.<br />
<br />
Nach der Installation finden Sie auf Ihrem Desktop das expecco-Symbol. <br />
Über dieses Symbol können Sie expecco nun starten.<br />
Beim erstmaligen Ausführen, erscheint ein Fenster, in dem eine Lizenz verlangt wird. <br />
Je nachdem, ob Sie eine Einzellizenz oder eine Floating-Lizenz (per Lizenzserver) nutzen, müssen Sie die Lizenz entsprechend nachfolgender Beschreibung installieren.<br />
<br />
=== Konfiguration der Einzellizenz ===<br />
<br />
Einzellizenzen werden üblicherweise mit einem USB-Dongle genutzt. <br />
Ausnahmsweise können auch zeitlich limitierte Einzellizenzen ohne Dongle verwendet werden. <br />
In beiden Fällen erhalten Sie eine Lizenzdatei. <br />
Lizenzdateien und Dongle müssen jeweils zusammenpassen, wobei eine Lizenzdatei auch zu mehreren Dongles desselben Kunden passen kann.<br />
<br />
# falls Sie einen Dongle erhalten haben, stecken Sie ihn in einen freien USB-Port in ihrem Rechner.<br />
# Speichern Sie die Lizenzdatei auf ihrem Rechner<br />
# Ziehen Sie dann entweder die Datei mit der Maus aus dem Windows-Explorer in den Lizenzdialog, oder Sie wählen im Lizenzdialog Ihre Lizenzdatei direkt aus.<br />
# Sie werden aufgefordert, expecco neu zu starten. Nach dem Neustart können Sie expecco nutzen.<br />
<br />
Lizenzdateien ohne Dongle sind zeitlich beschränkt. <br />
Wenn Sie versehentlich den expecco-Dongle nicht in Ihren Rechner eingesteckt haben und expecco starten, erhalten Sie einen Hinweis, dass die Lizenz abgelaufen sei. <br />
Sobald Sie den Dongle einstecken, erscheint dieser Hinweis beim Start von expecco nicht mehr.<br />
<br />
Solange sie mit expecco arbeiten, wird überwacht, ob der Dongle vorhanden ist. <br />
Wenn Sie den Dongle während dessen aus ihrem Rechner entfernen, erhalten Sie einen Hinweis und können keine Tests mehr ausführen oder verändern. <br />
Sie können allerdings die gerade bearbeitete Testsuite noch abspeichern, so dass keine Änderungen verloren gehen.<br />
<br />
=== Konfiguration der Floating-Lizenz ===<br />
<br />
Um eine Floating-Lizenz zu nutzen, benötigen Sie einen expecco-Lizenzserver. <br />
Der Lizenzserver ist unter einem Rechnername bzw. IP-Adresse und einer Portnummer zu erreichen. <br />
Der Administrator des Lizenzservers kann Ihnen diese Informationen geben, falls er eine andere als die default-Portnummer konfiuriert hat. <br />
Es muss sichergestellt sein, dass eine TCP-Verbindung zum entsprechenen Port im Lizenzserver aufgebaut werden kann. <br />
Router und Firewalls sind entsprechen zu konfigurieren bzw. Ports freizuschalten.<br />
<br />
Beim Start von expecco öffnet sich der Lizenzdialog. <br />
Wählen Sie hier die Lizenzserver-Kachel aus. <br />
Tragen Sie den Rechnernamen bzw. die IP-Adresse sowie die Portnummer des Lizenservers ein. <br />
Im allgemeinen kann die vorgeschlagene default Portnummer unverändert übernommen werden.<br />
Lediglich in Netzwerken, bei denen nur bestimmte Ports durch Firewalls oder Router durchgeschaltet werden ist es u.U. notwendig, eine andere Portnummer zu verwenden.<br />
Der Administrator des Lizenzservers kann Ihnen in diesem Fall diese Informationen geben<br />
<br />
Sie können jetzt auswählen, welche expecco-Ausprägung Sie verwenden wollen: ''expecco-developer'' oder ''expecco-runtime''. <br />
Über die Schaltfläche ''Plugin-Liste vom Server aktualisieren'' erhalten Sie die verfügbaren Plugins (bzw. Plugins für die noch floating Lizenzen verfügbar sind). <br />
Wählen Sie die Plugins aus, die Sie für ihre Tests benötigen. <br />
Von den meisten Plugins benötigen Sie nur eine Lizenz. <br />
Einzelne Plugins können für auf mehrere Rechner verteilte Tests mehr als eine Lizenz von einem Plugin benötigen - Sie können das für derartige Plugins angeben. <br />
Im Dialog wird angezeigt, wieviele Lizenzen für ein bestimmtes Plugin auf dem Lizenzserver momentan noch zur Verfügung stehen. <br />
Per Tooltip können Sie auch in Erfahrung bringen, wie viele Lizenzen generell vorhanden sind. <br />
Die Differenz sind die momentan von anderen Benutzern verwendeten Lizenzen.<br />
<br />
Über die Schaltfläche ''Lizenzdatei installieren'' werden die Lizenzen vom Lizenzserver abonniert. <br />
Starten Sie jetzt expecco neu, damit die lizenzierten Plugins geladen werden.<br />
<br />
Wenn expecco beendet wird, werden alle Lizenzen wieder an den Lizenzserver zurück gegeben. <br />
Expecco erneuert regelmäßig die Lizenzen vom Lizenzserver. <br />
Wenn der Lizenzserver über einen gewissen Zeitraum nicht mehr erreichbar sein sollte (ca. 15 Minuten), wird expecco gesperrt, so dass keine Tests mehr ausgeführt oder verändert werden können. Geänderte Testsuiten können aber noch abgespeichert werden.<br />
<br />
Wenn expecco nicht regulär beendet wurde, z.B. wenn der Rechner einfach ausgeschaltet wird, fallen die Lizenzen nach diesem Zeitraum an den Lizenzserver zurück und können dann von anderen Benutzern genutzt werden. <br />
<br />
expecco merkt sich, welche Lizenzen zuletzt abonniert wurden. <br />
Wenn expecco gestartet wird, versucht es, die zuletzt abonnierten Lizenzen wieder zu erhalten. <br />
Sollte das nicht möglich sein, da alle Lizenzen momentan vergeben sind, erscheint der Lizenzdialog, in dem die nicht oder nur teilweise erhaltenen Lizenzen rot unterlegt sind.<br />
<br />
Wenn Sie neue Lizenzen benötigen oder bisher verwendete Lizenzen nicht mehr benötigen, <br />
können Sie die anzufordernden Lizenzen jederzeit über den Lizenzdialog anpassen. <br />
Sie erreichen ihn über das Menu ''Extras -> Einstellungen -> Lizenzinstallation''.<br />
<br />
=== Update Installation von expecco unter Windows ===<br />
<br />
Wie bei der Erstinstallation erhalten eine Email mit dem Link zu den neuen expecco-Installationsdateien.<br />
Bitte laden Sie die Installationsprogramme herunter. <br />
Bei der Ausführung des Basis-Installationsprogramms ''expeccoSetup-***.exe'' erkennt expecco, dass es bereits installiert ist, und zeigt einen Dialog an, in dem Sie um eine Bestätigung gebeten werden, dass die alte expecco-Version deinstalliert werden darf. <br />
Bestätigen Sie bitte diesen Dialog. Die alte expecco-Version wird mit allen Plugins deinstalliert. <br />
Ihre Einstellungen, Lizenzdateien und Ihre Testsuiten bleiben erhalten. <br />
Anschließend wir die neue expecco-Version wie bei der Erstinstallation (s.o.) installiert. <br />
Installieren Sie ggfs. die Plugins über die neue Installationsdate ''expeccoPluginSetup-***.exe''.<br />
<br />
== Installation unter Linux ==<br />
<br />
=== Benötigte Linux Sofwarepakete ===<br />
<br />
expecco läuft sowohl auf 32- als auch auf 64-bit Linux Systemen. Es ist als 32-bit-Programm übersetzt, und benötigt daher auch auf amd64/x86-64 - Installationen die Bibliotheken in der 32-bit Version. Es wird eine glibc in der Version >= 2.9 benötigt.<br />
<br />
Installieren Sie über Ihren Paketmanager Ihrer Linux-Distribution folgende Pakete (alle als 32-bit-Pakete):<br />
<br />
* libXinerama<br />
* libXft<br />
* libusb <br />
* unixODBC<br />
<br />
Diese Pakete hängen von weiteren Paketen ab, die der Paketmanager automatisch mit installiert.<br />
<br />
=== Installation von expecco unter linux ===<br />
<br />
Sie erhalten eine Email mit dem Link zu der expecco-Installationsdatei. Die Installationsdatei hat den Namen:<br />
<br />
* expecco-2.7.0.22.x86.package<br />
<br />
wobei hier 2.7.0 der Versionsnummer von expecco entspricht und 22 der Build-Nummer. Die Installationsdatei enthält das expecco-Basispaket sowie die Plugins.<br />
<br />
Für die Installation benötigen Sie bei einer erstmaligen Installation außerdem noch das ''autopackage'' Paket. Sie können es hier herunterladen: http://download.exept.de/transfer/autopackage/autopackage.tar.bz2<br />
<br />
Laden Sie die expecco-Installationsdatei und ggfs. ''autopackage.tar.bz2'' in dasselbe Verzeichnis auf ihrem Rechner. <br />
<br />
Sie können die Installation als Benutzer ''root'' oder als normaler Benutzer ausführen. Wenn Sie expecco als Benutzer ''root'' installieren, wird expecco im Verzeichnis ''/opt/expecco/bin'' installiert. Bei einer Installation als normaler Benutzer, wird expecco in ihrem Home-Verzeichnis nach ''.local/bin'' installiert.<br />
<br />
Führen Sie aus:<br />
<br />
sh expecco-2.7.0.22.x86.package<br />
<br />
expecco wird daraufhin installiert, es erscheint folgende Ausgabe:<br />
<br />
<br />
# Preparing package: expecco - Graphical Test Modeling <br />
# Checking for required C library versions ... passed<br />
This may take a moment, please wait ... done<br />
# Installing package: expecco - Graphical Test Modeling (package 1 of 1) <br />
# 100%[==================================================] Extracting<br />
# Copying files to /opt/expecco/plugin<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/packages/exept/technologyBridge<br />
# Copying files to /opt/expecco/packages/exept/technologyBridge/javaBridge<br />
# Copying files to /opt/expecco/packages/exept/technologyBridge/javaBridge/javaBridge_Server_Client<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/packages/stx/libsnmp<br />
# Copying files to /opt/expecco/packages/stx/libsnmp/net-snmp-5.7.2/mibs<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/testsuites/libraries<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/bin<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/lib<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/packages/exept/expecco/doc<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/testsuites/libraries<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/testsuites/examples<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/packages/exept/expecco/reportGenerator/tools<br />
# Copying files to /opt/expecco/packages/exept/pdf/afm<br />
# 100%[==================================================] Copying<br />
# Installing USB Dongle access...<br />
# Updating package database...<br />
The following package was successfully installed:<br />
* expecco - Graphical Test Modeling<br />
This installation used 478.74 MiB (502.00 MB) of disk space.<br />
Remove this package by running package remove expecco from the command line.<br />
<br />
=== Spezielle Installations-Optionen ===<br />
<br />
Sie können das Verzeichnis, in das expecco installiert wird, wie folgt festlegen:<br />
<br />
sh expecco-2.7.0.22.x86.package<br />
Installation als root nach /opt/expecco (Starten mit: /opt/expecco/bin/expecco)<br />
<br />
sh expecco-2.7.0.22.x86.package --prefix /opt/expecco-1.7<br />
Installation als root nach /opt/expecco-1.7 (Starten mit: /opt/expecco-1.7/bin/expecco)<br />
<br />
sh expecco-2.7.0.22.x86.package --local-only<br />
Installation als Benutzer nach $HOME/.local (Starten mit ~/.local/bin/expecco)<br />
<br />
sh expecco-2.7.0.22.x86.package --local-only --prefix ~/expecco<br />
Installation als Benutzer nach $HOME/expecco (Starten mit ~/expecco/bin/expecco)<br />
<br />
=== Konfiguration der Lizenz ===<br />
<br />
Beim erstmaligen Ausführen, erscheint ein Fenster, in dem eine Lizenz verlangt wird. Je nachdem, ob Sie eine Einzellizenz oder eine Floating-Lizenz (per Lizenzserver) nutzen, können Sie die Lizenz konfigurieren. <br />
<br />
[[#Konfiguration der Einzellizenz | Konfiguration der Einzellizenz]] (wie oben beschrieben)<br />
<br />
[[#Konfiguration der Floating-Lizenz | Konfiguration der Floating-Lizenz]] (wie oben beschrieben)<br />
<br />
=== Update Installation von expecco unter Linux ===<br />
<br />
Wie bei der Erstinstallation erhalten eine Email mit dem Link zu der neuen expecco-Installationsdatei.<br />
Bitte laden Sie das Installationsprogramme herunter. Bei der Ausführung des Installationsprogramms ''sh expecco-***.x86.package'' erkennt expecco, dass eine andere Version bereits installiert wurde. Die alte expecco-Version wird mit allen Plugins automatisch deinstalliert. Ihre Einstellungen, Lizenzdateien und Ihre Testsuiten bleiben erhalten. Anschließend wir die neue expecco-Version wie bei der Erstinstallation (s.o.) installiert.<br />
<br />
=== Zusätzlich symbolische Links (libodbc,...) ===<br />
<br />
Auf einigen Systemen werden zusätzliche Symbolische Links benötigt:<br />
<br />
libodbc.so.1 & libodbcinst.so.1:<br />
<br />
z.B unter Ubuntu im Verzeichnis /usr/lib/i386-linux-gnu<br />
<br />
Dort können die Links wie folgt angelegt werden:<br />
<br />
sudo ln -s libodbc.so.1 libodbc.so.2<br />
sudo ln -s libodbcinst.so.1 libodbcinst.so.2</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Installation&diff=5054Installation2015-06-19T07:46:22Z<p>Mb: /* Installation unter Linux */</p>
<hr />
<div>== Installation von expecco unter Windows ==<br />
<br />
Sie erhalten eine Email mit dem Link zu den expecco-Installationsdateien. Die Installationsdateien haben die Namen<br />
<br />
* expeccoSetup-2.7.0.22.exe -> für die expecco-Basisinstallation<br />
* expeccoPluginSetup-27.0.22.exe -> für optionale Plugins.<br />
<br />
wobei hier 2.7.0 der Versionsnummer von expecco entspricht und 22 der Build-Nummer. <br />
Die Installationsdatei für die Plugins benötigen Sie nur dann, wenn Sie optionale Plugins lizensiert haben. <br />
Die Versionsnummer von ''expeccoSetup'' und ''expeccoPluginSetup'' muss gleich sein. <br />
<br />
Bitte laden Sie die Installationsprogramme auf Ihren Rechner.<br />
Führen Sie zuerst das Installationsprogramm für die expecco-Basisinstallation aus (''expeccoSetup-***.exe''). <br />
Folgen Sie dabei dem Installationsassistenten. <br />
Sie können hier das Laufwerk und das Verzeichnis angeben, unter dem expecco installiert werden soll. <br />
Außerdem können Sie die Komponenten angeben, die sie installieren wollen.<br />
<br />
Falls Sie Plugins für expecco lizensiert haben, führen sie jetzt das Installationsprogramm für die expecco-Plugins aus (''expeccoPluginSetup-***.exe''). <br />
Im Installationsassistenten können Sie zu installierende Plugins auswählen. <br />
Angeboten werden alle Plugins - auch solche für die Sie keine Lizenzen erworben haben.<br />
Falls Sie nicht lizenzierte Plugins installieren, ist deren Funktion in expecco nicht verfügbar und entsprechende Menu-Einträge entweder unsichtbar oder ausgegraut.<br />
Installierte, aber nicht lizenzierte Plugins sind erst dann verfügbar, wenn die dazu passenden Lizenzen (nach-)installiert wurden. <br />
Ansonsten belegen Sie nur Platz auf der Festplatte. <br />
Weitere Plugins können auch jederzeit nachträglich installiert werden. Auch können weitere Lizenzen jederzeit später erworben werden.<br />
<br />
Nach der Installation finden Sie auf Ihrem Desktop das expecco-Symbol. <br />
Über dieses Symbol können Sie expecco nun starten.<br />
Beim erstmaligen Ausführen, erscheint ein Fenster, in dem eine Lizenz verlangt wird. <br />
Je nachdem, ob Sie eine Einzellizenz oder eine Floating-Lizenz (per Lizenzserver) nutzen, müssen Sie die Lizenz entsprechend nachfolgender Beschreibung installieren.<br />
<br />
=== Konfiguration der Einzellizenz ===<br />
<br />
Einzellizenzen werden üblicherweise mit einem USB-Dongle genutzt. <br />
Ausnahmsweise können auch zeitlich limitierte Einzellizenzen ohne Dongle verwendet werden. <br />
In beiden Fällen erhalten Sie eine Lizenzdatei. <br />
Lizenzdateien und Dongle müssen jeweils zusammenpassen, wobei eine Lizenzdatei auch zu mehreren Dongles desselben Kunden passen kann.<br />
<br />
# falls Sie einen Dongle erhalten haben, stecken Sie ihn in einen freien USB-Port in ihrem Rechner.<br />
# Speichern Sie die Lizenzdatei auf ihrem Rechner<br />
# Ziehen Sie dann entweder die Datei mit der Maus aus dem Windows-Explorer in den Lizenzdialog, oder Sie wählen im Lizenzdialog Ihre Lizenzdatei direkt aus.<br />
# Sie werden aufgefordert, expecco neu zu starten. Nach dem Neustart können Sie expecco nutzen.<br />
<br />
Lizenzdateien ohne Dongle sind zeitlich beschränkt. <br />
Wenn Sie versehentlich den expecco-Dongle nicht in Ihren Rechner eingesteckt haben und expecco starten, erhalten Sie einen Hinweis, dass die Lizenz abgelaufen sei. <br />
Sobald Sie den Dongle einstecken, erscheint dieser Hinweis beim Start von expecco nicht mehr.<br />
<br />
Solange sie mit expecco arbeiten, wird überwacht, ob der Dongle vorhanden ist. <br />
Wenn Sie den Dongle während dessen aus ihrem Rechner entfernen, erhalten Sie einen Hinweis und können keine Tests mehr ausführen oder verändern. <br />
Sie können allerdings die gerade bearbeitete Testsuite noch abspeichern, so dass keine Änderungen verloren gehen.<br />
<br />
=== Konfiguration der Floating-Lizenz ===<br />
<br />
Um eine Floating-Lizenz zu nutzen, benötigen Sie einen expecco-Lizenzserver. <br />
Der Lizenzserver ist unter einem Rechnername bzw. IP-Adresse und einer Portnummer zu erreichen. <br />
Der Administrator des Lizenzservers kann Ihnen diese Informationen geben, falls er eine andere als die default-Portnummer konfiuriert hat. <br />
Es muss sichergestellt sein, dass eine TCP-Verbindung zum entsprechenen Port im Lizenzserver aufgebaut werden kann. <br />
Router und Firewalls sind entsprechen zu konfigurieren bzw. Ports freizuschalten.<br />
<br />
Beim Start von expecco öffnet sich der Lizenzdialog. <br />
Wählen Sie hier die Lizenzserver-Kachel aus. <br />
Tragen Sie den Rechnernamen bzw. die IP-Adresse sowie die Portnummer des Lizenservers ein. <br />
Im allgemeinen kann die vorgeschlagene default Portnummer unverändert übernommen werden.<br />
Lediglich in Netzwerken, bei denen nur bestimmte Ports durch Firewalls oder Router durchgeschaltet werden ist es u.U. notwendig, eine andere Portnummer zu verwenden.<br />
Der Administrator des Lizenzservers kann Ihnen in diesem Fall diese Informationen geben<br />
<br />
Sie können jetzt auswählen, welche expecco-Ausprägung Sie verwenden wollen: ''expecco-developer'' oder ''expecco-runtime''. <br />
Über die Schaltfläche ''Plugin-Liste vom Server aktualisieren'' erhalten Sie die verfügbaren Plugins (bzw. Plugins für die noch floating Lizenzen verfügbar sind). <br />
Wählen Sie die Plugins aus, die Sie für ihre Tests benötigen. <br />
Von den meisten Plugins benötigen Sie nur eine Lizenz. <br />
Einzelne Plugins können für auf mehrere Rechner verteilte Tests mehr als eine Lizenz von einem Plugin benötigen - Sie können das für derartige Plugins angeben. <br />
Im Dialog wird angezeigt, wieviele Lizenzen für ein bestimmtes Plugin auf dem Lizenzserver momentan noch zur Verfügung stehen. <br />
Per Tooltip können Sie auch in Erfahrung bringen, wie viele Lizenzen generell vorhanden sind. <br />
Die Differenz sind die momentan von anderen Benutzern verwendeten Lizenzen.<br />
<br />
Über die Schaltfläche ''Lizenzdatei installieren'' werden die Lizenzen vom Lizenzserver abonniert. <br />
Starten Sie jetzt expecco neu, damit die lizenzierten Plugins geladen werden.<br />
<br />
Wenn expecco beendet wird, werden alle Lizenzen wieder an den Lizenzserver zurück gegeben. <br />
Expecco erneuert regelmäßig die Lizenzen vom Lizenzserver. <br />
Wenn der Lizenzserver über einen gewissen Zeitraum nicht mehr erreichbar sein sollte (ca. 15 Minuten), wird expecco gesperrt, so dass keine Tests mehr ausgeführt oder verändert werden können. Geänderte Testsuiten können aber noch abgespeichert werden.<br />
<br />
Wenn expecco nicht regulär beendet wurde, z.B. wenn der Rechner einfach ausgeschaltet wird, fallen die Lizenzen nach diesem Zeitraum an den Lizenzserver zurück und können dann von anderen Benutzern genutzt werden. <br />
<br />
expecco merkt sich, welche Lizenzen zuletzt abonniert wurden. <br />
Wenn expecco gestartet wird, versucht es, die zuletzt abonnierten Lizenzen wieder zu erhalten. <br />
Sollte das nicht möglich sein, da alle Lizenzen momentan vergeben sind, erscheint der Lizenzdialog, in dem die nicht oder nur teilweise erhaltenen Lizenzen rot unterlegt sind.<br />
<br />
Wenn Sie neue Lizenzen benötigen oder bisher verwendete Lizenzen nicht mehr benötigen, <br />
können Sie die anzufordernden Lizenzen jederzeit über den Lizenzdialog anpassen. <br />
Sie erreichen ihn über das Menu ''Extras -> Einstellungen -> Lizenzinstallation''.<br />
<br />
=== Update Installation von expecco unter Windows ===<br />
<br />
Wie bei der Erstinstallation erhalten eine Email mit dem Link zu den neuen expecco-Installationsdateien.<br />
Bitte laden Sie die Installationsprogramme herunter. <br />
Bei der Ausführung des Basis-Installationsprogramms ''expeccoSetup-***.exe'' erkennt expecco, dass es bereits installiert ist, und zeigt einen Dialog an, in dem Sie um eine Bestätigung gebeten werden, dass die alte expecco-Version deinstalliert werden darf. <br />
Bestätigen Sie bitte diesen Dialog. Die alte expecco-Version wird mit allen Plugins deinstalliert. <br />
Ihre Einstellungen, Lizenzdateien und Ihre Testsuiten bleiben erhalten. <br />
Anschließend wir die neue expecco-Version wie bei der Erstinstallation (s.o.) installiert. <br />
Installieren Sie ggfs. die Plugins über die neue Installationsdate ''expeccoPluginSetup-***.exe''.<br />
<br />
== Installation unter Linux ==<br />
<br />
=== Benötigte Linux Sofwarepakete ===<br />
<br />
expecco läuft sowohl auf 32- als auch auf 64-bit Linux Systemen. Es ist als 32-bit-Programm übersetzt, und benötigt daher auch auf amd64/x86-64 - Installationen die Bibliotheken in der 32-bit Version. Es wird eine glibc in der Version >= 2.9 benötigt.<br />
<br />
Installieren Sie über Ihren Paketmanager Ihrer Linux-Distribution folgende Pakete (alle als 32-bit-Pakete):<br />
<br />
* libXinerama<br />
* libXft<br />
* libusb <br />
* unixODBC<br />
<br />
Diese Pakete hängen von weiteren Paketen ab, die der Paketmanager automatisch mit installiert.<br />
<br />
=== Installation von expecco unter linux ===<br />
<br />
Sie erhalten eine Email mit dem Link zu der expecco-Installationsdatei. Die Installationsdatei hat den Namen:<br />
<br />
* expecco-2.7.0.22.x86.package<br />
<br />
wobei hier 2.7.0 der Versionsnummer von expecco entspricht und 22 der Build-Nummer. Die Installationsdatei enthält das expecco-Basispaket sowie die Plugins.<br />
<br />
Für die Installation benötigen Sie bei einer erstmaligen Installation außerdem noch das ''autopackage'' Paket. Sie können es hier herunterladen: http://download.exept.de/transfer/autopackage/autopackage.tar.bz2<br />
<br />
Laden Sie die expecco-Installationsdatei und ggfs. ''autopackage.tar.bz2'' in dasselbe Verzeichnis auf ihrem Rechner. <br />
<br />
Sie können die Installation als Benutzer ''root'' oder als normaler Benutzer ausführen. Wenn Sie expecco als Benutzer ''root'' installieren, wird expecco im Verzeichnis ''/opt/expecco/bin'' installiert. Bei einer Installation als normaler Benutzer, wird expecco in ihrem Home-Verzeichnis nach ''.local/bin'' installiert.<br />
<br />
Führen Sie aus:<br />
<br />
sh expecco-2.7.0.22.x86.package<br />
<br />
expecco wird daraufhin installiert, es erscheint folgende Ausgabe:<br />
<br />
<br />
# Preparing package: expecco - Graphical Test Modeling <br />
# Checking for required C library versions ... passed<br />
This may take a moment, please wait ... done<br />
# Installing package: expecco - Graphical Test Modeling (package 1 of 1) <br />
# 100%[==================================================] Extracting<br />
# Copying files to /opt/expecco/plugin<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/packages/exept/technologyBridge<br />
# Copying files to /opt/expecco/packages/exept/technologyBridge/javaBridge<br />
# Copying files to /opt/expecco/packages/exept/technologyBridge/javaBridge/javaBridge_Server_Client<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/packages/stx/libsnmp<br />
# Copying files to /opt/expecco/packages/stx/libsnmp/net-snmp-5.7.2/mibs<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/testsuites/libraries<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/bin<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/lib<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/packages/exept/expecco/doc<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/testsuites/libraries<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/testsuites/examples<br />
# 100%[==================================================] Copying<br />
# Copying files to /opt/expecco/packages/exept/expecco/reportGenerator/tools<br />
# Copying files to /opt/expecco/packages/exept/pdf/afm<br />
# 100%[==================================================] Copying<br />
# Installing USB Dongle access...<br />
# Updating package database...<br />
The following package was successfully installed:<br />
* expecco - Graphical Test Modeling<br />
This installation used 478.74 MiB (502.00 MB) of disk space.<br />
Remove this package by running package remove expecco from the command line.<br />
<br />
=== Spezielle Installations-Optionen ===<br />
<br />
Sie können das Verzeichnis, in das expecco installiert wird, wie folgt festlegen:<br />
<br />
sh expecco-2.7.0.22.x86.package<br />
Installation als root nach /opt/expecco (Starten mit: /opt/expecco/bin/expecco)<br />
<br />
sh expecco-2.7.0.22.x86.package --prefix /opt/expecco-1.7<br />
Installation als root nach /opt/expecco-1.7 (Starten mit: /opt/expecco-1.7/bin/expecco)<br />
<br />
sh expecco-2.7.0.22.x86.package --local-only<br />
Installation als Benutzer nach $HOME/.local (Starten mit ~/.local/bin/expecco)<br />
<br />
sh expecco-2.7.0.22.x86.package --local-only --prefix ~/expecco<br />
Installation als Benutzer nach $HOME/expecco (Starten mit ~/expecco/bin/expecco)<br />
<br />
=== Konfiguration der Lizenz ===<br />
<br />
Beim erstmaligen Ausführen, erscheint ein Fenster, in dem eine Lizenz verlangt wird. Je nachdem, ob Sie eine Einzellizenz oder eine Floating-Lizenz (per Lizenzserver) nutzen, können Sie die Lizenz konfigurieren. <br />
<br />
[[#Konfiguration der Einzellizenz | Konfiguration der Einzellizenz]] (wie oben beschrieben)<br />
<br />
[[#Konfiguration der Floating-Lizenz | Konfiguration der Floating-Lizenz]] (wie oben beschrieben)<br />
<br />
=== Update Installation von expecco unter Linux ===<br />
<br />
Wie bei der Erstinstallation erhalten eine Email mit dem Link zu der neuen expecco-Installationsdatei.<br />
Bitte laden Sie das Installationsprogramme herunter. Bei der Ausführung des Installationsprogramms ''sh expecco-***.x86.package'' erkennt expecco, dass eine andere Version bereits installiert wurde. Die alte expecco-Version wird mit allen Plugins automatisch deinstalliert. Ihre Einstellungen, Lizenzdateien und Ihre Testsuiten bleiben erhalten. Anschließend wir die neue expecco-Version wie bei der Erstinstallation (s.o.) installiert.<br />
<br />
=== Zusätzlich symbolische Links ===<br />
<br />
Auf einigen Systemen werden zusätzliche Symbolische Links benötigt:<br />
<br />
libodbc.so.1 & libodbcinst.so.1:<br />
<br />
z.B unter Ubuntu im Verzeichnis /usr/lib/i386-linux-gnu<br />
<br />
Dort können die Links wie folgt angelegt werden:<br />
<br />
sudo ln -s libodbc.so.1 libodbc.so.2<br />
sudo ln -s libodbcinst.so.1 libodbcinst.so.2 /usr/lib/i386-linux-gnu</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=DOT_NET_Interface_Library/en&diff=4492DOT NET Interface Library/en2014-12-09T15:45:50Z<p>Mb: </p>
<hr />
<div>== Overview ==<br />
<br />
The .NET Interface Library (".NET Bridge") contains a mechanism to access Microsoft .NET (CLR) objects of a local or remote .NET application (a so-called .NET bridge), and an API for elementary blocks and a library of blocks to interact with these objects.<br />
<br />
== Programmatic Interface ==<br />
<br />
Access to .NET objects, classes and programs is done via a framework called "dotNET-Bridge". This framework implements transparent forwarding of expecco messages (virtual function calls) from either Smalltalk or JavaScript code to .NET objects as existent in a local or remote .NET virtual machine. Also, return values, callBacks and exception information are passed back from the .NET program to expecco. A proxy-object mechanism which catches all function calls, wraps the arguments and sends a datagram to the other bridge side is used for this to be almost completely transparent to the Smalltalk/JavaScript code inside expecco.<br />
<br />
In addition to existing blocks of the .NET Interface Library, programmatic access to dotNET objects is sometimes useful or required. So the following information is useful if you want to write your own elementary .NET-blocks, or if you have to enhance the existing library by adding application-specific interface blocks.<br />
<br />
=== Initializing / Releasing the Bridge ===<br />
<br />
Before any communication can take place between expecco and any dotNet object, the .NET side of the bridge has to be started, and a communication path to be setup.<br />
All of the bridges classes are in the <CODE>DOTNET</CODE> namespace; the main interface class is <CODE>DotNet</CODE>, in this namespace:<br />
<br />
<CODE><PRE><br />
dotNetHandle := DOTNET::DotNet startNew.<br />
</PRE></CODE><br />
or (in JavaScript):<br />
<CODE><PRE><br />
dotNetHandle = DOTNET::DotNet.startNew();<br />
</PRE></CODE><br />
<br />
This starts the .NET-side of the bridge (the executable named "DotNetBridge.Server.exe"),<br />
and waits for a connection request from this program.<br />
<br />
When finished, release the bridge with:<br />
<CODE><PRE><br />
dotNetHandle.exitDotNet();<br />
</PRE></CODE><br />
which shuts down the connection and terminates the executable.<br />
<br />
=== Loading Assemblies ===<br />
Using the "loadLibrary"-function, wellknown assemblies can be loaded:<br />
<CODE><PRE><br />
dotNetHandle.loadLibrary("System.Windows.Forms");<br />
</PRE></CODE><br />
or:<br />
<CODE><PRE><br />
dotNetHandle.loadLibrary("user32.dll");<br />
</PRE></CODE><br />
<br />
Arbitrary files which contain assemblies are loaded with:<br />
<CODE><PRE><br />
dotNetHandle.loadFile(pathToDLL);<br />
</PRE></CODE><br />
<br />
=== Accessing Globals ===<br />
<br />
Globals, nameSpaces and members of a namespace are accessed using message sends to the dotNet handle, where the message name is the name of the global, namespace or interface.<br />
These messages can be chained, to access a hierarchy of namespaces.<br />
For example:<br />
<CODE><PRE><br />
dotNetHandle.System.Reflection.Assembly.LoadFile("c:\foo\bar\myAssembly.dll");<br />
</PRE></CODE><br />
<br />
=== Instantiating a Class ===<br />
<br />
Object instances are created via the "new"-message, sent to a global:<br />
<CODE><PRE><br />
b = dotNetHandle.Button.new();<br />
f = dotNetHandle.Form.new();<br />
</PRE></CODE><br />
once instanciated, any message can be sent transparently to such an .NET object, as if it was an expecco object:<br />
<CODE><PRE><br />
b.text("Hello World");<br />
f.controls.add(b);<br />
f.showDialog();<br />
</PRE></CODE><br />
<br />
=== Callbacks ===<br />
<br />
Callbacks from .NET back into expecco are implemented via Smalltalk blocks (JavaScript anonymous functions).<br />
The bridge automatically installs an appropriate callback, whenever a block/function is given to a .NET component as a callback or hook.<br />
<br />
Here is a complete example for creating a .NET form with a callback into expecco. This code could be put into an EB (Elementary Block) of an expecco activity diagram:<br />
<CODE><PRE><br />
var dotNet, form, button;<br />
<br />
// called when the .NET button is clicked<br />
function callBack() { <br />
dotNet.MessageBox.show("Hello from expecco"); <br />
};<br />
<br />
dotNet = DOTNET::DotNet.startNew();<br />
dotNet.loadLibrary("System.Windows.Forms");<br />
<br />
button = dotNet.Button.new();<br />
button.text("Hello");<br />
button.click.add( callBack );<br />
<br />
form = dotNet.Form.new();<br />
button.dock( dotNet.DockStyle.fill );<br />
form.controls.add( button );<br />
<br />
form.showDialog();<br />
<br />
dotNet.exitDotNet();<br />
</PRE></CODE><br />
<br />
=== Calling ActiveX/COM Objects===<br />
<br />
It's possible to make calls to ActiveX/COM Objects through the bridge.<br />
<br />
To do this, you need to create a dotNet Assembly with the types from a .tlb or .ocx file.<br />
<br />
This can be done with the tlbimp utility which is part of VisualStudio (reachable through the VS Dev CMD Shell...)<br />
<br />
In this shell, you can e.g. execute<br />
<br />
tlbimp c:\windows\system32\wshom.ocx <br />
<br />
which will create a file called IWshRuntimeLibrary.dll for the Windows Script Host Runtime Library in the current directory. This can then be used to automate the Windows Script Host Runtime Library Object.<br />
<br />
Here an example howto use this in code:<br />
<br />
<CODE><PRE><br />
<br />
|dotNet shell buttonPressed|<br />
<br />
dotNet := DotNet singletonInstance.<br />
dotNet loadFile:'C:\Temp\IWshRuntimeLibrary.dll'.<br />
shell := dotNet WshShellClass new.<br />
buttonPressed := shell popup:'Hello from Micha' secToWait:15 title:'.NET Bridge Com Demo' type:0.<br />
buttonPressed inspect <br />
<br />
<br />
</PRE></CODE><br />
<br />
<br />
to be continued<br />
<br />
== See Also==<br />
The [[Java Interface Library| Java Interface Plugin & Library]], which implements a likewise interface for Java applications/libraries.<br />
<br />
<hr><br />
Back to [[Plugins]]<br><br />
Back to [[OnlineDocumentation#Library and Plugin Overview|Online Documentation]].</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Themensammlung&diff=4286Themensammlung2014-10-08T14:59:16Z<p>Mb: </p>
<hr />
<div><br />
= Expecco =<br />
<br />
== General ==<br />
<br />
* [[ expecco Overview | Overview]] -- Empty!<br />
* [[ expecco Overview/en | Overview/en ]] -- empty!<br />
* [[ Release Notes expecco]]<br />
* [[ Release Notes expecco/en ]]<br />
* [[ Installation ]] - initial installation, license files, patches<br />
* [[ Installation/en ]] - initial installation, license files, patches<br />
* [[ Configuration & Setup ]] - jre/jdk setup, pathes<br />
* [[ Configuration & Setup/en ]] - jre/jdk setup, pathes<br />
* [[ Personal Settings ]] - editor settings<br />
* [[ Personal Settings/en ]] - editor settings<br />
* [[ Report Generation ]]<br />
* [[ Report Generation/en ]]<br />
* [[ Concepts]] - concepts; testplan, testcase, activities, verdicts<br />
* [[ Concepts/en]] - concepts; testplan, testcase, activities, verdicts<br />
* [[ Command Line Options ]]<br />
* [[ Command Line Options/en ]]<br />
* [[ Glossary ]]<br />
* [[ Glossary/en ]]<br />
<br />
== expecco UI ==<br />
<br />
* [[ Menu ]]<br />
* [[ Menu/en ]]<br />
* [[ Toolbar ]]<br />
* [[ Toolbar/en ]]<br />
* [[ Navigation Tree ]]<br />
* [[ Navigation Tree/en ]]<br />
* [[ Settings ]]<br />
* [[ Settings/en ]]<br />
* [[ Testsuite Browser ]]<br />
* [[ Testsuite Browser/en ]]<br />
<br />
== Editors ==<br />
<br />
Achtung - Namen wurden in expecco geändert:<br />
Alle Namen wie 'XXXDescriptionEditor' und 'XXXEditor' werden nun zu 'XXX_Editor' (immer Unterstrich, niemals Description)<br />
<br />
* [[ Scheme Editor ]] ab<br />
* [[ Scheme Editor/en ]]<br />
* [[ Documentation Editor ]] sv<br />
* [[ Documentation Editor/en ]]<br />
* [[ History Editor ]] sv<br />
* [[ History Editor/en ]]<br />
* [[ BlockFunctionalityTestEditor ]] ca<br />
* [[ BlockFunctionalityTestEditor/en ]]<br />
* [[ BlockFunctionalityRunner ]] ca<br />
* [[ BlockFunctionalityRunner/en ]]<br />
* [[ BlockSkill Editor ]] ab<br />
* [[ BlockSkill Editor/en ]]<br />
<br />
* [[ ElementaryBlock Editor-Code Editor ]] cg<br />
* [[ ElementaryBlock Editor-Code Editor/en ]]<br />
<br />
* [[ KeywordBlock Editor-KeywordActionList Editor ]] ab<br />
* [[ KeywordBlock Editor-KeywordActionList Editor/en ]]<br />
<br />
* [[ CompoundBlock Editor-CompoundWorksheet Editor ]] ab<br />
* [[ CompoundBlock Editor-CompoundWorksheet Editor/en ]]<br />
* [[ CompoundBlock Editor-Environment Editor ]] ca<br />
* [[ CompoundBlock Editor-Environment Editor/en ]]<br />
<br />
* [[ TestDataGeneratorBlock Editor-TestData Editor ]] cg<br />
* [[ TestDataGeneratorBlock Editor-TestData Editor/en ]]<br />
<br />
* [[ TableDrivenBlock Editor-TableDrivenActionList Editor ]]<br />
* [[ TableDrivenBlock Editor-TableDrivenActionList Editor/en ]]<br />
<br />
* [[ Testplan Editor-TestplanEnvironment Editor ]] ca<br />
* [[ Testplan Editor-TestplanEnvironment Editor/en ]]<br />
* [[ Testplan Editor-TestplanListView Editor ]] ca<br />
* [[ Testplan Editor-TestplanListView Editor/en ]]<br />
* [[ Testplan Editor-ReportParameter Editor ]] ab<br />
* [[ Testplan Editor-ReportParameter Editor/en ]]<br />
<br />
* [[ Testsuite Editor-Environment Editor ]] ca<br />
* [[ Testsuite Editor-Environment Editor/en ]]<br />
* [[ Testsuite Editor-ExecutionSettings Editor ]] sv<br />
* [[ Testsuite Editor-ExecutionSettings Editor/en ]]<br />
* [[ Testsuite Editor-ReportParameter Editor ]] sv<br />
* [[ Testsuite Editor-ReportParameter Editor/en ]]<br />
* [[ Testsuite Editor-Metadata Editor ]] sv<br />
* [[ Testsuite Editor-Metadata Editor/en ]]<br />
* [[ Testsuite Editor-StatisticData Editor ]] sv<br />
* [[ Testsuite Editor-StatisticData Editor/en ]]<br />
<br />
* [[ TestsuiteHistory Editor ]] sv<br />
* [[ TestsuiteHistory Editor/en ]]<br />
<br />
* [[ Datatype Editor ]] cg<br />
* [[ Datatype Editor/en ]]<br />
<br />
* [[ Inventory Editor ]] ab<br />
* [[ Inventory Editor/en ]]<br />
<br />
* [[ ReportParameter Editor]]<br />
* [[ ReportParameter Editor/en]]<br />
<br />
* [[ Resource Editor ]] ab<br />
* [[ Resource Editor/en ]]<br />
<br />
* [[ Skill Editor ]] ab -- Achtung: nur in Deutsch<br />
* [[ Skill Editor/en ]] -- Attention:only in German<br />
<br />
* [[ CategoryContainer Editor ]] sv<br />
* [[ CategoryContainer Editor/en ]]<br />
<br />
* [[ Documentation Editor ]] sv<br />
* [[ Documentation Editor/en ]]<br />
<br />
* [[ FileAttachment Editor ]] cg<br />
* [[ FileAttachment Editor/en ]]<br />
<br />
* [[ URLAttachment Editor ]] cg<br />
* [[ URLAttachment Editor/en ]]<br />
<br />
* [[ ReportTemplateAttachment Editor ]] ab<br />
* [[ ReportTemplateAttachment Editor/en ]]<br />
<br />
* [[ GUI Editor-GUICode Editor ]] cg<br />
* [[ GUI Editor-GUICode Editor/en ]]<br />
<br />
==Tree-Elements==<br />
<br />
* [[ Tree Elements ]] ab<br />
* [[ Tree Elements/en ]]<br />
<br />
* [[ Datatype Element ]] cg<br />
* [[ Datatype Element/en ]]<br />
* [[ Testplan Element ]] ca<br />
* [[ Testplan Element/en ]]<br />
* [[ ElementaryBlock Element ]] cg<br />
* [[ ElementaryBlock Element/en ]]<br />
* [[ CompoundBlock Element ]] ab<br />
* [[ CompoundBlock Element/en ]]<br />
* [[ Inventory Element ]] ab -- Achtung: nur in Deutsch<br />
* [[ Inventory Element/en ]] -- Attention: only in German<br />
* [[ Skill Element ]] ab -- Achtung: nur in Deutsch<br />
* [[ Skill Element/en ]] -- Attention: only in German<br />
* [[ Resource Element ]] ab -- Achtung: nur in Deutsch<br />
* [[ Resource Element/en ]] -- Attention: only in German<br />
* [[ Attachment Element ]] cg<br />
* [[ Attachment Element/en ]]<br />
* [[ ReportTemplate Element ]] ab<br />
* [[ ReportTemplate Element/en ]]<br />
* [[ KeywordBlock Element ]] ab<br />
* [[ KeywordBlock Element/en ]]<br />
* [[ TestDataGeneratorBlock Element ]] cg<br />
* [[ TestDataGeneratorBlock Element/en ]]<br />
* [[ VirtualBlock Element ]] sv<br />
* [[ VirtualBlock Element/en ]]<br />
* [[ UnimplementedBlock Element ]] sv<br />
* [[ UnimplementedBlock Element/en ]]<br />
* [[ GUIBlock Element ]] cg<br />
* [[ GUIBlock Element/en ]]<br />
* [[ Block Element ]] sv<br />
* [[ Block Element/en ]]<br />
* [[ Folder Element ]] sv<br />
* [[ Folder Element/en ]]<br />
<br />
==Diagram-Elements==<br />
<br />
Achtung: DiagramElements-XXXPin gehen nun alle nach DiagramElements-Pin#typeofPin. Also z.B. DiagramElements-Pin#Enable_Output_pin.<br />
entsprechende hash-tags müssen in DiagramElements-Pin erhalten bleiben.<br />
<br />
* [[ DiagramElements-Pin ]]<br />
* [[ DiagramElements-Pin/en ]]<br />
<br />
* [[ DiagramElements-Pin#Enable Input Pin ]]<br />
* [[ DiagramElements-Pin#Cancel Input Pin ]]<br />
* [[ DiagramElements-Pin#Iterate Input Pin ]]<br />
* [[ DiagramElements-Pin#Timelimit Input Pin ]]<br />
* [[ DiagramElements-Pin#Performer Input Pin ]]<br />
* [[ DiagramElements-Pin#Input Pin ]]<br />
* [[ DiagramElements-Pin#Exception Output Pin ]]<br />
* [[ DiagramElements-Pin#Enable Output Pin ]]<br />
* [[ DiagramElements-Pin#ExecutionTime Output Pin ]]<br />
* [[ DiagramElements-Pin#Output Pin ]]<br />
<br />
* [[ DiagramElements-Step ]]<br />
* [[ DiagramElements-Step/en ]]<br />
* [[ DiagramElements-AttachmentStep ]]<br />
* [[ DiagramElements-AttachmentStep/en ]]<br />
* [[ DiagramElements-Connection ]]<br />
* [[ DiagramElements-Connection/en ]]<br />
* [[ DiagramElements-PinDescription ]]<br />
* [[ DiagramElements-PinDescription/en ]]<br />
* [[ DiagramElements-Annotation ]] -- Achtung: nur auf Deutsch<br />
* [[ DiagramElements-Annotation/en ]] -- Attention: only in German<br />
* [[ DiagramElements-Probe ]]<br />
* [[ DiagramElements-Probe/en ]]<br />
<br />
== Plugins and Extensions ==<br />
<br />
=== UI Testing ===<br />
<br />
* [[ Selenium Web Test Plugin ]] -- Web Page Tests and Interaction<br />
* [[ Selenium Web Test Plugin/en ]]<br />
* [[ SeleniumLibrary Reference ]] -- Library reference<br />
<br />
* [[ AndroidLibrary Reference ]] -- Anroid UI Test and Interaction<br />
<br />
=== Code Execution ===<br />
<br />
* [[ Java Browser ]] -- allows for Java classes to be browsed in the SUT<br />
* [[ Java Browser/en ]]<br />
* [[ Java Debugger ]] -- allows to debug Groovy blocks and other code executed by Java Bridge in (remote) JVM<br />
* [[ Java Debugger/en ]]<br />
* [[ SmallSense ]] -- together with [[ Java Browser/en ]] provides basic completion support for Groovy code. <br />
* [[ SmallSense/en ]]<br />
<br />
<br />
* [[ Groovy Code Execution Plugin/en ]] -- allows for Groovy code to be executed on the SUT<br />
* [[ VBScript | VisualBasic Script Plugin/en ]]<br />
<br />
=== Manual Test Support Plugins ===<br />
<br />
* [[ Manual Test Plugin ]] -- guides users through manual tests<br />
* [[ Manual Test Import Plugin ]] -- imports test specifications written in Word or Excel<br />
<br />
=== Misc Plugins ===<br />
<br />
* [[ GembirdPowerControlPlugin Reference ]] -- control a power plug<br />
<br />
=== QM Interface Plugins ===<br />
<br />
* [[ PolarionPlugin Reference ]] - automate execution from & interact with Polarion<br />
* [[ ExpeccoNET Plugin Reference ]] - automate execution from & interact with expeccoNET<br />
* [[ HP Quality Center Plugin Reference ]] - automate execution from and interact with HP Quality Center<br />
<br />
* [[ WSDL Service Import Plugin ]] -- import service actions from a WSDL service description<br />
<br />
== Concepts, Hints, Tips and Tricks ==<br />
<br />
* [[ Expecco API ]]<br />
* [[ Expecco API/en ]]<br />
* [[ Executor]]<br />
* [[ Executor#Activity]]<br />
<br />
* [[ Generating Test Data ]]<br />
* [[ Parametrizing Tests ]]<br />
* [[ Organizing Libraries ]]<br />
* [[ Reimporting a Library]]<br />
* [[ User Defined Menu Items ]]<br />
* [[ Uses of Tags ]]<br />
<br />
== Tutorials ==<br />
<br />
* [[Testing Java Applications using Groovy blocks]]<br />
* [[Testing Java Applications using Groovy blocks/en]]<br />
= ExpeccoNet =<br />
<br />
== ExpeccoNET General ==<br />
<br />
* [[ expeccoNET Overview | Overview]]<br />
* [[ expeccoNET Overview/en | Overview/en ]]<br />
* [[ expeccoNET Release Notes | Release Notes]]<br />
* [[ expeccoNET Release Notes/en | Release Notes/en ]]<br />
* [[ expeccoNET Installation | Installation ]] - initial installation, license files, patches<br />
* [[ expeccoNET Installation/en | Installation/en ]] - initial installation, license files, patches<br />
* [[ expeccoNET Configuration & Setup | Configuration & Setup ]] - setting up users, roles and projects<br />
* [[ expeccoNET Configuration & Setup/en | Configuration & Setup/en ]] - setting up users, roles and projects<br />
* [[ expeccoNET Personal Settings | Personal Settings ]] - editor settings<br />
* [[ expeccoNET Personal Settings/en | Personal Settings/en ]] - editor settings<br />
* [[ expeccoNET Concepts |Concepts ]] - concepts; testsuite, testdefinition, testschedule, testrun, testequipment<br />
* [[ expeccoNET Concepts/en | Concepts/en ]] - concepts; testsuite, testdefinition, testschedule, testrun, testequipment<br />
* [[ expeccoNET Glossary | Glossary ]]<br />
* [[ expeccoNET Glossary/en | Glossary/en ]]<br />
<br />
== expeccoNET UI ==<br />
<br />
* [[ expeccoNET Master Menu | Master Menu]]<br />
* [[ expeccoNET Master Menu/en | Master Menu/en ]]<br />
* [[ expeccoNET Requirements UI | Requirements UI ]]<br />
* [[ expeccoNET Requirements UI/en | Requirements UI/en ]]<br />
* [[ expeccoNET Defects UI | Defects UI]]<br />
* [[ expeccoNET Defects UI/en | Defects UI/en ]]<br />
* [[ expeccoNET Actions UI | Actions UI ]]<br />
* [[ expeccoNET Actions UI/en |Actions UI/en ]]<br />
* [[ expeccoNET Tests UI | Tests UI ]]<br />
* [[ expeccoNET Tests UI/en | Tests UI/en ]]<br />
* [[ expeccoNET Projects UI | Projects UI ]]<br />
* [[ expeccoNET Projects UI/en | Projects UI/en ]]<br />
* [[ expeccoNET Organization UI | Organization UI ]]<br />
* [[ expeccoNET Organization UI/en | Organization UI/en ]]<br />
* [[ expeccoNET Settings UI | Settings UI ]]<br />
* [[ expeccoNET Settings UI/en | Settings UI/en ]]<br />
<br />
<br />
= License Server =<br />
<br />
== License Server General ==<br />
<br />
* [[ License Server Overview | Overview]] -- Achtung: nur in Deutsch <br />
* [[ License Server Overview/en | Overview/en ]] -- Attention: only in German<br />
* [[ License Server Release Notes | Release Notes]]<br />
* [[ License Server Release Notes/en | Release Notes/en ]] -- Attention: only in German<br />
* [[ License Server Installation | Installation]] - initial installation, license files, updates -- Achtung: nur in Deutsch<br />
* [[ License Server Installation/en | Installation/en ]] - initial installation, license files, updates -- Attention: only in German<br />
* [[ License Server Configuration & Setup | Configuration & Setup ]] - setting up ports and users -- Achtung: nur in Deutsch<br />
* [[ License Server Configuration & Setup/en | Configuration & Setup/en ]] - setting up ports and users -- Attention: only in German<br />
* [[ License Server Glossary | Glossary]] -- Achtung: nur in Englisch<br />
* [[ License Server Glossary/en | Glossary/en]] -- Achtung: nur in English<br />
<br />
== License Server UI ==<br />
<br />
* [[ License Server License Menu | License Menu ]]<br />
* [[ License Server License Menu/en | License Menu/en]]</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Datei:Pultdach_cam03_gros.jpg&diff=4064Datei:Pultdach cam03 gros.jpg2014-08-22T08:00:33Z<p>Mb: </p>
<hr />
<div></div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Installation&diff=4054Installation2014-06-27T13:51:48Z<p>Mb: </p>
<hr />
<div>== Installation von expecco unter Windows ==<br />
<br />
Sie erhalten eine Email mit dem Link zu den expecco-Installationsdateien. Die Installationsdateien haben die Namen<br />
<br />
* expeccoSetup-2.7.0.22.exe -> für die expecco-Basisinstallation<br />
* expeccoPluginSetup-27.0.22.exe -> für optionale Plugins.<br />
<br />
wobei hier 2.7.0 der Versionsnummer von expecco entspricht und 22 der Build-Nummer. Die Installationsdatei für dir Plugins benötigen Sie nur dann, wenn Sie optionale Plugins gekauft haben. Die Versionsnummer von ''expeccoSetup'' und ''expeccoPluginSetup'' muss gleich sein. <br />
<br />
Bitte laden Sie die Installationsprogramme auf Ihren Rechner.<br />
Führen Sie zuerst das Installationsprogramm für die expecco-Basisinstallation aus (''expeccoSetup-***.exe''). Folgen Sie dabei dem Installationsassistenten. Sie können hier das Laufwerk und das Verzeichnis angeben, unter dem expecco installiert werden soll. Ausserdem können Sie die Komponenten angeben, die sie installieren wollen.<br />
<br />
Falls Sie Plugins für expecco gekauft haben, führen sie jetzt das Installationsprogramm für die expecco-Plugins aus (''expeccoPluginSetup-***.exe''). Im Installationsassistenten können Sie die von Ihnen gekauften Plugins auswählen. Es werden Ihnen mehr Plugins angeboten, als Sie lizenziert haben. Falls Sie nicht lizenzierte Plugins installieren, so ist das kein Problem. Installierte, aber nicht lizenzierte Plugins sind erst dann verfügbar, wenn die dazu passenden Lizenzen (nach-)installiert wurden. Ansonsten belegen Sie nur Platz auf der Festplatte. Weitere Plugins können auch jederzeit nachträglich installiert werden.<br />
<br />
Nach der Installation finden Sie auf Ihrem Desktop das expecco-Symbol. Über dieses Symbol können Sie expecco nun starten.<br />
Beim erstmaligen Ausführen, erscheint ein Fenster, in dem eine Lizenz verlangt wird. Je nachdem, ob Sie eine Einzellizenz oder eine Floating-Lizenz (per Lizenzserver) nutzen, können Sie die Lizenz konfigurieren.<br />
<br />
=== Konfiguration der Einzellizenz ===<br />
<br />
Einzellizenzen werden üblicherweise mit einem USB-Dongle genutzt. Ausnahmsweise können Einzellizenzen auch für einen beschränkten Zeitraum auch ohne Dongle verwendet werden. In beiden Fällen erhalten Sie eine Lizenzdatei. Lizenzdateien und Dongle müssen jeweils zusammenpassen, wobei eine Lizenzdatei auch zu mehreren Dongles desselben Kunden passen kann.<br />
<br />
# falls Sie einen Dongle erhalten haben, stecken Sie ihn in einen freien USB-Port in ihrem Rechner.<br />
# speichern Sie die Lizenzdatei auf ihrem Rechner<br />
# ziehen Sie entweder die Datei mit der Maus aus dem Windows-Explorer in den Lizenzdialog; oder Sie wählen im Lizenzdialog Ihre Lizenzdatei direkt aus.<br />
# Sie werden aufgefordert, expecco neu zu starten. Sie können jetzt expecco nutzen.<br />
<br />
Lizenzdateien ohne Dongle sind zeitlich beschränkt. Wenn Sie versehentlich den expecco-Dongle nicht in Ihren Rechner eingesteckt haben und expecco starten, erhalten Sie einen Hinweis, dass die Lizenz abgelaufen sei. Sobald Sie den Dongle einstecken, erscheint dieser Hinweis beim Start von expecco nicht mehr.<br />
<br />
Solange sie mit expecco arbeiten, wird überwacht, ob der Dongle vorhanden ist. Wenn Sie den Dongle während dessen aus ihrem Rechner entfernen, erhalten Sie einen Hinweis und können keine Tests mehr ausführen oder verändern. Sie können allerdings ihre Testsuite abspeichern, so dass keine Änderungen verloren gehen.<br />
<br />
=== Konfiguration der Floating-Lizenz ===<br />
<br />
Um eine Floating-Lizenz zu nutzen, benötigen Sie einen expecco-Lizenzserver. Der Lizenzserver ist unter einem Rechnername bzw. IP-Adresse und einer Portnummer zu erreichen. Der Administrator des Lizenzservers kann Ihnen diese Informationen geben. Es muss sichergestellt sein, dass eine TCP-Verbindung zum entsprechenen Port im Lizenzserver aufgebaut werden kann. Router und Firewalls sind entsprechen zu konfigurieren.<br />
<br />
Beim Start von expecco öffnet sich der Lizenzdialog. Wählen Sie hier die Lizenzserver-Kachel aus. Tragen Sie den Rechnernamen bzw. die IP-Adresse sowie die Portnummer des Lizenservers ein.<br />
<br />
Sie können jetzt auswählen, welche expecco-Ausprägung Sie verwenden wollen: ''expecco-developer'' oder ''expecco-runtime''. Über die Schaltfläche ''Plugin-Liste vom Server aktualisieren'' erhalten Sie die verfügbaren Plugins. Wählen Sie die Plugins aus, die Sie für ihre Tests benötigen. Von den meisten Plugins benötigen Sie nur eine Lizenz. Einzelne Plugins können für auf mehrere Rechner verteilte Tests mehr als eine Lizenz von einem Plugin benötigen - Sie können das für derartige Plugins angeben. Im Dialog wird angezeigt, wieviele Lizenzen für ein bestimmtes Plugin auf dem Lizenzserver momentan noch zur Verfügung stehen. Per Tooltip können Sie in Erfahrung bringen, wie viele Lizenzen generell vorhanden sind. Die Differenz sind die momentan von anderen Benutzern verwendeten Lizenzen.<br />
<br />
Über die Schaltfläche ''Lizenzdatei installieren'' werden die Lizenzen vom Lizenzserver abonniert. Starten Sie jetzt expecco neu, damit die lizenzierten Plugins geladen werden.<br />
<br />
Wenn expecco beendet wird, werden alle Lizenzen wieder an den Lizenzserver zurück gegeben. Expecco erneuert regelmäßig die Lizenzen vom Lizenzserver. Wenn der Lizenzserver über einen gewissen Zeitraum nicht mehr erreichbar sein sollte (ca. 15 Minuten), wird expecco gesperrt, so dass keine Tests mehr ausgeführt oder verändert werden können. Veränderte Testsuiten können aber noch abgespeichert werden.<br />
<br />
Wenn expecco nicht regulär beendet wurde, z.B. wen der Rechner einfach ausgeschaltet wird, fallen die Lizenzen nach diesem Zeitraum an den Lizenzserver zurück und können dann von anderen Benutzern genutzt werden. <br />
<br />
expecco merkt sich, welche Lizenzen zuletzt abonniert wurden. Wenn expecco gestartet wird, versucht es, die zuletzt abonnierten Lizenzen wieder zu erhalten. Sollte das nicht möglich sein, da alle Lizenzen momentan vergeben sind, erscheint der Lizenzdialog, in dem die nicht oder nur teilweise erhaltenen Lizenzen rot unterlegt sind.<br />
<br />
Wenn Sie neue Lizenzen benötigen oder bisher verwendete Lizenzen nicht mehr benötigen, können Sie die anzufordernden Lizenzen jederzeit über den Lizenzdialog anpassen. Sie erreichen ihn über das Menu ''Extras -> Einstellungen -> Lizenzinstallation''.<br />
<br />
=== Update Installation von expecco unter Windows ===<br />
<br />
Wie bei der Erstinstallation erhalten eine Email mit dem Link zu den neuen expecco-Installationsdateien.<br />
Bitte laden Sie das Installationsprogramme herunter. Bei der Ausführung des Basis-Installationsprogramms ''expeccoSetup-***.exe'' erkennt expecco, dass es bereits installiert ist, und zeigt einen Dialog an, in dem Sie um eine Bestätigung gebeten werden, dass die alte expecco-Version deinstalliert werden darf. Bestätigen Sie bitte diesen Dialog. Die alte expecco-Version wird mit allen Plugins deinstalliert. Ihre Einstellungen, Lizenzdateien und Ihre Testsuiten bleiben erhalten. Anschließend wir die neue expecco-Version wie bei der Erstinstallation (s.o.) installiert. Installieren Sie ggfs. die Plugins über die neue Installationsdate ''expeccoPluginSetup-***.exe''.<br />
<br />
== Installation unter Linux ==</div>Mbhttps://doc.expecco.de/w2.x/index.php?title=Installation&diff=4053Installation2014-06-27T13:51:13Z<p>Mb: </p>
<hr />
<div>== Installation von expecco unter Windows ==<br />
<br />
Sie erhalten eine Email mit dem Link zu den expecco-Installationsdateien. Die Installationsdateien haben die Namen<br />
<br />
* expeccoSetup-2.7.0.22.exe -> für die expecco-Basisinstallation<br />
* expeccoPluginSetup-27.0.22.exe -> für optionale Plugins.<br />
<br />
wobei hier 2.7.0 der Versionsnummer von expecco entspricht und 22 der Build-Nummer. Die Installationsdatei für dir Plugins benötigen Sie nur dann, wenn Sie optionale Plugins gekauft haben. Die Versionsnummer von ''expeccoSetup'' und ''expeccoPluginSetup'' muss gleich sein. <br />
<br />
Bitte laden Sie die Installationsprogramme auf Ihren Rechner.<br />
Führen Sie zuerst das Installationsprogramm für die expecco-Basisinstallation aus (''expeccoSetup-***.exe''). Folgen Sie dabei dem Installationsassistenten. Sie können hier das Laufwerk und das Verzeichnis angeben, unter dem expecco installiert werden soll. Ausserdem können Sie die Komponenten angeben, die sie installieren wollen.<br />
<br />
Falls Sie Plugins für expecco gekauft haben, führen sie jetzt das Installationsprogramm für die expecco-Plugins aus (''expeccoPluginSetup-***.exe''). Im Installationsassistenten können Sie die von Ihnen gekauften Plugins auswählen. Es werden Ihnen mehr Plugins angeboten, als Sie lizenziert haben. Falls Sie nicht lizenzierte Plugins installieren, so ist das kein Problem. Installierte, aber nicht lizenzierte Plugins sind erst dann verfügbar, wenn die dazu passenden Lizenzen (nach-)installiert wurden. Ansonsten belegen Sie nur Platz auf der Festplatte. Weitere Plugins können auch jederzeit nachträglich installiert werden.<br />
<br />
Nach der Installation finden Sie auf Ihrem Desktop das expecco-Symbol. Über dieses Symbol können Sie expecco nun starten.<br />
Beim erstmaligen Ausführen, erscheint ein Fenster, in dem eine Lizenz verlangt wird. Je nachdem, ob Sie eine Einzellizenz oder eine Floating-Lizenz (per Lizenzserver) nutzen, können Sie die Lizenz konfigurieren.<br />
<br />
=== Konfiguration der Einzellizenz ===<br />
<br />
Einzellizenzen werden üblicherweise mit einem USB-Dongle genutzt. Ausnahmsweise können Einzellizenzen auch für einen beschränkten Zeitraum auch ohne Dongle verwendet werden. In beiden Fällen erhalten Sie eine Lizenzdatei. Lizenzdateien und Dongle müssen jeweils zusammenpassen, wobei eine Lizenzdatei auch zu mehreren Dongles desselben Kunden passen kann.<br />
<br />
# falls Sie einen Dongle erhalten haben, stecken Sie ihn in einen freien USB-Port in ihrem Rechner.<br />
# speichern Sie die Lizenzdatei auf ihrem Rechner<br />
# ziehen Sie entweder die Datei mit der Maus aus dem Windows-Explorer in den Lizenzdialog; oder wählen Sie im Lizenzdialog Ihre Lizenzdatei direkt aus.<br />
# Sie werden aufgefordert, expecco neu zu starten. Sie können jetzt expecco nutzen.<br />
<br />
Lizenzdateien ohne Dongle sind zeitlich beschränkt. Wenn Sie versehentlich den expecco-Dongle nicht in Ihren Rechner eingesteckt haben und expecco starten, erhalten Sie einen Hinweis, dass die Lizenz abgelaufen sei. Sobald Sie den Dongle einstecken, erscheint dieser Hinweis beim Start von expecco nicht mehr.<br />
<br />
Solange sie mit expecco arbeiten, wird überwacht, ob der Dongle vorhanden ist. Wenn Sie den Dongle während dessen aus ihrem Rechner entfernen, erhalten Sie einen Hinweis und können keine Tests mehr ausführen oder verändern. Sie können allerdings ihre Testsuite abspeichern, so dass keine Änderungen verloren gehen.<br />
<br />
=== Konfiguration der Floating-Lizenz ===<br />
<br />
Um eine Floating-Lizenz zu nutzen, benötigen Sie einen expecco-Lizenzserver. Der Lizenzserver ist unter einem Rechnername bzw. IP-Adresse und einer Portnummer zu erreichen. Der Administrator des Lizenzservers kann Ihnen diese Informationen geben. Es muss sichergestellt sein, dass eine TCP-Verbindung zum entsprechenen Port im Lizenzserver aufgebaut werden kann. Router und Firewalls sind entsprechen zu konfigurieren.<br />
<br />
Beim Start von expecco öffnet sich der Lizenzdialog. Wählen Sie hier die Lizenzserver-Kachel aus. Tragen Sie den Rechnernamen bzw. die IP-Adresse sowie die Portnummer des Lizenservers ein.<br />
<br />
Sie können jetzt auswählen, welche expecco-Ausprägung Sie verwenden wollen: ''expecco-developer'' oder ''expecco-runtime''. Über die Schaltfläche ''Plugin-Liste vom Server aktualisieren'' erhalten Sie die verfügbaren Plugins. Wählen Sie die Plugins aus, die Sie für ihre Tests benötigen. Von den meisten Plugins benötigen Sie nur eine Lizenz. Einzelne Plugins können für auf mehrere Rechner verteilte Tests mehr als eine Lizenz von einem Plugin benötigen - Sie können das für derartige Plugins angeben. Im Dialog wird angezeigt, wieviele Lizenzen für ein bestimmtes Plugin auf dem Lizenzserver momentan noch zur Verfügung stehen. Per Tooltip können Sie in Erfahrung bringen, wie viele Lizenzen generell vorhanden sind. Die Differenz sind die momentan von anderen Benutzern verwendeten Lizenzen.<br />
<br />
Über die Schaltfläche ''Lizenzdatei installieren'' werden die Lizenzen vom Lizenzserver abonniert. Starten Sie jetzt expecco neu, damit die lizenzierten Plugins geladen werden.<br />
<br />
Wenn expecco beendet wird, werden alle Lizenzen wieder an den Lizenzserver zurück gegeben. Expecco erneuert regelmäßig die Lizenzen vom Lizenzserver. Wenn der Lizenzserver über einen gewissen Zeitraum nicht mehr erreichbar sein sollte (ca. 15 Minuten), wird expecco gesperrt, so dass keine Tests mehr ausgeführt oder verändert werden können. Veränderte Testsuiten können aber noch abgespeichert werden.<br />
<br />
Wenn expecco nicht regulär beendet wurde, z.B. wen der Rechner einfach ausgeschaltet wird, fallen die Lizenzen nach diesem Zeitraum an den Lizenzserver zurück und können dann von anderen Benutzern genutzt werden. <br />
<br />
expecco merkt sich, welche Lizenzen zuletzt abonniert wurden. Wenn expecco gestartet wird, versucht es, die zuletzt abonnierten Lizenzen wieder zu erhalten. Sollte das nicht möglich sein, da alle Lizenzen momentan vergeben sind, erscheint der Lizenzdialog, in dem die nicht oder nur teilweise erhaltenen Lizenzen rot unterlegt sind.<br />
<br />
Wenn Sie neue Lizenzen benötigen oder bisher verwendete Lizenzen nicht mehr benötigen, können Sie die anzufordernden Lizenzen jederzeit über den Lizenzdialog anpassen. Sie erreichen ihn über das Menu ''Extras -> Einstellungen -> Lizenzinstallation''.<br />
<br />
=== Update Installation von expecco unter Windows ===<br />
<br />
Wie bei der Erstinstallation erhalten eine Email mit dem Link zu den neuen expecco-Installationsdateien.<br />
Bitte laden Sie das Installationsprogramme herunter. Bei der Ausführung des Basis-Installationsprogramms ''expeccoSetup-***.exe'' erkennt expecco, dass es bereits installiert ist, und zeigt einen Dialog an, in dem Sie um eine Bestätigung gebeten werden, dass die alte expecco-Version deinstalliert werden darf. Bestätigen Sie bitte diesen Dialog. Die alte expecco-Version wird mit allen Plugins deinstalliert. Ihre Einstellungen, Lizenzdateien und Ihre Testsuiten bleiben erhalten. Anschließend wir die neue expecco-Version wie bei der Erstinstallation (s.o.) installiert. Installieren Sie ggfs. die Plugins über die neue Installationsdate ''expeccoPluginSetup-***.exe''.<br />
<br />
== Installation unter Linux ==</div>Mb