KEMBAR78
Studio Lab Manual - Vendor Invoice Entry - WinGUI | PDF | Login | Microsoft Excel
0% found this document useful (0 votes)
57 views19 pages

Studio Lab Manual - Vendor Invoice Entry - WinGUI

Uploaded by

Lokesh Loke
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views19 pages

Studio Lab Manual - Vendor Invoice Entry - WinGUI

Uploaded by

Lokesh Loke
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

SAP Automation

with RPA v4.0


UiPath Studio

Lab Manual – Vendor Invoice Entry


Contents
1. Use Case .................................................................................................................................. 2
2. Problem Statement ................................................................................................................... 2
3. Expected Project Output........................................................................................................... 2
4. Learning Outcome .................................................................................................................... 2
5. Environment Prerequisites ....................................................................................................... 2
5.1 System Applications/Software ........................................................................................... 3
5.2 UiPath Studio Packages .................................................................................................... 3
5.3 Initial Data Files .................................................................................................................. 4
6. Process Overview ..................................................................................................................... 4
7. Project Development ................................................................................................................ 5
8. Test Case Development ......................................................................................................... 16

v4.0 June 2022 1|Page


1. Use Case
The finance department of a company receives vendor invoices that are required to be uploaded
on an SAP system for further processing. Recently, the number of vendor invoices has increased
significantly, and the finance department is facing a challenge in entering invoices into SAP at the
desired pace. The company head is willing to automate the SAP’s vendor invoice entry process
using UiPath Studio, resulting in reduced workload and cost-saving.

2. Problem Statement
Build a project in UiPath Studio that enters vendor invoices in SAP WinGUI.

• Login to SAP WinGUI and open the Enter Vendor Invoice form.
• Extract data from an excel file that contains invoice data to be uploaded.
• Enter the vendor invoice and retrieve the balance amount and message.
• Update the balance amount and message in the respective data row in the excel file that
contains invoice data.

3. Expected Project Output


The project's final output should be an excel file containing the balance amounts and messages
for the respective data rows after invoice entry.

4. Learning Outcome
After completion of this project, you are expected to achieve the following learning outcomes:

• Automate any process related to SAP Robotic Process Automation.


• Understand the capabilities of UiPath Studio in automating SAP WinGUI.
• Perform different SAP automation techniques by following the best practices for SAP
WinGUI automation.

5. Environment Prerequisites
Before beginning this project, you must ensure that your system environment is equipped with
the prerequisites necessary to create and execute the project successfully. There are three types
of prerequisites for this project:

v4.0 June 2022 2|Page


1. System Applications/Software
2. UiPath Studio Packages
3. Initial data files

5.1 System Applications/Software


Ensure that the applications/software listed in the table below are installed in your system.

Applications/Software Use

UiPath Studio Academic Alliance Version


Create automation using available project activities.
2021.10

Microsoft Excel Store initial data and status reports.

Connect with SAP server and provide an interface to upload


SAP WinGUI client* (7.40 or higher)
purchase order data.

*Note: This manual is built on a demo SAP system. The SAP WinGUI client version used for this
manual is 7.70. You may encounter some variation in the SAP interface you are accessing on
your machine. Therefore, it is recommended that you consider the steps mentioned in section 7
(Project Development) as a general guide rather than strict instructions. Also, you may want to
consult your SAP Systems Administrator to know about the transaction code and data required
to run this project. The Transaction Code used in this project is FB60, which opens an Enter
Vendor Invoice form. Please refer to sub-section 5.3 (Initial Data Files) to know about the data
used in this project.

5.2 UiPath Studio Packages


Ensure that the packages listed in the table below are installed in your UiPath Studio**. In Studio,
open Manage Packages from the Design ribbon to view the installed packages and their versions.

v4.0 June 2022 3|Page


Package Name Version

UiPath.Excel.Activities v2.11.4

UiPath.System.Activities v21.10.4

UiPath.UiAutomation.Activities v21.10.5

**Note: UiPath Studio Academic Alliance version 2021.10 has been used for this manual.

