In this video I will introduce you to desktop automation.
We'll be using the UiPath record feature to capture the action in our computer screen.
In this example, I will be using Windows calculator app but of course this is also applicable
to any software installed in your machine.
When you start creating workflow in UiPath, you will have an option to start from a blank
workflow or start directly with recording.
Let's select "Recording Sequence".
This will create our workflow from a recorder.
Let's name it Calculator.
Now we have 3 options here.
Record Existing will record the current running applications.
Record Web will record the action in your browser by specifying the website URL you
want to use.
The Record App allows you to specify an application you want to record.
In this case, we will be using "Record App".
Now, this will open the Windows Explorer for you to specify the location of the App.
This will be tricky if you don't know the location or the executable file of you application.
I am using Windows 8 and here's my tip.
I use Win + Q to open my Charms bar and search for the application.
I'll be typing "calculator" here.
Once you found your application, right click on it and select "Open file location".
Now it opens the file being used to open my calculaltor app.
I will copy the path, and paste it in the explorer window of UiPath then click "Open".
So there is my calculator.
I will select it and click "Open"
There.
It opened the calculator app and I am ready to start recording it.
Also, you notice that my cursor changed into a hand pointer?
That means our recorder is active.
So whatever you click on the screen, it will record it.
Let's do a simple math here.
Let's say "3 + 5 = ". So obviously it will display the result.
What we will do with the result?
Let' copy it by going to the Edit menu and select Copy.
Where do we paste it?
For now, we only know that the result is in the Clipboard waiting to be pasted.
Ok.
That’s it.
We’re done!
Let's press "Escape".
It will go back with this recorder window.
And by the way, in case you forgot a step.
We can always go back to our recording by pressing the "Record Existing" button and
go back to our calculator.
Let's click "Save and Close" to save our recording.
So here it is.
You can see the step by step actions being recorded through these screenshots.
This makes it easier for you to add, delete or modify your workflow.
No other automation software offers this kind of capability.
Now, remember the last activity we have is we copied the result in the clipboard?
Our next action is to get that data and store it in UiPath so we can use it anywhere in
our workflow.
We can use this activity called "Get from Clipboard".
This will fetch the last data stored in our Clipboard which is the number 8 and save it
in UiPath Output through this variable.
As we discussed in the previous tutorials about variables, we can't directly change
it here.
So we go to the Variables panel, and we can rename it here.
let's say, "result".
Let's add a message box here to show that result.
So what we're trying to display in our message box, is the "result"
Ok.
Let’s run it.
Perfect!
To sum up what happened, it opened the calculator app, performed our calculations and copy the
result in the Clipboard.
Then it displays it in our message box.
Let's add some few more activities in our workflow to make it perfect.
Let's add a delay activity right after the app is opened.
This would allow 1 second for the calculator app to be opened before the click events will
trigger.
Next, we put "Close Application" activity to close the app after the needed actions
are performed.
Before I put this activity, let me explain what's going on in our workflow.
Do you notice that our recorded actions have been enclosed in these boxes?
The first one is the "Open calc", which opens the calculator app...and another box which
will perform the operations like clicking the numbers.
These are what we call containers.
The activities inside these containers will have a unique identifier relative to its parent
container.
This is how UiPath identifies what needs to be clicked when running the workflow.
We call these unique identifier...
"selectors" which are automatically generated by UiPath in each activity.
Let's talk more on these in the upcoming lessons.
Next, you noticed that after we clicked the Edit menu, it generates a separate container?
Let me open the calculator app.
That's because after clicking the Edit menu, it opens this new window.
It appears that it's still inside the main window.
But the way these applications has been programmed is by using sub-windows that is being attached
to the main window.
That's the reason why in Uipath, it considers it as a separate window.
Thus it will create it a new container.
Another way to easily view the structure of our worflow is by going to the "Outline" panel.
This will gives you an easier way to check the hierarchy of how activities are being
arrange in each container.
Going back to our "Close Application" activity.
Let’s move it here.
Right below the orange box.
Because if we put it inside the orange box, UiPath will gives an error since this entry
isn't part of the "Attached window menu".
Let’s learn on how to fix errors in the next chapters
In this activity, we need to indicate what application we need to close.
So in this case we highlight the calculator window.
Let's also move our message box right after the calculator has been closed.
Let's run it one more time.
There.
As you see there is one second delay before it performs the operation.
And it also closes the calculator before displaying the message box.
In the next video, let's find out how we troubleshoot errors in the workflow.
Let's learn how to debug workflow in UiPath.