Getting Started with the Desktop Studio - SAP Help Portal

Preview:

Citation preview

PUBLIC2022-02-02

Getting Started with the Desktop Studio

© 2

021 S

AP S

E or

an

SAP affi

liate

com

pany

. All r

ight

s re

serv

ed.

THE BEST RUN

Content

1 Hello World. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31.1 Create a Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 Create a Workflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.3 Rearrange Your Studio Layout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.4 Add an Activity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.5 Configure the Activity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111.6 Generate the Scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121.7 Test the Scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131.8 Export Your Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151.9 Import Your Project to the Factory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .161.10 Add a Trigger. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17

2 Launch and Control CALC.EXE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182.1 Create a Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182.2 Add a New Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .192.3 Capture the Page. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232.4 Capture UI Elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262.5 Create a New Workflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312.6 Add the Application Start Activity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .322.7 Add a Page Activity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332.8 Configure the Page Activity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342.9 Generate the Scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352.10 Test the Scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

3 Web Search and Spreadsheet Output. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .403.1 Initial Web Application Capture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423.2 Configure the Page Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443.3 Capture and Add UI Elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463.4 Create the Workflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493.5 Configure the Page Within the Workflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523.6 Preliminary Test of Your Scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553.7 Configure Another Application Page. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583.8 Identify UI Elements for the Search Results. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623.9 Modify the Workflow and Add the Search Results. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .693.10 Add Excel Activities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733.11 Correcting the URLs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 783.12 Final Test. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

2 PUBLICGetting Started with the Desktop Studio

Content

1 Hello World

Prerequisites

NoteBefore you work through this tutorial, make sure the agent has been properly connected to a tenant. Otherwise, you will not be able to complete the tutorial. For more information, see the dedicated section in the Installation Guide.

Procedure

In this short tutorial, we will go through the different steps you need to follow to create your first basic project. These are:

1. Launch the Studio2. Create a project3. Create a workflow4. Add an activity to the workflow canvas5. Configure the activity6. Build7. Test in debug mode

At the end of this tutorial, you will be able to create and test a scenario in debug mode.

1.1 Create a Project

Procedure

1. In the menu bar, click File New Project...

Getting Started with the Desktop StudioHello World PUBLIC 3

2. Enter the properties for the project.

Results

Studio creates and initializes your project.

4 PUBLICGetting Started with the Desktop Studio

Hello World

1.2 Create a Workflow

Procedure

1. Go to the Workflow perspective.

2. Right-click and select New Workflow.

3. In the New Workflow dialog box, change the name to HelloWorkflow and click OK.

Getting Started with the Desktop StudioHello World PUBLIC 5

Results

The workflow is displayed with the start activity shown in green.

Related Information

The Workflow Perspective

6 PUBLICGetting Started with the Desktop Studio

Hello World

1.3 Rearrange Your Studio Layout

We recommend that you rearrange the layout of Desktop Studio to help you work more efficiently.

Procedure

Drag the divider to the left to create more space for the panes on the right.

Getting Started with the Desktop StudioHello World PUBLIC 7

8 PUBLICGetting Started with the Desktop Studio

Hello World

1.4 Add an Activity

Procedure

Next, add the first activity that you want to carry out in your workflow.1. Go to the Activities pane at the bottom-right of the screen.

2. Scroll down until you find the Popup category and expand it.

Getting Started with the Desktop StudioHello World PUBLIC 9

3. Select the MsgBox activity and drag and drop it to the canvas.

4. Use the handles at the edge of the start activity to connect it to the MsgBox activity.

10 PUBLICGetting Started with the Desktop Studio

Hello World

TipYou can change the position of the activities on the canvas if necessary.

1.5 Configure the Activity

Context

After you have added and connected the activity, you need to set some parameters.

Procedure

1. Select the MsgBox activity and open the Properties pane.2. Enter a name (without a space), title, and message.3. Leave the Template property set to Ok and select Wait Closing.4. Select the Is Step property.