5.3 Initial Data Files


The initial data file of the project is an excel file called ‘InvoiceData.xlsx.’ It contains the Invoice
Data that consists of six columns, which are G/L Account, D/C (Debit or Credit), Amount, Value
Date, Balance, and Message. The first four columns contain the data to be uploaded on SAP.
The sixth and seventh columns should store the current balance and its message, respectively.
A sample table is shown below:

G/L Account D/C Amount Value Date Balance Message

11001000 Debit 900 3/3/2021

11001000 Credit 900 3/3/2021

11001000 Debit 1800 3/3/2021

6. Process Overview
The points listed below give you a chronological overview of the actions that the robot should
perform upon execution of the project:

1. START
2. Log on to an SAP system and log into it.
3. Execute transaction FB60 to open the Enter Vendor Invoice form.
4. Enter the Vendor’s Number, Invoice Date, Reference ID, Amount, Currency, Tax
Amount, and a text associated with the Tax.
v4.0 June 2022 4|Page
5. Expand SAP Tree from the toolbar and select a screen variant for items.
6. Get the invoice data from a local excel file and upload the data in the item table of the
form.
7. Press Enter to confirm the uploaded data after each iteration.
8. Store the current balance and its message in the same excel file from where the invoice
data was extracted.
9. STOP

Figure 1: A flowchart showing the process overview

7. Project Development
In this section, the steps to create the entire project are given. You are expected to follow each
step in chronological order and build your project.

Step 1. Open UiPath Studio.


Step 2. Create a new process and name it ‘SAP Use Case 2’. Add the description, ‘This
process creates the vendor invoice in the Enter Vendor Invoice form on SAP
WinGUI.’
Step 3. Search for a Sequence activity (if the empty/blank sequence is not already present)
in the Activities panel and drag and drop it in the Designer panel.

Step 1. Rename the activity as ‘Sequence - Creating Vendor Invoice.’


Step 2. Right-click on the activity, select Add Annotation from the context menu,
and enter annotation as ‘Create vendor invoice in SAP WinGUI.’
v4.0 June 2022 5|Page
Step 4. Drag and drop an SAP Logon activity in the Sequence - Creating Vendor Invoice
activity.
Step 1. Rename the activity as ‘SAP Logon – Connection Name.’
Step 2. Annotate the activity as ‘Logon to an SAP system.’
Step 3. The SAP Logon Path textbox of the activity should automatically get filled
with the path of the SAP client executable file. If it does not, click the
folder icon adjacent to the textbox, navigate to the folder where that file
is located, select the file, and click Open to save the path.
Step 4. In the Connection Name textbox of the activity, enter the connection
name of the SAP system in double quotes. The connection name should
be in the first column of the Connections table on the SAP Logon screen.
Step 5. Now, from the Design ribbon of Studio, open the drop-down menu of
Debug File and click Run to see if the project runs successfully till the
above step.
Step 5. Search for the Get Credential activity in the Activities panel and drag and drop it
below the SAP Logon – Connection Name activity.
Step 1. Rename the activity as ‘Get Secure Credential Asset from Orchestrator.’
Step 2. Annotate the activity as ‘Retrieve SAP username and password from
secure credential asset inside Orchestrator.’
Step 3. Search for the item Assets in the Data Manager panel:
Step 1. Right click on the item Assets and then left-click on the option
‘View all assets’
Step 2. UiPath Orchestrator should open in the systems default web
browser and navigate directly to the Orchestrator tenant,
specifically to the ‘Assets’ tab, that UiPath Studio (machine
Robot) is currently connected to.
Step 3. Click on the ‘+ Add asset’ option.
Step 4. In the ‘Asset name’ textbox, enter, “SAP_Credential”
Step 5. In the ‘Type’ drop down menu, select, “Credential”
Step 6. In the ‘Username’ textbox, enter your SAP username provided
by your SAP systems administrator.
Step 7. In the ‘Password’ textbox, enter your SAP password provided by
your SAP systems administrator.
Step 8. Click the ‘Create’ button.
Step 4. Close the web browser that was opened.

