1 题目
In this exercise, you will create a UiPath automation that performs the steps below.
To achieve this, you will use the REFrameWork as the starting template and follow the UiPath development best practices.
The solution has to be scalable, so create two separate projects (sub-processes):
- One for the Dispatcher (add to queue);
- Another one for the Performer (consume queue).
Make sure you use a connection to an UiPath Orchestrator for testing.
Here are the steps performed by the Robot in the Dispatcher:
1. Log in to https://www.acme-test.com.
2. On the landing page, Dashboard, click or hover over the Invoices menu item and then click on Search for Invoice. Click on Display All Invoices.
3. Scrape the data from the whole table displayed.
4. For each row in the datatable, Add a queue item containing the Invoice Number, Vendor Tax ID and Date.
5. Close ACME System 1.
Here are the steps performed by the Robot in the Performer:
1. Log in to https://www.acme-test.com.
2. For each Queue Item:
- Click or hover over the Invoices menu item and then click on Search for Invoice;
- Type the Invoice Number retrieved from the queue item into the Invoice Number field field;
- Click on Search;
- Extract the values for the Vendor Tax ID and Date and compare them with the values from the queue item (check for EXACT match for all fields!);
- If the values are not matching, this should be categorized as a Business Rule Exception, and the queue item should have the status set accordingly;
- If the values match, the transaction is successful.
Note: Navigation can be achieved in multiple ways by the robot - choose whichever you find best.
Constraints to follow in the development, using the REFrameWork:
1. TransactionItem datatype should be a QueueItem.The process should recover and retry 2 times in case of errors in navigation between the Invoice Search and Invoices - Search Results pages. One transaction is the action of navigating to the Invoices Search page, searching for the Invoice Number and scraping the values from the resulting one row table.
2. Create a separate workflow file for the Login to ACME. File input arguments: URL < String >; Username < String >; Password < SecureString >.
3. Create a separate workflow file for closing ACME.
4. Add the ACME_URL and ACME_Credential to the Excel Config file.
5. Populate InitAllApplications.xaml from the Framework folder with Invoking the Login to ACME and navigation to the Work Items.
6. Populate CloseAllApplications.xaml from the Framework folder with Invoking the Close ACME.
7. Populate KillAllProcesses.xaml from the Framework folder with killing the process used.
8. Populate the Process.xaml file with the following actions: Navigation, Searching for Invoice Number, Scraping, Checking if the values match, Handling the Business Rule Exception.
Important Note: Don't use external file references outside of the project folder (including Orchestrator Assets). Place all the used files within the project folder, zip that folder and upload it to the UiPath Certification Platform.
Zip ALL the used workflow files AND the output Excel file. Then upload the .zip file to the UiPath Certification Platform.
2 考前准备(连接Orchestrator和注册)
需要安装好UiPath Studio软件,注册社区版,连接Orchestrator。
软件安装就不详细介绍了,说一下连接Orchestrator和注册。
进入Orchestrator后,新建Machine,这里需要注意Name不能随便起,需要录入本机的计算机名,否则后面会一直连接不上。
增加robot,关联刚才建立的Machine,Domain\Username需要通过cmd,whoami指令查看,密码就是本机Windows密码。
完成后回到本机,双击 ,右下角出现Ui图标后,点击设置:
从Orchestrator拷贝URL,和Machine Key,粘贴到这里,点击connect,即可:
连接成功后,Orchestrator中robot的状态也会跟着更新为Available。
3 通用功能
3.1 根据模板建立项目
根据考题要求必须使用REFrameWork这个模板建立新的项目:
3.2 修改config文件
在config文件(在模板Data目录中)的Assets页签中增加ACME_URL和ACME_Credential,以方便在后面调用。
将Constants页签中的MaxRetryNumber改成2。
修改Settings页签中的OrchestratorQueueName为queue1(后面会用到)。
3.3 在Orchestrator中保存URL和登陆用户名密码信息
在Orchestrator中增加两个Assets,名称需要与config文件保持一致,否则后续程序无法获取:
3.4 建立登陆和关闭ACME系统模块
ACME系统是一个指定的测试环境,我们需要将登陆和关闭系统模块化。
建立ACME_login.xaml,这部分的重点是需要调用Orchestrator中两个Assets内容。
- 用户名密码。这部分调用模板中的GetAppCredentials.xaml功能,新增2个传入参数。需要注意的是传入参数需要和Orchestrator里的一致。
- 获取URL。增加名称为URL的String变量,拖入Get Asset功能,在Input中设置Orchestrator中的URL名称,在Output中设置URL变量。
后面就用以上信息可以登陆系统了:
建立ACME_close.xaml,这部分就不多介绍了。
3.5 完善模板中的几个模块
在InitAllApplications.xaml 中调用刚才做好的ACME_login.xaml。
在 CloseAllApplications.xaml中调用刚才做好的ACME_close.xaml。
在KillAllProcesses.xaml中增加Kill Process过程。
4 第一题(输出Queue)
建立第一个任务,最好选择flowchart,我们取名为Dispacher.xaml
1、通过调用InitAllApplications.xaml 模块登陆系统;
2、根据题目要求点击点击再点击;
3、通过DataScraping功能抓取数据表,保存在一个DataTable变量中;
4、在Orchestrator中增加一个Queue,命名queue1;
5、通过For each row和Add queue item功能向Orchestrator输出Queue。
这里需要注意Add Queue Item需要设置输出的字段,具体方法如下图:
QueueName设置为queue1,与Orchestrator中保持一致。
6、通过调用CloseAllApplications.xaml关闭系统。
5 第二题(消费Queue)
第二题可以直接利用模板中的main.xaml。
- 修改模板中的Process.xaml ,在其中增加以下Sequence:
2、Navigation:点击点击再点击,不多说了;
3、Searching for Invoice Number:通过Assign组件将从queue读来的InvoiceNumber赋值到本地变量
然后开始搜索。
4、Scraping:获取查询结果到2个本地变量;
5、Checking if the values match:对比从queue读来的变量和查询结果变量;
6、Handling the Business Rule Exception:添加if组件,如果对比结果一致,通过Set transaction status设置状态为Successful,如果对比结果不一致,设置Business Rule Exception。
这样整个题目就做完了。最后需要注意的是,压缩成zip文件夹上传,不能使用rar格式。