Getting Started with the Desktop StudioHello World PUBLIC 11

1.6 Generate the Scenario

You generate the scenario by running a build.

Procedure

1. Click the Build button.

2. Switch to the Editor perspective, and expand and open the scenario.

12 PUBLICGetting Started with the Desktop Studio

Hello World

1.7 Test the Scenario

Prerequisites

To test your scenario, you first need to perform the Desktop Agent Tenant Registration.

Context

Now that you have created your first scenario, let's test it.

Getting Started with the Desktop StudioHello World PUBLIC 13

Procedure

1. Activate Debug mode.

Studio minimizes and the debugger appears. The agent loads the scenarios and some events are displayed.

2. Click the Agent icon in the system tray and click Test HelloWorkflow.

The scenario is then executed and the result is displayed.

3. Click OK.

The event is then triggered and can be displayed in the debugger window.

14 PUBLICGetting Started with the Desktop Studio

Hello World

1.8 Export Your Project

Procedure

In the menu bar, click File Export project .

Results

Your project is exported as a ZIP file. If you do not change the location in which the file is stored, you can find it at C:\Users\<your user>\Documents\SAP\Intelligent RPA\Desktop Studio\<your project>\export.

Getting Started with the Desktop StudioHello World PUBLIC 15

1.9 Import Your Project to the Factory

Procedure

1. Launch your Web browser and connect to SAP Intelligent Robotic Process Automation Factory (using the same URL that you used to register Desktop Agent).

2. Go to the Packages tab and click Import.3. Select the ZIP file that you previously exported.

If you didn't change the location in which the file is stored, you can find it at C:\Users\<your user>\Documents\SAP\Intelligent RPA\Desktop Studio\<your project>\export

4. The system suggests a name for a cloud project that will be automatically generated when the desktop package is imported. Click Import.

Results

You have imported a package, you now need to add it to an environment, and create a trigger.

16 PUBLICGetting Started with the Desktop Studio

Hello World

1.10 Add a Trigger

Context

After you have imported your package, you can add a trigger of type scheduled.

Procedure

1. On the Packages tab, click Add trigger on the right of your package.2. Select your environment and click Next.

The package is automatically deployed in the environment.3. Select the mode Scheduled and click Next.4. Enter a name.5. Optional: enter a description.6. Select the scenario.7. Select the priority of the trigger: keep the default selection (low).8. Select a date range and a recurrence.9. Click Create.

Results

You have now added a trigger.

NoteAfter adding a trigger, you can wait until it is triggered automatically or you can trigger it manually. Proceed as follows:

1. Click on your trigger to display all of the options.2. Click Run now

Getting Started with the Desktop StudioHello World PUBLIC 17

2 Launch and Control CALC.EXE

In this scenario, you will learn how to declare or capture your first application. We will use a calculator as an example.

The steps that we will work through are as follows:

1. Create a Project [page 18]2. Add a New Application [page 19]3. Capture the Page [page 23]4. Capture UI Elements [page 26]5. Create a New Workflow [page 31]6. Add the Application Start Activity [page 32]7. Add a Page Activity [page 33]8. Configure the Page Activity [page 34]9. Generate the Scenario [page 35]10. Test the Scenario [page 36]

2.1 Create a Project

Procedure

1. In the menu bar, choose File New Project...

2. Enter the properties for the project and click Save.

18 PUBLICGetting Started with the Desktop Studio

Launch and Control CALC.EXE

Task overview: Launch and Control CALC.EXE [page 18]

Next task: Add a New Application [page 19]

2.2 Add a New Application

Procedure

1. On Windows, launch the calculator (calc.exe).

2. In Desktop Studio, switch to the Explorer perspective and choose Add a New Application... from the context menu.

Getting Started with the Desktop StudioLaunch and Control CALC.EXE PUBLIC 19

3. In the Capture Application window, choose UIAutomation as the technology connector and select Calculator.

RecommendationIf the area where the calculator should appear is black, make sure that the calculator application is in the foreground. Then select the Screenshot radio button in the Capture mode area. Finally, click the Refresh icon and select the application from the list.