v4.0 June 2022 6|Page


Step 5. Expand the drop-down menu underneath the option for ‘Asset Name’ and
select the newly created Asset, ‘SAP_Credential’.
Step 6. Declare 2 new variables, by opening the Properties panel of the activity:
Step 1. In the ‘Username’ property, press Ctrl+K and enter ‘username’.
Step 2. In the ‘Password’ property, press Ctrl+K and enter ‘password’.
Step 6. Search for an SAP Login activity in the Activities panel and drag and drop it below
the Get Secure Credential Asset from Orchestrator activity.

Step 1. Rename the activity as ‘SAP Login – Client.’


Step 2. Annotate the activity as ‘Login to the SAP system.’
Step 3. Click the ‘Indicate on screen’ link and indicate the SAP Login window.
Step 4. In the Client textbox of the activity, enter the client number. You should
find the client number on the SAP Login screen.
Step 5. In the Username textbox, enter the variable ‘username’ that was declared
in the previous step.
Step 6. In the Password textbox, enter the variable ‘password’ that was declared
in the previous step.
Step 7. In the language textbox, enter the language in double-quotes. You should
find the language on the SAP Login screen.
Step 8. Select the option in the Multiple Logon Option textbox as per your need.
If unsure, choose the second option, ‘Continue with this logon, without
ending any other logons.’
Step 9. Now, close the open SAP instances and run the project to see if it runs
successfully till the above step.

Step 7. Search for the Use Application/Browser activity in the Activities panel and drag and
drop it below the SAP Login – Client activity.
Step 1. Click the ‘Indicate application to automate’ link and indicate the SAP Easy
Access window.
Step 2. Rename the activity as ‘Use Application – SAP WinGUI’
Step 3. Annotate the activity as ‘Orientate the robot to the currently opened SAP
WinGUI interface.’
Step 4. Open the Properties panel of the activity, and set the following:
Step 1. ‘Open’ = ‘Never’
Step 2. ‘Close’ = ‘Never’
Step 3. ‘Resize Window’ = ‘Maximize’

v4.0 June 2022 7|Page


Step 8. Search for a Type Into activity in the Activities panel and drop it in the Do section of
the Use Application – SAP WinGUI activity.

Step 1. Rename the activity as ‘Type Into – Transaction FB60.’


Step 2. Annotate the activity as ‘Execute transaction code FB60.’
Step 3. Click the ‘Indicate on screen’ link and indicate the transaction textbox on
the SAP Easy Access window.
Step 4. In the textbox of the activity, enter the expression: "fb60[k(enter)]". This
expression should type the transaction code FB60 in the transaction
textbox on the SAP Easy Access window and send Enter key to execute
the code. It opens the Enter Vendor Invoice window.
Step 5. Now, close the open SAP instances and run the project to see if it runs
successfully till the above step.

Step 9. Drag and drop a Type Into activity immediately below the Type Into – Transaction
FB60 activity from the Activities panel.

Step 1. Rename the activity as ‘Type Into – Vendor Number.’


Step 2. Annotate the activity as ‘Enter vendor number.’
Step 3. Click the ‘Indicate on screen’ link and indicate the vendor textbox on the
Enter Vendor Invoice window.
Step 4. In the textbox of the activity, enter "17386001" in double-quotes. It should
type the vendor number in the vendor textbox.
Step 5. Now, close the open SAP instances and run the project to see if it runs
successfully till the above step.

Step 10. Drag and drop a Type Into activity immediately below the Type Into – Vendor Number
activity from the Activities panel.

Step 1. Rename the activity as ‘Type Into – Invoice Date.’


Step 2. Annotate the activity as ‘Enter Invoice Date.’
Step 3. Click the ‘Indicate on screen’ link and indicate the ‘Invoice date’ textbox
on the Enter Vendor Invoice window.
Step 4. In the textbox of the activity, enter today’s date by entering the following
expression: DateAndTime.Today.Date.ToString("MMddyyyy")
(Important note the text: ‘MMddyyyy’ is case sensitive!)
Step 5. Now, close the open SAP instances and run the project to see if it runs
successfully till the above step.

