- Ãœberblick
- UI-Automatisierung (UI Automation)
- Mit UI-Automatisierung automatisierte Anwendungen und Technologien
- Projektkompatibilität
- UI-ANA-016 – URL zum Öffnen eines Browsers abrufen
- UI-ANA-017 – ContinueOnError True
- UI-ANA-018 – OCR-/Bildaktivitäten auflisten
- UI-DBP-006 – Containernutzung
- UI-DBP-013 – Falscher Gebrauch von Excel-Automatisierung
- UI-DBP-030 – Verwendung unzulässiger Variablen in Selektoren
- UI-PRR-001 – Klick simulieren
- UI-PRR-002 – Typ simulieren
- UI-PRR-003 – Offener Anwendungsmissbrauch
- UI-PRR-004 – Hartcodierte Verzögerungen
- UI-REL-001 – Große IDX in Selektoren
- UI-SEC-004 – Selektor-E-Mail-Daten
- UI-SEC-010 – App-/URL-Einschränkungen
- UI-USG-011 – Nicht zulässige Attribute
- UX-SEC-010 – App-/URL-Einschränkungen
- UX-DBP-029 – Unsichere Kennwortnutzung
- UI-PST-001 – Prüfungsprotokollebene in Projekteinstellungen
- UiPath-Browsermigrationstool
- Clippingbereich
- Computer Vision Recorder
- Aktivieren (Activate)
- Ankerbasis (Anchor Base)
- Browser anhängen (Attach Browser)
- Fenster anhängen (Attach Window)
- Benutzeingabe blockieren (Block User Input)
- Textfeld (Callout)
- Prüfen (Check)
- Klicken (Click)
- Bild anklicken (Click Image)
- Bild-Trigger anklicken (Click Image Trigger)
- OCR-Text anklicken (Click OCR Text)
- Text anklicken (Click Text)
- Trigger anklicken (Click Trigger)
- Anwendung schließen (Close Application)
- Registerkarte schließen (Close Tab)
- Fenster schließen (Close Window)
- Kontextbewusster Anker
- Ausgewählten Text kopieren (Copy Selected Text)
- Element Attribute Change Trigger
- Element vorhanden (Element Exists)
- Elementumfang (Element Scope)
- Element State Change Trigger
- Export UI Tree
- Strukturierte Daten extrahieren (Extract Structured Data)
- Untergeordnete Elemente finden (Find Children)
- Element finden (Find Element)
- Bild finden (Find Image)
- Bildübereinstimmung finden (Find Image Matches)
- OCR-Textposition finden (Find OCR Text Position)
- Relatives Element finden (Find Relative Element)
- Textposition finden (Find Text Position)
- Aktives Fenster abrufen (Get Active Window)
- Vorgänger-Element erhalten (Get Ancestor)
- Attribut erhalten (Get Attribute)
- Ereignisinfo erhalten (Get Event Info)
- Aus Zwischenablage erhalten (Get From Clipboard)
- Volltext erhalten (Get Full Text)
- OCR-Text erhalten (Get OCR Text)
- Passwort erhalten (Get Password)
- Position erhalten (Get Position)
- Quellelement erhalten (Get Source Element)
- Text erhalten (Get Text)
- Sichtbaren Text erhalten (Get Visible Text)
- Zurück (Go Back)
- Weiter (Go Forward)
- Zur Startseite (Go Home)
- Google Cloud Vision OCR
- Fenster ausblenden (Hide Window)
- Markieren (Highlight)
- Hotkey-Trigger (Hotkey Trigger)
- Darauf zeigen (Hover)
- Auf Bild zeigen (Hover Image)
- Auf OCR-Text zeigen (Hover OCR Text)
- Text beim Darauf zeigen (Hover Text)
- Bild vorhanden (Image Exists)
- Auf Bildschirm anzeigen (Indicate On Screen)
- .NET-Code einfügen
- Inject Js Script
- ActiveX-Methode aufrufen
- Tastendruck-Trigger (Key Press Trigger)
- Bild laden (Load Image)
- Fenster maximieren (Maximize Window)
- Microsoft Azure ComputerVision OCR
- Microsoft OCR
- Microsoft Project Oxford Online OCR
- Fenster minimieren (Minimize Window)
- Ereignisse überwachen (Monitor Events)
- Maus-Trigger (Mouse Trigger)
- Fenster verschieben (Move Window)
- Navigieren zu (Navigate To)
- OCR-Text vorhanden (OCR Text Exists)
- Auf Element erscheinen (On Element Appear)
- Auf Element verschwinden (On Element Vanish)
- Auf Bild erscheinen (On Image Appear)
- Auf Bild verschwinden (On Image Vanish)
- Anwendung öffnen (Open Application)
- Browser öffnen (Open Browser)
- Browser aktualisieren (Refresh Browser)
- Benutzerereignis wiedergeben (Replay User Event)
- Fenster wiederherstellen (Restore Window)
- Bild speichern (Save Image)
- Objekt auswählen (Select Item)
- Mehrere Objekte auswählen (Select Multiple Items)
- Hotkey senden (Send Hotkey)
- Ausschneidebereich einstellen (Set Clipping Region)
- Fokus legen auf (Set Focus)
- Text einstellen (Set Text)
- Auf Zwischenablage setzen (Set To Clipboard)
- Web-Attribut setzen (Set Web Attribute)
- Fenster anzeigen (Show Window)
- Prozess starten (Start Process)
- System-Trigger (System Trigger)
- Screenshot anfertigen (Take Screenshot)
- Tesseract OCR
- Text vorhanden (Text Exists)
- Tooltip
- Eingeben in (Type Into)
- Sicheren Text eingeben (Type Secure Text)
- Vordergrund verwenden
- Attribut abwarten (Wait Attribute)
- Warten, bis Element verschwindet (Wait Element Vanish)
- Warten, bis Bild verschwindet (Wait Image Vanish)
- Application event trigger
- Check/Uncheck
- Check App State
- Check Element
- Klicken (Click)
- Click Event Trigger
- Ziehen und Ablegen
- Extract Table Data
- For Each UI Element
- Attribut erhalten (Get Attribute)
- Get Browser Data
- Text erhalten (Get Text)
- Get URL
- Zu URL wechseln
- Markieren (Highlight)
- Darauf zeigen (Hover)
- Inject Js Script
- Tastenkombinationen
- Keypress Event Trigger
- Mouse Scroll
- Navigate Browser
- Objekt auswählen (Select Item)
- Set Browser Data
- Set Runtime Browser
- Text einstellen (Set Text)
- Screenshot anfertigen (Take Screenshot)
- Eingeben in (Type Into)
- Use Application/Browser
- Anhängen
- Prüfen (Check)
- Klicken (Click)
- Ziehen und Ablegen
- Daten extrahieren
- Attribut erhalten (Get Attribute)
- GetChildren
- GetRuntimeTarget
- GetText
- Get URL
- GoToUrl
- Markieren (Highlight)
- Darauf zeigen (Hover)
- IsEnabled
- Tastaturkürzel (Keyboard Shortcut)
- Mouse Scroll
- Offen
- Objekt auswählen (Select Item)
- Screenshot anfertigen (Take Screenshot)
- Eingeben in (Type Into)
- Wartestatus
- Führen Sie eine Browsersuche durch und rufen Sie Ergebnisse mithilfe von UIAutomation-APIs ab
- Web-Browsing
- Finden von Bildern
- Klicken auf Bilder
- Auslösen und Überwachen von Ereignissen
- Erstellen und Ãœberschreiben von Dateien
- HTML-Seiten: Extrahieren und Bearbeiten von Informationen
- Bearbeiten von Fenstern
- Automatisierte Listenauswahl
- Finden und Bearbeiten von Fensterelementen
- Verwalten der Textautomatisierung
- Laden und Verarbeiten von Bildern
- Verwalten von mausaktivierten Aktionen
- Automatisieren der Anwendungslaufzeit
- Automatisierte Ausführung einer lokalen Anwendung
- Browsernavigation
- Web-Automatisierung
- Beispiel für Trigger Scope
- Enable UI Automation support in DevExpress
- Computer Vision Local Server
- Mobile Automation
- Versionshinweise
- Projektkompatibilität
- Get Log Types
- Get Logs
- Get Page Source
- Get Device Orientation
- Get Session Identifier
- Install App
- Manage Current App
- Manage Other App
- DeepLink öffnen
- Open URL
- Mobile Device Connection
- Richtungswechsel
- Muster zeichnen
- Positional Swipe
- Press Hardware Button
- Set Device Orientation
- Screenshot anfertigen (Take Screenshot)
- Take Screenshot Part
- Element vorhanden (Element Exists)
- Execute Command
- Attribut erhalten (Get Attribute)
- Get Selected Item
- Text erhalten (Get Text)
- Set Selected Item
- Text einstellen (Set Text)
- Wischen
- Tap
- Type Text
- Creating variables from selector attributes
- Erste Schritte mit Mobile Automation-APIs
- Using mobile automation for mobile banking application
- Terminal
- Versionshinweise
- Über das Terminal-Aktivitätspaket
- Projektkompatibilität
- Best Practices
- Find Text
- Get Color At Position
- Get Cursor Position
- Feld erhalten (Get Field)
- Feld an Position erhalten (Get Field at Position)
- Bildschirmbereich erhalten (Get Screen Area)
- Text erhalten (Get Text)
- Text an Position erhalten (Get Text at Position)
- Cursor bewegen (Move Cursor)
- Move Cursor to Text
- Strg-Taste senden (Send Control Key)
- Tasten senden (Send Keys)
- Sichere Tasten senden (Send Keys Secure)
- Feld setzen (Set Field)
- Feld an Position setzen (Set Field at Position)
- Terminalsitzung (Terminal Session)
- Warte auf Feldtext (Wait Field Text)
- Warte auf Bildschirmtext (Wait Screen Text)
- Warte auf Text an Position (Wait Text at Position)
Using mobile automation for mobile banking application
In this tutorial, we explore how to use the Mobile Automation package to automate tasks within a mobile banking application. The tutorial uses the mobile banking simulator provided by Bank of America, and a Google Pixel Emulator from Sauce Labs. We will specifically focus on automating and testing the following actions:
- Logging into the app.
- Implementing a debit card lock.
- Viewing a claim and capturing a screenshot.
The tutorial provides instructions on how to use both activities and APIs for automating these scenarios.
- Add a device from Sauce Labs into MDM.
For more information about adding devices, visit Adding Sauce Labs device.
- Add the Bank of America mobile banking simulator into MDM.
For more information about adding applications, visit Adding applications.
To follow the steps and try out the tutorial yourself, check the following sample project: Mobile Banking Simulator.
In this example we use Object Repository elements as input UI elements to activities. To create UI elements for mobile, establish a connection in Mobile Device Manager (MDM) between the target device and application. Then, directly in the Object Repository panel, create each element and use Indicate Element to indicate the specific UI element on the MDM device.
To easily follow the tutorial, check the following list for the Object Repository structure:
- BankOfAmerica application, MobileScreen menu
- backFromClaimDetails
- backFromClaimStatus
- BackToMenu
- firstClaimSeeDetails
- Lock
- LockCard
- Login
- ManageDebitCredit
- Menu
- Passwort
- swipeMenu
- UserId
- viewmyclaims
- Establish a connection between the device and application:
- Add a Mobile Device Connection activity.
- Use Select Connection Details to connect the previously created mobile device and application.
- Login to the mobile application:
- Add a Tap activity to select the User ID field, so you can then enter a username.
- Add a Set Text activity to input the username inside the User ID field.
- Add a Tap activity to select the Password field, so you can then enter the password.
- Add a Set Text activity to input the corresponding password.
- Use a Tap activity to select the Login button.
Figure 1. The first activities as part of logging into the application
- Lock a debit or credit card:
- Add a Tap activity to navigate to the mobile banking app menu.
- Add a Swipe activity to swipe down in the menu.
The goal is to swipe until you find the Manage Debit/Credit section.
- Add a Tap activity to select the Manage Debit/Credit section.
- Add a Tap activity to select the Lock icon for the first card that is displayed.
- Add a Swipe activity to swipe down in the lock card notice.
This action allows you to confirm the action by selecting Lock Card.
- Add a Tap activity to select Lock Card.
Figure 2. Activities used for locking the debit card
- Take a screenshot of a claim:
- Add a Tap activity to select the back button, and return to the main menu.
- Add a Swipe activity to swipe down in the main menu, until the View My Claims section appears.
- Use a Tap activity to select the View My Claims section.
- Add a Tap activity to select See details for the first claim.
- Use the TakeScreenshot API to take a screenshot of the first claim details.
Figure 3. Activities used to take a screenshot of a claim
- Finally, after taking the screenshot, we go back to the main menu of the app, by using the Tap activity to select the Back UI element twice.
To automate a mobile application using APIs, record the application mobile elements within the project's Object Repository. For this example, we created a BankOfAmerica application with a general MobileScreen, containing all the UI elements that we use to automate. To create UI elements for mobile, establish a connection in Mobile Device Manager (MDM) between the target device and application. Then, directly in the Object Repository panel, create each element and use Indicate Element to indicate the specific UI element on the MDM device.
Check the following list for the structure of the Object Repository:
- BankOfAmerica application, MobileScreen menu
- backFromClaimDetails
- backFromClaimStatus
- BackToMenu
- firstClaimSeeDetails
- Lock
- LockCard
- Login
- ManageDebitCredit
- Menu
- Passwort
- swipeMenu
- UserId
- viewmyclaims
- Establish a connection between the device and application:
- Create a variable of type
Connection
, using the Connect API, with the second overload version.For this overload, enter the device name and application name as Strings, to establish the connection.
[TestCase] public void Execute() { Connection connection = mobile.Connect( "Android mobile device", "BankOfAmericaSimulator"); Log("Connection established");
[TestCase] public void Execute() { Connection connection = mobile.Connect( "Android mobile device", "BankOfAmericaSimulator"); Log("Connection established");
- Create a variable of type
- Optionally, for debugging purposes, you can add a
Log
message after the connection. - Log in to the mobile application:
- Call the Tap API to click the User ID field.
This action allows you to enter the username.
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.UserId);
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.UserId); - Use the SetText API to enter a username in the User ID
field.
connection.SetText(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.UserId, "john.doe@uipath.com", MobileOptions.SetText().WithSendNewline(false));
connection.SetText(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.UserId, "john.doe@uipath.com", MobileOptions.SetText().WithSendNewline(false)); - Call the Tap API to
select the Password field so you can enter the
password.
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.Password);
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.Password); - Use the Set Text API to enter a password in the Password field.
The
WithSendNewLine(false)
method ensures that the OK keyboard element is not pressed on the mobile device after sending the text. For more information about the available options of the Set Text API, visit MobileOptions.SetTextOptions Class.connection.SetText(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.Password, "abcde", MobileOptions.SetText().WithSendNewline(false));
connection.SetText(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.Password, "abcde", MobileOptions.SetText().WithSendNewline(false)); - Employ the Tap API to
select
Login.
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.Login);
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.Login);
- Call the Tap API to click the User ID field.
- Lock a debit or credit card:
- Navigate to the menu of the mobile banking app, using the Tap
API:
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.Menu);
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.Menu); - Swipe down in the menu, using the Swipe API.
The goal is to swipe until you find the Manage Debit/Credit section.
connection.Swipe(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.swipeMenu, ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.ManageDebitCredit, SwipeDirection.Down, 4);
connection.Swipe(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.swipeMenu, ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.ManageDebitCredit, SwipeDirection.Down, 4); - Select the Manage Debit/Credit section using the Tap API.
The
WithTimeout()
method enables the API to pause for a predetermined number of seconds. This pause lasts until the target UI element appears, or an error is thrown.connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.ManageDebitCredit, TapTypeEnum.Single, MobileOptions.Tap().WithTimeout(120));
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.ManageDebitCredit, TapTypeEnum.Single, MobileOptions.Tap().WithTimeout(120)); - For the first card that
is displayed, select the Lock icon using the Tap
API.
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.Lock);
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.Lock); - Swipe down in the lock
card notice, using the Directional Swipe API, so we can confirm the action by
selecting Lock
Card.
connection.DirectionalSwipe(SwipeDirection.Down);
connection.DirectionalSwipe(SwipeDirection.Down); - Select Lock Card using the Tap
API.
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.LockCard);
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.LockCard);
- Navigate to the menu of the mobile banking app, using the Tap
API:
- Take a screenshot of a claim.
- Go back to the main menu,
using the Tap API and the back
icon.
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.BackToMenu);
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.BackToMenu); - Swipe down in the main menu, until the View My Claims section appears.
For this step, we use the Swipe API, this time employing the sixth overload. This overload requires an
IElementDescriptor
for the swipe container, and aSelectorTarget
for the target UI element.We first create aSelectorTarget
for the View My Claims section, and then employ the Swipe API.- Open MDM and create the connection between the mobile device and application.
- Go to the Object Repository and create a new element for the mobile screen.
- Select Indicate element.
- From the selection options menu, copy the web control identified by the selectors.
For this mobile banking app, you have to ensure that WebView selectors as native selectors is selected as a selection option.
- Return to the
code editor, and create a variable of type
SelectorTarget
. Use theMobileTarget.FromSelector
method which requires as argument the web control you previously copied.SelectorTarget viewMyClaimsTarget = MobileTarget.FromSelector("<mbl android:className='android.widget.TextView' text='View My Claims' />");
SelectorTarget viewMyClaimsTarget = MobileTarget.FromSelector("<mbl android:className='android.widget.TextView' text='View My Claims' />"); - Use the Swipe
API, with the
SelectorTarget
variable, to finish the swipe down action.connection.Swipe(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.swipeMenu, viewMyClaimsTarget, SwipeDirection.Down, 20);
connection.Swipe(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.swipeMenu, viewMyClaimsTarget, SwipeDirection.Down, 20);
- Tap the View My
Claims
section.
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.viewmyclaims);
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.viewmyclaims); - Tap See details
for the first
claim.
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.firstClaimSeeDetails);
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.firstClaimSeeDetails); - Use the TakeScreenshot API to take a screenshot of the first claim
details.
connection.TakeScreenshot();
connection.TakeScreenshot();
- Go back to the main menu,
using the Tap API and the back
icon.
- Finally, after taking the screenshot, we go back to the main menu of the app, by
tapping the Back UI element
twice.
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.backFromClaimDetails); connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.backFromClaimStatus);
connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.backFromClaimDetails); connection.Tap(ObjectRepository.Descriptors.BankOfAmerica.MobileScreen.backFromClaimStatus);