4. Optional: Change the application name. and description.5. Click Save and Capture Page or Save.

20 PUBLICGetting Started with the Desktop Studio

Launch and Control CALC.EXE

Results

The calculator application has now been added to your project.

Getting Started with the Desktop StudioLaunch and Control CALC.EXE PUBLIC 21

Next Steps

In the properties, enter calc.exe as the launch path to finalize.

Task overview: Launch and Control CALC.EXE [page 18]

Previous task: Create a Project [page 18]

Next task: Capture the Page [page 23]

22 PUBLICGetting Started with the Desktop Studio

Launch and Control CALC.EXE

2.3 Capture the Page

Prerequisites

The Capture Page dialog box must be open. If it isn't,

● Double-click the new page box

● or right-click on the application Calculator and select Capture a New Page ... from the context menu

Procedure

1. Making sure the calculator is in the foreground, select it by keeping Ctrl pressed and hovering the cursor over the application.

A red rectangle appears around the calculator and a list of page names is displayed in the Pages section.

Getting Started with the Desktop StudioLaunch and Control CALC.EXE PUBLIC 23

2. Select Window - Calculator from the top of the list and then click Scan and Capture.3. In the Captured Data screen, select Name=Calculator and click the plus icon (+) in the criteria screen.

4. In the Parameters window, set the Refresh Mode to Polling.

This ensures that the bot recognizes the application when it is launched.

Results

Your page is now ready for you to add UI elements.

24 PUBLICGetting Started with the Desktop Studio

Launch and Control CALC.EXE

Next Steps

Don't forget to add calc.exe to the properties.

Task overview: Launch and Control CALC.EXE [page 18]

Previous task: Add a New Application [page 19]

Next task: Capture UI Elements [page 26]

Getting Started with the Desktop StudioLaunch and Control CALC.EXE PUBLIC 25

2.4 Capture UI Elements

Context

Now that you've captured the page, you can start to locate the buttons. We'll start with button 4. Depending on where you click in the calculator, you can capture the label or the button:

Captured Label Captured Button

Procedure

1. Select the button 4 and then double-click it.

The button btNum4Button will appear in red. A criterion is required to ensure proper recognition.

2. In the Captured Data screen area, click on the property AutomationID=num4Button and then click the plus icon (+) located in the criteria area to add this criterion.

26 PUBLICGetting Started with the Desktop Studio

Launch and Control CALC.EXE

btNum4Button now appears in green.

Getting Started with the Desktop StudioLaunch and Control CALC.EXE PUBLIC 27

3. Repeat the process for button 2.

28 PUBLICGetting Started with the Desktop Studio

Launch and Control CALC.EXE

This time, double-click the AutomationID=num2Button property. This adds the button and criterion in one step.

Getting Started with the Desktop StudioLaunch and Control CALC.EXE PUBLIC 29

Task overview: Launch and Control CALC.EXE [page 18]

Previous task: Capture the Page [page 23]

Next task: Create a New Workflow [page 31]

30 PUBLICGetting Started with the Desktop Studio

Launch and Control CALC.EXE

2.5 Create a New Workflow

Procedure

1. Save your project.2. Go to the Workflow perspective, select the application and choose New Workflow... from the context menu.

3. Enter a name.

Results

Your workflow has now been created.

Getting Started with the Desktop StudioLaunch and Control CALC.EXE PUBLIC 31

Task overview: Launch and Control CALC.EXE [page 18]

Previous task: Capture UI Elements [page 26]

Next task: Add the Application Start Activity [page 32]

2.6 Add the Application Start Activity

Context

The workflow that you created must begin with an activity to start the calculator application.

Procedure

1. On the Activities tab, drag and drop Start (under Application) to the canvas near to Start.2. Find the Application Activity in the Properties window and select Calculator from the dropdown list.