v4.0 June 2022 8|Page


Step 11. Drag and drop a Type Into activity immediately below the Type Into – Invoice Date
activity from the Activities panel.

Step 1. Rename the activity as ‘Type Into – Reference ID.’


Step 2. Annotate the activity as ‘Enter Reference ID.’
Step 3. Click the ‘Indicate on screen’ link and indicate the ‘Reference:’ textbox on
the Enter Vendor Invoice window.
Step 4. In the textbox of the activity, enter “8000/12” in double-quotes.
Step 5. Now, close the open SAP instances and run the project to see if it runs
successfully till the above step.

Step 12. Drag and drop a Type Into activity immediately below the Type Into – Reference ID
activity from the Activities panel.

Step 1. Rename the activity as ‘Type Into – Amount.’


Step 2. Annotate the activity as ‘Enter Amount.’
Step 3. Click the ‘Indicate on screen’ link and indicate the ‘Amount’ textbox on the
Enter Vendor Invoice window.
Step 4. In the textbox of the activity, enter “2000” in double-quotes.
Step 5. Now, close the open SAP instances and run the project to see if it runs
successfully till the above step.

Step 13. Drag and drop a Type Into activity immediately below the Type Into – Amount activity
from the Activities panel.

Step 1. Rename the activity as ‘Type Into – Currency.’


Step 2. Annotate the activity as ‘Enter Currency.’
Step 3. Click the ‘Indicate on screen’ link and indicate the Currency textbox on
the Enter Vendor Invoice window.
Step 4. In the textbox of the activity, enter “USD” in double-quotes.
Step 5. From the Properties panel of the activity, check the EmptyField property
to set it to TRUE.
Step 6. Now, close the open SAP instances and run the project to see if it runs
successfully till the above step.

Step 14. Drag and drop a Type Into activity immediately below the Type Into – Currency
activity from the Activities panel.

Step 1. Rename the activity as ‘Type Into – Tax Amount.’


Step 2. Annotate the activity as ‘Enter Tax Amount.’
v4.0 June 2022 9|Page
Step 3. Click the ‘Indicate on screen’ link and indicate the ‘Tax Amount’ textbox
on the Enter Vendor Invoice window.
Step 4. In the textbox of the activity, enter “200” in double-quotes.
Step 5. Now, close the open SAP instances and run the project to see if it runs
successfully till the above step.

Step 15. Drag and drop a Type Into activity immediately below the Type Into – Tax Amount
activity from the Activities panel.

Step 1. Rename the activity as ‘Type Into – Tax Text.’


Step 2. Annotate the activity as ‘Enter Tax Text.’
Step 3. Click the ‘Indicate on screen’ link and indicate the ‘Text’ textbox on the
Enter Vendor Invoice window.
Step 4. In the textbox of the activity, enter the expression, “Tax 10%[k(enter)]”,
in double-quotes.
Step 5. Now, close the open SAP instances and run the project to see if it runs
successfully till the above step.

Step 16. Drag and drop a Click Toolbar Button activity immediately below the Type Into – Tax
Text activity from the Activities panel.

Step 1. Rename the activity as ‘Click Toolbar Button – Tree On.’


Step 2. Annotate the activity as ‘Select Tree On menu option.’
Step 3. Click the ‘Indicate on screen’ link and indicate the ‘Tree On’ button from
the Enter Vendor Invoice window toolbar.
Step 4. From the Toolbar Button drop-down menu of the activity, select Display
Templates (Shift+F1).
Step 5. Now, close the open SAP instances and run the project to see if it runs
successfully till the above step.

Step 17. Drag and drop an Expand Tree activity immediately below the Click Toolbar Button
– Tree On activity from the Activities panel.

Step 1. Rename the activity as ‘Expand Tree – STANDARD 4_0100.’


