Robocorp Beginners Tutorial - Getting Started with Robocorp RPA
Summary
TLDR在这个视频中,Thomas 向我们展示了如何开始使用 Robocorp 来创建机器人。首先,他指导我们下载并安装 Python,然后是 Visual Studio Code (VS Code)。接下来,他介绍了如何安装 Robocorp 代码扩展和 Robot Framework 语言服务器扩展。在创建一个新的 Robocorp 项目后,Thomas 展示了如何使用 Robocorp 自动生成项目文件,并选择了标准 Robot Framework 模板。随后,他详细介绍了如何编写代码来构建一个简单的机器人,该机器人可以向 CRM 系统添加客户信息。他还展示了如何使用 Robocorp 的关键字来定义任务,并在任务中调用这些关键字。最后,他演示了如何运行机器人,并保持浏览器打开以查看结果。这个视频是一个很好的入门指南,适合那些想要快速开始使用 Robocorp 的人。
Takeaways
- 🚀 **安装Python**:访问python.org下载并安装最新版本的Python,确保在安装过程中勾选了将Python添加到环境变量的选项。
- 💻 **安装VS Code**:从code.visualstudio.com下载并安装Visual Studio Code(VS Code)。
- 📚 **安装Robocorp扩展**:在VS Code中安装Robocorp Code和Robot Framework Language Server扩展。
- 📁 **创建项目文件夹**:在文档中创建一个名为'robocorp projects'的文件夹来存储所有Robocorp项目。
- ✅ **创建新项目**:在Robocorp Projects文件夹中创建一个名为'getting started with robocorp'的新文件夹,并在其中初始化项目。
- 🔑 **选择项目模板**:选择Standard Robot Framework模板来创建项目,这个模板使用Robot Framework语言。
- 🛠️ **编写代码**:在`tasks.robot`文件中编写机器人的代码,这是构建第一个机器人的起点。
- 🌐 **使用RPA工具**:通过RPA Dash Unlimited网站了解将要构建的机器人,该机器人将添加客户到CRM系统中。
- 📝 **定义关键字**:在Robot Framework中创建关键字(类似于其他编程语言中的函数),例如`open website`和`add customer to CRM system`。
- 🔗 **定位元素**:使用浏览器的开发者工具来定位网页元素,并通过ID或类名来引用它们。
- 🔑 **输入数据**:使用`input text`关键字为网页上的输入字段填充数据,如公司名称、联系人、地址、邮编、城市、国家、电话和电子邮件。
- 🔖 **提交表单**:使用`submit form`关键字来提交表单,添加客户信息到CRM系统中。
- 📑 **运行脚本**:在VS Code中运行脚本,观察Robocorp如何自动执行定义的任务,并将新客户添加到CRM系统中。
Q & A
如何开始使用Robocorp?
-首先需要下载并安装Python,然后下载并安装VS Code,接着从Robocorp官网下载并安装两个扩展:Robocorp Code和Robot Framework Language Server。之后创建一个新的Robocorp项目文件夹,并使用Robocorp自动生成项目文件。
在安装Python时,为什么需要勾选'Add Python to PATH'?
-勾选'Add Python to PATH'可以让Python在Windows的任何文件夹下都能被执行,否则只能在Python的安装目录下执行。
为什么推荐安装Robot Framework Language Server扩展?
-虽然这个扩展是可选的,但它可以提供更好的语法高亮、代码补全和错误提示等功能,从而提高开发效率。
在VS Code中如何创建一个新的Robocorp项目?
-可以通过按下Ctrl+Shift+P(或Mac上的Command+Shift+P),输入'create robot'并选择一个项目模板来创建。
如何保持浏览器在Robocorp机器人运行后不关闭?
-在设置中添加`Autoclose=False`,这样浏览器在机器人运行结束后不会立即关闭,方便查看结果。
在Robocorp中,如何定义一个关键词(keyword)?
-在项目的`tasks.robot`文件中,通过创建一个带有三个星号的section,并在其中定义关键词,关键词类似于其他编程语言中的函数。
如何使用Robocorp打开一个网站?
-可以使用Robocorp内置的`Open Available Browser`关键词,并提供网站的URL作为参数。
在Robocorp中,如何向CRM系统添加客户信息?
-通过定义一个名为`Add Customer to CRM System`的关键词,使用`Input Text`关键词填充表单中的各个字段,然后使用`Submit Form`关键词提交表单。
如何获取网页中输入框的定位符(locator)?
-可以通过在浏览器中右键点击输入框并选择'Inspect'来查看元素的HTML代码,从中找到元素的ID或其他属性作为定位符。
在Robocorp中,如何引用已定义的关键词?
-在`tasks`部分,使用自然语言描述任务,并在需要执行关键词的地方,使用`<keyword_name>`来引用已定义的关键词。
如何运行Robocorp项目中的机器人?
-在VS Code中,可以通过Robocorp Code扩展来运行机器人,它会打开浏览器,执行机器人,并且根据设置决定是否在执行结束后关闭浏览器。
如果我想将这个视频推荐给其他人,应该怎么做?
-如果觉得视频有用,可以给视频点赞(thumbs up),这有助于其他人发现这个视频,并且可以订阅发布视频的频道,以便观看后续的视频。
Outlines
🚀 开始使用Robocorp构建第一个机器人
本段主要介绍了如何开始使用Robocorp。首先,需要从python.org下载并安装最新版本的Python,并确保在安装过程中勾选了'Add Python to PATH'以便在任何文件夹中都能执行Python。接下来,从code.visualstudio.com下载并安装Visual Studio Code(VS Code)。之后,转到robocorp.com下载并安装两个扩展:Robocorp Code和Robot Framework Language Server。安装完成后,创建一个新的Robocorp项目文件夹,并使用Robocorp自动生成项目文件。最后,通过选择标准Robot Framework模板开始构建第一个机器人,并介绍了如何通过RPA-Dash网站获取示例机器人,该机器人用于将客户信息添加到CRM系统中。
🛠️ 定义关键词和任务
在Robocorp中,关键词类似于其他编程语言中的函数,可以被定义并在任务部分调用。首先,定义了'open website'关键词,使用Robocorp内置的'open available browser'关键词,并传入要打开的网址作为参数。接着,定义了'add customer to CRM system'关键词,涉及到多个步骤,包括输入公司名称、联系人、地址、邮编、城市、国家、电话和电子邮件。每个输入步骤都使用了'input text'关键词,并指定了相应的定位器和要输入的文本。此外,还介绍了如何通过'submit form'关键词提交表单。
📝 编写任务并运行脚本
在定义了关键词之后,需要在任务部分编写机器人的工作流程。首先,使用'open website'关键词打开CRM应用程序的网站。然后,使用'add customer to CRM system'关键词将客户信息添加到CRM系统中。在Robocorp中,任务部分允许用户以自然语言描述他们想要执行的操作,然后通过关键词来实现这些操作。最后,关闭浏览器并运行脚本,展示了如何通过Robocorp成功地将新客户添加到CRM系统中。如果设置了'Auto close'为false,则Robocorp在运行后不会立即关闭浏览器,这样用户可以看到机器人执行的结果。
Mindmap
Keywords
💡Robocorp
💡Python
💡Visual Studio Code (VS Code)
💡扩展(Extensions)
💡项目模板(Project Template)
💡Robot Framework
💡关键字(Keywords)
💡任务(Tasks)
💡设置(Settings)
💡RPA(Robotic Process Automation)
💡CRM系统
Highlights
介绍了如何开始使用Robocorp,包括下载Python、VS Code,以及构建第一个机器人。
强调了从python.org下载最新版本的Python并启用'Add Python to PATH'的重要性。
展示了如何从code.visualstudio.com下载并安装VS Code。
推荐在VS Code中安装Robocorp Code和Robot Framework Language Server两个扩展。
说明了如何在文档中创建Robocorp项目文件夹并选择项目模板。
通过实例演示如何使用Robocorp构建一个添加客户到CRM系统的简单机器人。
解释了如何在VS Code中使用Robocorp创建关键词(functions)并编写任务(tasks)。
展示了如何使用Robocorp的内置关键词'open available browser'打开网站。
演示了如何通过检查元素来找到网页输入框的ID,并使用'input text'关键词填充数据。
介绍了如何使用'submit form'关键词来提交表单。
强调了在Robocorp设置中添加'Auto close=False'以保持浏览器打开状态查看结果的重要性。
展示了如何在任务(tasks)部分调用关键词,以及如何用自然语言描述任务。
解释了Robocorp机器人的三个主要部分:设置(settings)、任务(tasks)和关键词(keywords)。
演示了如何运行Robocorp脚本,并查看其在CRM系统中添加新客户的结果。
鼓励观众如果视频有帮助的话点赞,订阅频道,并期待下个视频。
整个视频是一个完整的Robocorp入门教程,从安装到构建简单的RPA机器人。
提供了一个实际的RPA用例,即如何自动化添加客户信息到CRM系统中。
强调了使用ID定位网页元素的准确性,因为ID应该是唯一的。
展示了如何通过Robocorp的自动化脚本快速且成功地完成任务。
Transcripts
hey thank you so much for watching this
complete video on how to get started
with robocorp in this video we will
download python we will download vs code
and we will build as well our first bot
with robocorp my name is Thomas and
you're watching Tom stack Academy let's
start right away
and the first thing we have to do is
installing python so navigate to
python.org downloads and I'm going to
click here on download python you see
that currently the latest version is
3.11 but it is very well possible that
at the moment that you are downloading
python there is already a new version
just download the latest version and
install it into your machine
after the download has finalized click
on the executable to start the
installation process
and there is one step that's very
important and that's to enable at
python.exit to pads because otherwise
python cannot be executed from every
folder within Windows just enable this
checkbox and then click on install now
after the installation was successful
I'm going to close this window and we're
going to continue with the installation
of vs code navigate to
code.facialstudio.com and then click
here to download the latest version
when the download has been finalized
click on executable and follow the
installation steps
you can now launch Visual Studio code
and click on finish
and with the installation of vs code has
been finalized you're going to navigate
to robocorp.com download I'm going to
download two extensions the first one is
this one RoboCop codes just click on
install from vs Marketplace and you will
be redirected to vs code's own
Marketplace
clicking on install
open Visual Studio code
and can see the extension right here
click on install again once you've
installed this extension let's continue
with the next one
and that's this one the Robot Framework
language server this one is optional but
I highly recommend to download it as
well
click install open Visual Studio codes
and start the installation once both
extensions have been installed navigate
to file
click open folder and now we're going to
determine where we want to save our
robot and I'm going to do that in
documents robocorp projects so this is a
folder I created to store all my
robocore projects and in that folder I'm
going to create a new folder that I'm
going to call
getting started with robocorp
select the folder and I click on select
folder after the project has been
created it's time to fill it up with
files and roboclub can do that
automatically for us just press Ctrl
shift p or command shift p if you're
using a Mac computer
and then I'm going to type create robot
like this press enter Then you can
choose the project template that you
would like to use for example you can
use the basic python template and there
is another video on my channel that
explains how to set up a python project
with robocorp for now I'm going to go
for the standard Robot Framework
template and this template uses the
Robot Framework language so click on
this one
and then you can use the workspace
folder that we are currently in so just
press use workspace folder and now you
see on the left side that the project
has been created navigate to tasks.robot
and that's where we're going to type our
actual code
now we are ready to start building a
first robot and the robot that we're
going to build is this one navigate to
RPA Dash unlimited.com
and scroll down and then click on
navigate to YouTube example applications
and course material
now we're going to navigate to robocore
built your first robot with robocorp so
click on course material
and the robot that we're going to build
today is going to add customers to a CRM
system so what we're going to do we're
going to add customer information to
those fields
and now we're going to click on ADD
transaction
and that way this customer will appear
in this form and we can then proceed
with the next one so this is one of the
most simple RPI use cases and it's a
very good robot if you just want to make
a quick start with robocorp so navigate
back to vs code and how robocorp is set
up of course you have the settings and
in the settings I'm just gonna add a new
line because I want to import the
library and the library that I'm going
to import press tab
is RPA dot browser dot selenium this one
and what's very important what RoboCop
normally will do it opens the browser
then it will run the robot and then
it'll immediately close the browser and
that's very inconvenient because you
cannot see the result of your robot so
if you want to avoid that just press tab
here
now we're going to add Auto underscore
close is equal to dollar sign curly
brackets false and that way we will keep
the browser open after robocorp has been
running so you can see the result of the
robot then we have a section tasks and
I'm just going to remove this text here
I'm going to add a section
and you add a section with three stars
and I'm going to add the section
keywords
so how aerobical breaks we're going to
create two keywords and then we're gonna
call these keywords from the task
section and these keywords are a bit
like functions and other programming
languages so here we declare functions
and then in the test section we're going
to call them so let's start with the
first keywords so the first function and
that one is really simple I'm just going
to call it open website
and it's going to open this website
robco also has its own keywords and one
of those keywords is open available
browser so just start typing
and you should see suggestions popping
up like this and open available browser
if you press tab you also see the
arguments that it needs I see here that
this keyword needs one arguments which
is the URL and as of type string and I'm
just going to provide this argument so
just copy this URL
space it here like this and then press
enter
press shift tap to go back to left side
so you see how easy this was we've just
created our first keyword let's proceed
to the next one
and that's add customer
to CRM system
so this is the name of the keyword
this is also how we're going to refer to
this keyword later
then press tab and if we go back to your
website see that there are a number of
fields that we want to type and if I'm
I'm just gonna start with typing the
first one and the keyword that we're
going to need is input space text
and then press tab
like this so it's very important that
this is a space and this is a tab I see
that this keyword input text needs two
arguments the first one is the locator
and the second one is the text that you
want to type and the locator I'm going
to click here on company name
so just right click here on this input
field
and then click on inspect and you see
the HTML code on the right side
and then you see how this input element
has been built up and if you focus on
this input element and if you scroll
here you also see that you scroll to the
HTML elements if I click on this one
then you see how this HTML element has
been built up so you see if it is of
type text it has class form control and
it has ID company name and what I try to
do most of the time is at the user ID
you can also use a class but you will
see that the class is not always unique
so if you can choose I would always
start with the ID because that should be
unique in this case I'm going to copy
this ID
company Dash name and I'm going to paste
it in vs code as a locator
so the ID of the element is not a
locator and the text that I want to type
in this form so it is the company name
so let's start with Toms
Tech Academy
press enter now we're going to proceed
with the next input text input
text
tab
and the next one click on inspect and
you see here the ID is company Dash
contact so just copy it
base it here and I'm going to build a
company contacts so I'm just going to
type Thomas Johnson here
now we're going to proceed with the next
one input text
tap
and the third one that's the address and
if you click here on inspect you can see
that the ID is address here so you just
copy that
and my address is long
313
C to the fourth one one two three four
and that's the zip code and you see here
that ID is also zip code
[Music]
zip codes and my zip code is one two
three four a b touch zip codes are a bit
different than ZIP codes in the rest of
the world they contain numbers and also
letters
input text
and after the ZIP code we get the city
and the locator should also be City so
let's just double check that City
City
and my city is Mass Effect
country inspects and you see the ID is
country
[Music]
and free
the Netherlands
and then we still have telephone
which has ID telephone and email which
has ID email
[Music]
okay now there are a number of things
that we can do to serpent this button
uh we can click it physically but there
is also another way and that's a very
easy one
that's just the keyword submit form and
it doesn't have any arguments so just
press enter and then we've also
completed our second keyword so we have
now two keywords we have open websites
and we also have ADD customer to CRM
system so those are the keywords that we
have but if we execute the script they
are not directly called because we still
have to refer to them we're going to do
that in the tasks section and we edit
RoboCop works that you first dial Rubik
of what you want to do just explain in
the normal human language and then you
refer to the keyword so I'm just gonna
say
open the website of the
CRM application
I'm going to press enter Tab and then
I'm going to refer to the keyword and
this is the keyword right so it's just
open website
and you should also see it in the
suggestions here
like this
and then the second keyword that I'm
gonna refer to so the second task that
we execute is we're going to add a
customer to the CRM system
at One customer to the CRM system and
the keyword that we're going to refer to
is this one
so just tap here Ctrl V
so this is the anatomy of a robot in
robocorp first you have settings you can
include as many libraries as you want
here then you have the tasks where you
refer to the keywords and then you have
the keywords here where you define what
those keywords should do okay let's
close our browser
and run the script
and if you didn't Define all to close
this false here then RoboCop would not
immediately close the browser so that's
why this keyword is so useful
I see that robocorp has just entered a
new customer to my CRM system it was
very fast and it was also successful
I hope this video was useful for you if
it was please give it a thumbs up and
that will also help other people to find
this video don't forget to subscribe to
my channel and I hope to see you in the
next video
関連する他のビデオを見る
![](https://i.ytimg.com/vi/EPdivac0kwE/hq720.jpg)
Create a List of Todo items in SwiftUI | Todo List #1
![](https://i.ytimg.com/vi/iJjSjmZnNlI/hq720.jpg)
The RIGHT WAY To Build AI Agents with CrewAI (BONUS: 100% Local)
![](https://i.ytimg.com/vi/UeG9RAVE8sE/hq720.jpg)
Unreal Engine 5 RPG Tutorial Series - #20: AI Behavior Trees Patrolling
![](https://i.ytimg.com/vi/ugiNsb9pc8k/hq720.jpg)
Unreal Engine 5 RPG Tutorial Series - #14: Equipment System
![](https://i.ytimg.com/vi/zIllLXkkHB0/hq720.jpg)
How to Set Up an Unreal Engine 5 Git Repository - SourceTree Source Control
![](https://i.ytimg.com/vi/cV0cPElzg4A/hq720.jpg)
The Last Prompt You'll Ever need - Synapse_CoR
5.0 / 5 (0 votes)