The activity box on the canvas is automatically updated to display Start 'Calculator'.3. Optional: Set the activity property Wait Starting to avoid a timeout.4. Right-click on this activity box and select Set as Start Node.

An arrow appears from Start to the Start 'Calculator' activity.

Task overview: Launch and Control CALC.EXE [page 18]

Previous task: Create a New Workflow [page 31]

Next task: Add a Page Activity [page 33]

32 PUBLICGetting Started with the Desktop Studio

Launch and Control CALC.EXE

2.7 Add a Page Activity

Context

The workflow that you created can use application pages that have been declared.

Procedure

1. In the Activities window, click the Pages tab, click the arrow next to Calculator, and then drag and drop the pWindowCalculator page to the canvas near the Start activity.

2. Use the handles to connect the two boxes.

Results

Your workflow now has one page activity.

Task overview: Launch and Control CALC.EXE [page 18]

Previous task: Add the Application Start Activity [page 32]

Next task: Configure the Page Activity [page 34]

Getting Started with the Desktop StudioLaunch and Control CALC.EXE PUBLIC 33

2.8 Configure the Page Activity

Procedure

Next, you need to configure the page activity.1. Double-click the page activity to edit it.2. In the Activities window, find the Wait Exist activity under Item - Wait and drag and drop it to button 4.3. Drag and drop the Click activity to button 4.

4. Repeat the process with button 2 to define the second action.

Next Steps

It's now time to compile and test your workflow.

Task overview: Launch and Control CALC.EXE [page 18]

Previous task: Add a Page Activity [page 33]

Next task: Generate the Scenario [page 35]

34 PUBLICGetting Started with the Desktop Studio

Launch and Control CALC.EXE

2.9 Generate the Scenario

Procedure

Click the Build button.

Results

If your workflow builds correctly, you should see this screen without any errors.

Task overview: Launch and Control CALC.EXE [page 18]

Previous task: Configure the Page Activity [page 34]

Next task: Test the Scenario [page 36]

Getting Started with the Desktop StudioLaunch and Control CALC.EXE PUBLIC 35

2.10 Test the Scenario

Prerequisites

To test your scenario, you first need to perform the Desktop Agent Tenant Registration.

Procedure

1. Launch the Debug Mode.

Desktop Studio minimizes and the debugger appears.

36 PUBLICGetting Started with the Desktop Studio

Launch and Control CALC.EXE

Desktop Agent loads the scenario and some events are displayed. You may notice that the calculator is identified in the events.

2. Click on Desktop Agent systray and select Test calcWorkflow.

Getting Started with the Desktop StudioLaunch and Control CALC.EXE PUBLIC 37

The Debugger populates the additional events.

38 PUBLICGetting Started with the Desktop Studio

Launch and Control CALC.EXE

Results

Congratulations! The calculator should now show you the correct answer.

Task overview: Launch and Control CALC.EXE [page 18]

Previous task: Generate the Scenario [page 35]

Getting Started with the Desktop StudioLaunch and Control CALC.EXE PUBLIC 39

3 Web Search and Spreadsheet Output

In this tutorial, we will show you how to capture a Web application and use the results to populate a spreadsheet. When you have completed the tutorial, you will have a corresponding workflow defined and running.

Procedure

The steps you will follow in this tutorial are:1. Create a new project.2. Capture your application.3. Define a workflow.4. Test your workflow.

Results

At the end of the tutorial, you will see the result in the Explorer perspective and in the Workflow Designer.

Result in Explorer Perspective

40 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

Result in Workflow Designer

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 41

3.1 Initial Web Application Capture

Procedure

1. Launch Internet Explorer and enter the URL for your favorite search engine.

In this tutorial, we will use https://www.lilo.org/en as an example.

2. Launch Desktop Studio and create a new project.3. In the Explorer perspective, click + Add Application4. In the Capture Application window, choose WEB as the technology connector and select the search engine

page from the list of applications.

42 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

5. Enter a name and description and then click Save and Capture Page to immediately capture a page, or Save.

The application is now added to your project.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 43