Step 2. Annotate the activity as ‘Select STANDARD 4_0100’ from the menu.’
Step 3. Click the ‘Indicate on screen’ link and indicate the ‘Tree’ side menu on the
Enter Vendor Invoice window.
Step 4. From the Tree Item drop-down menu of the activity, select Screen
variants for items/STANDARD 4_0100 Standard 4.

v4.0 June 2022 10 | P a g e


Step 5. Now, close the open SAP instances and run the project to see if it runs
successfully till the above step.

Step 18. Drag and drop a Double Click activity immediately below the Expand Tree -
STANDARD 4_0100 activity from the Activities panel.

Step 1. Rename the activity as ‘Double Click – STANDARD 4_0100.’


Step 2. Annotate the activity as ‘Click the tree variant.’
Step 3. Click the ‘Indicate on screen’ link and indicate the STANDARD 4_0100
option on the Enter Vendor Invoice Form.
Step 4. Now, close the open SAP instances and run the project to see if it runs
successfully till the above step.

Step 19. Drag and drop a Select Menu Item activity immediately below the Double Click –
STANDARD 4_0100 activity from the Activities panel.

Step 1. Rename the activity as ‘Select Menu Item – Tree Off.’


Step 2. Annotate the activity as ‘Select Tree Off from the menu.’
Step 3. Click the ‘Indicate on screen’ link and indicate the menu item toolbar on
the SAP window.
Step 4. In the Menu Item drop-down menu on the activity, select Hide
Templates (Shift + F2).
Step 5. Now, close the open SAP instances and run the project to see if it runs
successfully till the above step.

Step 20. Drag and drop the Read Range Workbook activity in the Activities panel (specifically
in UiPath.Excel.Activities → System → File → Workbook) immediately below the
Select Menu Item – Tree Off activity.

Step 1. Rename the activity as ‘Read Range – Invoice Data.’


Step 2. Annotate the activity as ‘Read data from the Invoice Data file and store
it in a data table variable.’
Step 3. Check the AddHeaders property of the activity from its Properties panel.
Step 4. In the DataTable property of the activity, press Ctrl + K and enter a new
data table variable dt_InvoiceData.
Step 5. In the Workbook path property of the activity, enter ‘InvoiceData.xlsx’
(Note: you may need to manually create this file based on the example
provided earlier in this document.)
Step 6. In the SheetName property of the activity, enter ‘Sheet1’

v4.0 June 2022 11 | P a g e


Step 7. In the Variables panel, change the scope of dt_InvoiceData to ‘Sequence
– Creating Vendor Invoice.’

Step 21. Search for a For Each Row in Data Table activity in the Activities panel and drag and
drop it immediately below the Read Range – Invoice Data activity.

Step 1. Rename the activity as ‘For Each Row in Data Table – Invoice Data.’
Step 2. Annotate the activity as ‘Operate on each row of invoice data.’
Step 3. In the DataTable property of the activity, enter dt_InvoiceData.
Step 4. In the Index property of the activity, press Ctrl + K and enter a new
variable, RowIndex. Open the Variables panel and ensure that the
Variable type of RowIndex is Int32. Set its scope to ‘Sequence –
Creating Vendor Invoice.’

Step 22. Search for a Type Into activity in the Activities panel and drag and drop it in the Body
section of the For Each Row in Data Table – Invoice Data activity.

Step 1. Rename the activity as ‘Type Into – G/L Account.’


Step 2. Annotate the activity as ‘Enter a value in the G/L Account column.’
Step 3. Click the ‘Indicate on screen’ link and indicate the first cell of the G/L
Account column on the Enter Vendor Invoice form.
Step 4. In the textbox of the activity, enter the expression: CurrentRow(“G/L
Account”).ToString. This expression should insert a value from the ‘G/L
Account’ column of the data table into the Enter Vendor Invoice form.
Step 5. Click the hamburger icon on the activity and select Edit Selector from the
context menu.
Step 6. In the Edit Attributes section of Selector Editor, scroll down and look for
the tableRow attribute. Empty the tableRow textbox.
Step 7. Right-click on the attribute and select the Use Variable option from the
context menu. It opens a pop-up window.
Step 8. Select RowIndex from the Variable Name drop-down menu from the pop-
up window and click Confirm. Click Validate to validate the changes.
Step 9. Click OK on the Selector Editor window to close it.
Step 10. Now, close the open SAP instances and run the project to see if it runs
successfully till the above step.

