Capture Orders Management Web Application
- How to capture a web application
- How to test an application using Application Tester
Prerequisites
- Access to a SAP BTP tenant with SAP Build Process Automation
- Install and Setup the Desktop Agent
- You have enabled SAP Build Process Automation browser extension
In this tutorial you will open the Orders Management application in a browser, create an application in SAP Build Process Automation and declare the elements for the application screen.
- Step 2
-
In a new browser window, go to SAP Build Process Automation tenant.
-
Select Create button to create a new project.
-
Select Build an Automated Process option.
-
Select the Task Automation option.
-
Enter the Project Name and a Description as given below. Select Create.
-
The project opens in a new tab. In the Configure Agent Version dialog box, select the agent version. Choose Confirm.
-
- Step 3
-
Choose Create and in the dropdown, select Application.
-
In the Create Application dialog, enter Application Name as Record Orders. Select Create.
-
The system starts detecting the applications and their screens currently running on your local machine. You’ll see a list of screens on the left-hand side. Select the Browse Orders window and select Next.
-
Select Manual Capture and choose Capture.
-
Once the screen has been recorded, select Go to Application.
What’s going on?
To automate a web application, you need to: capture, declare and test the application, screens, and UI elements.
You will capture the application and its screens. Then, declare the screens and the elements within the screens that will be part of the automation. Finally, test the application to make sure all the applications, screens and elements are getting recognized.
This is an important step to make sure that the system knows which application to work on, which screen to open and which element to select.
Which artifact type do we select to capture a screen?
-
- Step 4
To declare an application, you need to set recognition criteria – which identifies the application, screens and UI elements correctly when your automation runs.
-
Choose the URL (below) in the Captured Data to add them to the Recognition Criteria section.
Modify the criterion of URL as below and choose Apply.
- Property
URL
- Operator
contains
- URL
https://openui5.hana.ondemand.com/test-resources/sap/m/demokit/orderbrowser/webapp/test/mockServer.html
- Property
-
Save your changes.
The Recognition Criteria should look like this:
-
- Step 5
-
Choose the first order number (here, Order 7991) to select. A green or red border will appear around the selected element.
You can take help from the Both view to drill-down to the specific element.
-
In the Element Details panel, enter
Order Number
for the name of the element. The Identifier and Element are automatically detected. -
Remove any already existing criterion by choosing the X.
-
In Captured Data, choose the data below to add them to the criteria. The selected data is then automatically added as a criterion in Recognition Criteria.
-
class equals
sapMTextMaxLine sapMTextLineClamp
-
-
Once Recognition Criteria is green, it indicates that the bot has recognized your element. You can choose Declare Element now.
-
From the Declared Elements area, choose the Order Number element.
-
In the right panel under Recognition Criteria, choose the Is a Collection button
-
This converts Order Number element into a collection of elements.
-
Repeat steps 1-7 to further declare the element Status. Use the below criteria to declare:
-
class equals
sapMObjStatusText
Make sure to declare the status as Collection.
-
-
Save your work.
-
- Step 6
The purpose of testing an application before using it in an automation is to ensure that you have declared all of the elements correctly so that at runtime, they are correctly identified and can be controlled as intended. The application can be tested using Application Tester.
-
To test your application, choose Test
-
Choose Test.
The system launches the Application Tester.
The applications declared in your project are displayed in Declared Applications.
-
The elements getting successfully recognized will appear in green. If the declared application or screen or element is not recognized, you will see them in red.
The declared elements found on the selected screen are listed in the Declared Elements section. Choose the arrow next to a declared element to display its collection.
-
To test the elements select the element
Order Number(0)
from the list. -
Select Get Element activity and choose the Execute button.
-
The result can be seen in Output parameters as Order 7991. This way you can test that the elements are getting recognized correctly.
Congratulations! You have successfully captured and declared the application for orders management.
In the next tutorial, you will learn how to build an automation with this captured application to automate the orders management process.
Which of the following can be tested in the application tester?
-