6. If necessary, double-click to start the page capture, or right-click on the application name and select Capture a New Page ....

7. When the Capture Page window is open, select the page to capture. To do this, keep the Ctrl key pressed and hover the cursor over the search engine page in the browser.

A red rectangle appears around the page and a default name appears in the Name field, and the URL in the Description field.

8. Change the default name to pHome and click Scan and Capture.

After a few seconds, the page is included in your project.

3.2 Configure the Page Application

Context

At the moment, you have captured the page but it is not yet fully recognized. This is indicated by the red font.

44 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

To recognize it, we need to add a criterion. The Captured Data screen area contains information that you can use as criteria to define the recognition mechanism.

Procedure

1. Select the URL.

The Criteria area is now updated.

2. Click the plus icon (+) to add the criterion as is.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 45

Results

The URL has now been added as the main criterion and the page is fully recognized.

3.3 Capture and Add UI Elements

Context

The next stage in our scenario is to enter a search string and start the search. To do so, we need to locate the input field and the search button. At the moment, the page doesn't have any UI elements that we can use, so we need to add them.

46 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

Procedure

1. Click the search input at the top of the screen and pay attention to the properties located in the Captured Data subscreen.

2. Double-click or right-click to add the search field as a new item.3. The item oQ is added below the page in green and the criteria subscreen has the value INPUT name="q".

4. Open the context menu for oQ and rename it to oQuery.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 47

We now need to add the magnifying glass icon to the right of the search field to the input field.

5. Double-click the search button.The item is added to the project but shown in red. We now need to add a criterion so that we can use it later.

6. In the Captured Data subscreen, select class=bg-white pointer.

7. On the criteria subscreen, click the plus icon (+) to add the criterion.

The button is now recognized.

48 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

8. Rename the button from oIMG to btSearch9. Save your project.

Results

You have successfully defined the input field and the search button.

3.4 Create the Workflow

Context

Our next goal is to create a workflow that covers both the Web search and the creation of a spreadsheet. We'll use the GLOBAL item to add the workflow.

Procedure

1. Open the Workflow perspective and right-click within the GLOBAL item to add a new workflow.

2. Name the workflow.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 49

Your workflow is created.3. Go to Activities and drag and drop the Start application activity below the workflow start.

The Start application activity is now added and linked to the start of the workflow. If it is not the case, use the edges of the Start application to link the two items.

4. Click on Edit Parameters icon or double-click on the Start application to display its properties.

5. Within the application properties, go to the Application field under Activity.

50 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

6. Click to display the applications and select appLilo.

Your application is now defined.

7. Go to Pages, expand the application, and drag & drop the pHome page to the canvas. Make sure that it is properly connected to the previous activity.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 51

3.5 Configure the Page Within the Workflow

Procedure

1. From the workflow, double-click to open pHome.

52 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

The following screen appears:

To enter text in the search field, we will use the Set activity. This activity is located in the category Item - Set; however, it should also appear under Most used.

2. Drag and drop the Set activity to the search field.

A default description is generated.3. Click the default description to edit its properties.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 53

4. Locate the Source data property and the default value $data$.

5. Change $data$ to 'SAP Intelligent RPA'.

RememberMake sure that you include the single quotation marks, otherwise your build will fail.

Next, do the same to trigger the button, but instead of Set, we will use the Click activity.6. Drag and drop the Click activity to the button.

54 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

Results

Your page now has two activities and is ready for testing.

3.6 Preliminary Test of Your Scenario

Prerequisites

To test your scenario, you first need to declare the Desktop Agent on which the scenario is going to be executed in an agent group using SAP Intelligent Robotic Process Automation Factory. For more information, see Create an Agent Group.

Context

It's a good practice to test your scenario at this stage before you go further.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 55

Procedure

1. If you haven't done so already, save your project.2. Click on Build.

If an error appears, check that you have performed the previous steps correctly.

3. Launch your project in debug mode

The Debugger appears.

4. Click on the Desktop Agent systray.

5. Click the corresponding workflow.