Step 23. Search for a Select Item activity in the Activities panel and drag and drop it below
the Type Into – G/L Account activity in the Body section of the For Each Row in Data
Table – Invoice Data activity.
v4.0 June 2022 12 | P a g e
Step 1. Rename the activity as ‘Select Item – D/C.’
Step 2. Annotate the activity as ‘Enter a value in the D/C column.’
Step 3. Click the ‘Indicate on screen’ link and indicate the first cell of the D/C
column on the Enter Vendor Invoice form.
Step 4. In the textbox of the activity, enter the expression:
CurrentRow(“D/C”).ToString. This expression should insert a value
from the ‘D/C’ column of the data table into the Enter Vendor Invoice
form.
Step 5. Click the hamburger icon on the activity and select Edit Selector from the
context menu.
Step 6. In the Edit Attributes section of Selector Editor, scroll down and look for
the tableRow attribute. Empty the tableRow textbox.
Step 7. Right-click on the attribute and select the Use Variable option from the
context menu. It opens a pop-up window.
Step 8. Select RowIndex from the Variable Name drop-down menu from the pop-
up window and click Confirm. Click Validate to validate the changes.
Step 9. Click OK on the Selector Editor window to close it.
Step 10. Now, close the open SAP instances and run the project to see if it runs
successfully till the above step.

Step 24. Search for a Type Into activity in the Activities panel and drag and drop it below the
Select Item – D/C activity in the Body section of the For Each Row in Data Table –
Invoice Data activity.

Step 1. Rename the activity as ‘Type Into – Amount.’


Step 2. Annotate the activity as ‘Enter a value in the Amount column.’
Step 3. Click the ‘Indicate on screen’ link and indicate the first cell of the ‘Amount
in doc.curr.’ column on the Enter Vendor Invoice form.
Step 4. In the textbox of the activity, enter the expression:
CurrentRow(“Amount”).ToString. This expression should insert a
value from the ‘Amount’ column of the data table into the Enter Vendor
Invoice form.
Step 5. Click the hamburger icon on the activity and select Edit Selector from the
context menu.
Step 6. In the Edit Attributes section of Selector Editor, scroll down and look for
the tableRow attribute. Empty the tableRow textbox.

v4.0 June 2022 13 | P a g e


Step 7. Right-click on the attribute and select the Use Variable option from the
context menu. It opens a pop-up window.
Step 8. Select RowIndex from the Variable Name drop-down menu from the pop-
up window and click Confirm. Click Validate to validate the changes.
Step 9. Click OK on the Selector Editor window to close it.
Step 10. Now, close the open SAP instances and run the project to see if it runs
successfully till the above step.

Step 25. Search for a Type Into activity in the Activities panel and drag and drop it below the
Type Into – Amount activity in the Body section of the For Each Row in Data Table
– Invoice Data activity.

Step 1. Rename the activity as ‘Type Into – Value Date.’


Step 2. Annotate the activity as ‘Enter a value in the Value Date column.’
Step 3. Click the ‘Indicate on screen’ link and indicate the first cell of the Value
Date column on the Enter Vendor Invoice form of the SAP window.
Step 4. In the textbox of the activity, enter the expression: CurrentRow(“Value
Date”).ToString + "[k(enter)]". This expression should insert a value
from the ‘Value Date’ column of the data table into the Enter Vendor
Invoice form.
Step 5. Click the hamburger icon on the activity and select Edit Selector from the
context menu.
Step 6. In the Edit Attributes section of Selector Editor, scroll down and look for
the tableRow attribute. Empty the tableRow textbox.
Step 7. Right-click on the attribute and select the Use Variable option from the
context menu. It opens a pop-up window.
Step 8. Select RowIndex from the Variable Name drop-down menu from the pop-
up window and click Confirm. Click Validate to validate the changes.
Step 9. Click OK on the Selector Editor window to close it.
Step 10. Now, close the open SAP instances and run the project to see if it runs
successfully till the above step.

Step 26. Search for a Get Attribute activity in the Activities panel and drag and drop it below
the Type Into – Value Date in the Body section of the For Each Row in Data Table –
Invoice Data activity.

Step 1. Rename the activity as ‘Get Attribute – Balance Message.’


Step 2. Annotate the activity as ‘Get the balance message from ‘tooltip’ attribute.’

v4.0 June 2022 14 | P a g e


Step 3. Click the ‘Indicate on screen’ link and indicate the icon adjacent to the
Balance textbox on the Enter Vendor Invoice form.
Step 4. Select “tooltip” from the attribute drop-down menu of the activity. If you
want to know why you need to select “tooltip,” click the hamburger icon
on the activity and select Open in UI Explorer from the context menu. In
the Property Explorer section of the UI Explorer, lookup for the “tooltip”
attribute. You may find that the tooltip attribute stores the message
associated with the current balance.
Step 5. In the Properties panel of the activity, enter the expression,
CurrentRow(“Message”), in the Result property.

Step 27. Search for a Get Text activity in the Activities panel and drag and drop it below the
Get Attribute – Balance Message in the Body section of the For Each Row in Data
Table – Invoice Data activity.

Step 1. Rename the activity as ‘Get Text – Current Balance.’


Step 2. Annotate the activity as ‘Get current balance from SAP window.’
Step 3. Click the ‘Indicate on screen’ link and indicate the ‘Bal.’ textbox on the
Enter Vendor Invoice form.
Step 4. In the Properties panel of the activity, enter CurrentRow(“Balance”) in
the Value property.

Step 28. Search for an Excel Application Scope activity in the Activities panel and drag and
drop it below the For Each Row in Data Table – Invoice Data activity.

Step 1. Rename the activity as ‘Excel Application Scope – Update Status.’


Step 2. Annotate the activity as ‘Update the invoice data and balance in the
InvoiceData.xlsx file.’
Step 3. Search for a Write Range activity in the Activities panel and drag and drop
it in the Do section of the activity. Select the Write Range activity that
displays in the Excel category in the Activities panel.
Step 1. Rename the activity as ‘Write Range – Update Status.’
Step 2. Annotate the activity as ‘Write invoice data and balance in
the InvoiceData.xlsx file.’
Step 3. Check the AddHeaders property of the activity from its
Properties panel.
Step 4. In the SheetName property textbox, enter Sheet1.
Step 5. Empty the Range property textbox.

v4.0 June 2022 15 | P a g e


Step 6. In the Data Table property, enter dt_InvoiceData.

Step 29. The project development is complete. Now, close the open SAP instances and run
the project to see if it runs successfully.

8. Test Case Development


In this section, the steps to create the test case for the project are given. You are expected to
follow each step in chronological order and build the test case.