56 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

Some events will be displayed in the debugger.

The Web browser also appears and shows the search results.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 57

3.7 Configure Another Application Page

Context

After you have executed the scenario, keep the Web browser and the corresponding results. We will use them as the source for the next page.

Procedure

1. Open the Explorer perspective, right-click the application and choose Capture a new Page...

58 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

2. In the Capture Page dialog, click Browse and select the lilo search results for SAP Intelligent RPA.3. Click Capture and Edit.4. Change the default name to pResults and click Start Capture.

After a few moments, your page is fully captured and will appear as child element of the application. We need to fix the recognition behavior.5. In the Captured Data subscreen, locate the “URL” property.6. Select the URL property.

It appears in the criteria subscreen.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 59

7. Keep only the beginning of the URL, that is, https://search.lilo.org/results.php?.

8. Change the operator from Full to Starts.

9. Click the plus icon (+) to add the criterion.

60 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

The starting URL is added as the main criterion and the page is now fully recognized.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 61

3.8 Identify UI Elements for the Search Results

Context

We now want to retrieve the results. Let's select the entire DIV results to see what's happening. Selecting the DIV (id=results) won't allow us to retrieve the results but instead, it will make it easier to select a DIV result (class=result).

DIV with id=results

62 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

DIV with class=result

Let's select the first DIV (class=result).

Procedure

1. Double-click to add this DIV.At the moment, the DIV is unrecognized.

2. Add the criterion class=result.

The DIV is now recognized.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 63

However, only the first DIV can be used so we need to fix this.3. Use the Occurs property of the criteria subscreen. This pattern will recognize all DIV elements that have the

same criteria.

64 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

4. Rename oDIV to oResult.Let's select the Both radio button to switch to combined mode, see what has been recognized, and locate the nested elements. In the screenshot below, the object oResult is repeated and each element is followed by []. This represents an index starting with zero. The first block (DIV class=resultthumbnail) contains the description of the Web search result.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 65

5. Click the second block (DIV class=resulturl). This contains the URL of the Web page found by the search engine.

66 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

6. Double-click the first block (DIV class=resultthumbnail) to add it.

For now, it will be unrecognized.

7. Go to the Parameters panel and in the Ancestor property, choose oResult.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 67

8. Rename the item from oDIV to oResults.

9. To select the second block (DIV class=resulturl), select the Occurs property in the criteria subscreen.

You may notice that the DIV is followed by [][]. This represents an array with several rows and two columns.

oResults is now completed. Access to the Occurs property is also available in the property panel.

68 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

3.9 Modify the Workflow and Add the Search Results

Context

We will now use the pResults in our workflow and populate a table (or an array).

Procedure

1. Check that you have saved your project.2. Go to the Workflow perspective and open the workflow.3. Drag & drop the new page to the canvas.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 69

4. Double-click to open the pResults.

70 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

We'll now use the getTable activity to retrieve all of the results.

5. Drag & drop the getTable activity to the oResults block.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 71

The getTable activity is now associated with the oResults block.

If you check the properties, you'll see that the Data property has been updated.

72 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

The corresponding context has also been updated.

3.10 Add Excel Activities

Context

In the step Modify the Workflow and Add the Search Results [page 69], we populated a table or array. We will now use this table to populate a spreadsheet.

Procedure

1. Expand the Excel Lib activities category.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 73

2. Add and connect the following activities in this order: Init Excel, Create Excel, Set Range table, and Release Excel.

74 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

3. Init Excel starts Microsoft Excel. Leave the default options.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 75

4. Create Excel creates an Excel spreadsheet. No specific properties are required for this.

5. Set Range table prepares the data to copy from the Web page.

6. Set the start column to 'B' (do not forget the single quotation marks before and after the value), set the start row to 2, and select the contextual data by expanding the context (oResults).

76 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

Now your properties should now look like this:

7. Make sure that Excel integration is activated for your project. To do so, choose File Edit Project... and on the Libraries tab, select Excel Integration under Microsoft Office.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 77