Step 1. Open UiPath Studio and specifically the project was created in the previous section.
Step 2. Ensure that the “UiPath.Testing.Activities” dependency is installed in the current
project; install the required package if necessary.
Step 3. Right-click on the XAML-file that was created in the previous section of this guide
(most likely Main.xaml). Select the option from the displayed menu, ‘Create Test
Case’.
Step 1. Simply click the create button.
Notes: For purposes of this demonstration, technically no settings need
to be updated/modified; however, from a best-practice perspective it
typically would be advisable to provide a more meaningful name for the
test case (given the XAML-file created with the name, Main.xaml; a
typical test case name would then be ‘Main_TestCase’). Also there will
be no defined test data (“data driven test case” for this project, under the
‘Test Data’ tab/option.
Step 4. Search for the Read Range Workbook activity in the Activities panel and drag and
drop it in the Sequence - …. Then activity.
Step 1. Rename the activity as ‘Read Range – Invoice Data.’
Step 2. Annotate the activity as ‘Read data from the Invoice Data file and store
it in a data table variable.’
Step 3. Check the AddHeaders property of the activity from its Properties panel.
Step 4. In the DataTable property of the activity, press Ctrl + K and enter a new
data table variable dt_InvoiceData.
Step 5. In the Workbook path property of the activity, enter ‘InvoiceData.xlsx’
(Note: This file should already exist from the previous execution of the
project.)
Step 6. In the SheetName property of the activity, enter ‘Sheet1’
Step 5. Expand the ‘Variable’ tab and create a new variable.

v4.0 June 2022 16 | P a g e


Step 1. Set the new variable ‘Name’ to ‘boolMissingData’
Step 2. Set the ‘Variable type’ to ‘Boolean’.
Step 3. Make sure the ‘Scope’ of the variable is set to ‘… Then’ or ‘TestCase’
(either will be acceptable).
Step 6. Search for the Assign activity in the Activities panel and drag and drop it immediately
below the Read Range – Invoice Data activity.
Step 1. Rename the activity as ‘Assign – Initalize Data Check Variable’
Step 2. Annotate the activity as ‘Initalize Boolean Variable for Missing Data
Check’
Step 3. In the textbox located to the left of the ‘=’ sign, enter the newly created
variable, ‘boolMissingData’.
Step 4. In the textbox located to the right side of the ‘=’ sign, enter the value
‘False’ (without any quotations).
Step 7. Search for a For Each Row in Data Table activity in the Activities panel and drag
and drop it immediately below the Assign – Intialize Data Check Variable activity.
Step 1. Rename the activity as ‘For Each Row in Data Table – Invoice Data.’
Step 2. Annotate the activity as ‘Operate on each row of invoice data.’
Step 3. In the DataTable property of the activity, enter dt_InvoiceData.
Step 8. Search for the If activity in the Activities panel and drag and drop it in the Body section
of the For Each Row in Data Table – Invoice Data activity.
Step 1. Rename the activity as ‘If – Check for Missing Data.’
Step 2. Annotate the activity as ‘Checks for missing outputted data in the Excel
Spreadsheet.’
Step 3. In the Condition text box of the activity, enter:
CurrentRow("Balance").ToString.Equals("") OR
CurrentRow("Message").ToString.Equals("").
Step 4. In the Then section of the activity:
Step 1. Search for the Assign activity in the Activities panel and
drag and drop it in the Then section.
1. Rename the activity as ‘Assign – Update Data
Check Variable’.
2. Annotate the activity as ‘Update Boolean
Variable due to missing data.’
3. In the textbox located to the left of the ‘=’ sign,
enter the newly created variable,
‘boolMissingData’.
v4.0 June 2022 17 | P a g e
4. In the textbox located to the right side of the ‘=’
sign, enter the value ‘True’ (without any
quotations).
Step 2. Search for the Break activity in the Activities panel and drag
and drop it immediately below the Assign – Update Data
Check Variable activity. Note, there are no modifiable
properties for this activity.
Step 5. Note: The Else section will remain empty/unchanged; no
updates/additions.
Step 9. Search for the Verify Expression with Operator activity in the Activities panel and
drag and drop it immediately below the For Each Row in Data Table – Invoice Data
activity.
Step 1. Rename the activity as ‘Verify – Missing Data Check’
Step 2. Annotate the activity as ‘Verify if there was any missing data found in
the Excel Spreadsheet.’
Step 3. In the ‘FirstExpression’ textbox, enter the variable,
‘boolMissingData’.
Step 4. In the ‘Operator’ drop down menu, select the option ‘Equality’.
Step 5. In the ‘SecondExpression’ textbox, enter the expression, ‘False’
(without using any quotations).
Step 10. The test case development is complete. Now, close the open SAP instances and
run the test case workflow to see if it runs successfully.

v4.0 June 2022 18 | P a g e

You might also like