3.11 Correcting the URLs

Context

You might have noticed that the URLs for the two pages are not the same: One is www.lilo.org and the other is search.lilo.org. Because this could cause issues when you run the scenario, let's go ahead and fix it.

Open the Explorer perspective, select the application, and look the criteria defined. Due to the subdomain change (www.* to search.*), we need to change the criterion operator.

78 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

Procedure

1. In the criteria subscreen, remove the subdomain.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 79

2. Change the operator from Full to Ends.

3. Update the criteria.

80 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

The criterion defined at application level is now OK.

The different criteria for each item should now look like this:

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 81

3.12 Final Test

Context

You have successfully completed all the previous steps. We will now test the scenario.

Procedure

1. Click on Build.

If an error appears, check that you have performed the previous steps correctly.

2. Launch your project in debug mode

The Debugger appears.

82 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

3. Click on the Desktop Agent systray.

4. Click the corresponding workflow.

Some events will be displayed in the debugger.

Getting Started with the Desktop StudioWeb Search and Spreadsheet Output PUBLIC 83

Results

A Microsoft Excel is displayed that lists the search results from your Web search.

Congratulations! You have now completed this tutorial.

84 PUBLICGetting Started with the Desktop StudioWeb Search and Spreadsheet Output

Important Disclaimers and Legal Information

HyperlinksSome links are classified by an icon and/or a mouseover text. These links provide additional information.About the icons:

● Links with the icon : You are entering a Web site that is not hosted by SAP. By using such links, you agree (unless expressly stated otherwise in your agreements with SAP) to this:

● The content of the linked-to site is not SAP documentation. You may not infer any product claims against SAP based on this information.● SAP does not agree or disagree with the content on the linked-to site, nor does SAP warrant the availability and correctness. SAP shall not be liable for any

damages caused by the use of such content unless damages have been caused by SAP's gross negligence or willful misconduct.

● Links with the icon : You are leaving the documentation for that particular SAP product or service and are entering a SAP-hosted Web site. By using such links, you agree that (unless expressly stated otherwise in your agreements with SAP) you may not infer any product claims against SAP based on this information.

Videos Hosted on External PlatformsSome videos may point to third-party video hosting platforms. SAP cannot guarantee the future availability of videos stored on these platforms. Furthermore, any advertisements or other content hosted on these platforms (for example, suggested videos or by navigating to other videos hosted on the same site), are not within the control or responsibility of SAP.

Beta and Other Experimental FeaturesExperimental features are not part of the officially delivered scope that SAP guarantees for future releases. This means that experimental features may be changed by SAP at any time for any reason without notice. Experimental features are not for productive use. You may not demonstrate, test, examine, evaluate or otherwise use the experimental features in a live operating environment or with data that has not been sufficiently backed up.The purpose of experimental features is to get feedback early on, allowing customers and partners to influence the future product accordingly. By providing your feedback (e.g. in the SAP Community), you accept that intellectual property rights of the contributions or derivative works shall remain the exclusive property of SAP.

Example CodeAny software coding and/or code snippets are examples. They are not for productive use. The example code is only intended to better explain and visualize the syntax and phrasing rules. SAP does not warrant the correctness and completeness of the example code. SAP shall not be liable for errors or damages caused by the use of example code unless damages have been caused by SAP's gross negligence or willful misconduct.

Bias-Free LanguageSAP supports a culture of diversity and inclusion. Whenever possible, we use unbiased language in our documentation to refer to people of all cultures, ethnicities, genders, and abilities.

Getting Started with the Desktop StudioImportant Disclaimers and Legal Information PUBLIC 85

www.sap.com/contactsap

© 2021 SAP SE or an SAP affiliate company. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company. The information contained herein may be changed without prior notice.

Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors. National product specifications may vary.

These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP or SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. All other product and service names mentioned are the trademarks of their respective companies.

Please see https://www.sap.com/about/legal/trademark.html for additional trademark information and notices.

THE BEST RUN