【RPA】UIpath Academy

一、引導篇

1、企業標準化流程:

  • Inputs - the data that goes in the process;
  • Process Flows - the sequences of sub-processes or activities undertaken in the process;
  • Source Applications -  the applications or systems used to perform the sub-processes or activities of the process; 
  • Outputs - the result generated by the process;

2、可RPA化流程的共同特點:規則導向、重複性、標準化輸入、流程穩定

3、RPA項目流程:

  • Prepare RPA:計劃準備,明確需要優化的作業/工作流程。
  • Solution Design :流程設計,明確流程中每個環節的操作,輸入輸出和設計操作的軟件和網頁
  • Build RPA : RPA開發
  • Test RPA:測試
  • Stabilize RPA :生產驗證
  • Constant Improvement:持續優化

RPA implementation diagram expanded

 

 

 

二、編程篇

1、selectors


1、支持通配符
2、desktop採用的是patial selector,因爲採用了attach指定窗口,好處是避免其他彈窗的干擾。
3、通過在 selector editor中點擊validate按鈕來調試、repair來進行自動調整
4、通過"+變量名+"的方式在selectors中插入變量
5、採用Anchor Base定位selection對象:Anchor Base(Find Elemnet/Find Image,click/Type into)
6、採用Relative Selectior:操作步驟ui explorer -> indicate element ->indicatee anchor
7、可以通過在UI Exploror中按f2,來獲取那種點擊後立馬消失的元素

2、Image and Text Automation


1、citrix:用於錄製在遠程桌面或者虛擬服務器的操作
2、通過在錄製type into操作中添加鍵盤操作來提升輸入的準確性
3、selectedcopy複製當前選中的對象信息,screen scraping relative通過ocr捕捉+anchor捕捉需要獲取的數據
4、通過find image(activity)來判斷並等待頁面加載完畢
5、打開app,可以通過給桌面上的app設定一個shortcut快捷鍵,然後hotkey來調用
6、打開app,通過點擊全屏+hotkey(win+r)+輸入程序地址,來調動
7、可以通過在UI Exploror中按f2,來獲取那種點擊後立馬消失的元素

3、excel&data tables


3.1 代碼:


1、ctrl+k:創建變量
2、inputsTable.Rows.IndexOf(row)+1 在for循環中使用,返回當前行的行號
4、“C” + rowIndex.ToString 返回cells.C1\C2。。。
6、Integer.Parse(valueA) + Integer.Parse(valueB) 轉換爲integer格式
8、inputsTable.Rows.Count
12、datatable.select("xxx is null")

3.2 活動:


1、excel application scope
2、datatable:join匹數據,filter data table篩選數據,for each row迭代,get row item
3、get row item:返回 datetable中的具體某個值
5、add data column:爲datetable增加列
7、workbook-writerange:將數組保存爲一個新excel文件
9、excel直接賦值:write cell("C1:C"+rowsCount <- "=sum(A1,B1)")會自動循環遞增
10、Filter Data Table
11、Output Data Table 將DataTable轉化爲其他格式如文本

4、PDF


1、read pdf text:可設置讀取的頁數範圍
2、read pdf with ocr:可選擇engine來識別
3、screen scraping:獲取特定位置的大量內容
4、get text:獲取特定位置的內容,可以通過錄制獲取
5、anchor base(find element/image->get text):通過標誌獲取指定內容,處理前建議將pdf顯示比例調整爲標準

5、Mail


1、for each:system.net.mailmassage
2、mail.subject.contains("xx")
3、mail.subject.split("#".tochararray)(1).split(" ".tochararray)(0)
4、messages.count.tostring
5、mail.headers("Date")
6、filter:"[ReceivedTime] >= '" + Now.AddDays(-1).tostring("MM/dd/yyyy hh:mm:tt") + "'"
7、更多篩選邏輯查看item.find.method(outlook)
8、read text file:string.format(textfile,Now) 用變量替換文本內容,作爲郵件正文
9、take screenshot:當出現問題時,截圖併發送郵件給處理人
10、mail.sender.address.contains(row("sender").tostring)

6、Debugging & Exception Handling


1、爲每一個sequence/flowchart命名
2、slow step:慢速逐步流轉,可調節速度,options中勾選highlight
3、input actions bebug:visible、change input method,check the selecot
4、simulate click:即使被覆蓋了,也能完成單機操作
5、網頁等待加載:element exists、find element,waite element vanish
6、try catch--> log message -> rethrow
7、exception.message 錯誤信息
https://studio.uipath.com/v2018.3/docs/logging-levels

7、project organization


1、最佳實踐
- 主流程用flowchart
- 邏輯判斷用flowchart
- ui交互用sequence
- 避免使用嵌套if,用flowcharts代替
- 吧複雜流程拆解成獨立的功能模塊(invoke workflow file)
- 異常處理
- 在流程中嵌入失敗後的循環處理
- 對於涉及到invoke workflow的,在外面包裝一層try catch
- 把環境變量存到一個config文件裏面
- 用完就把對應的窗口關閉
2、invoke workflow file:可以通過點擊flow/squence右鍵直接轉換爲一個單獨了workflow文件,然後通過入出參調用

三、其他

1、Orchestrator


https://platform.uipath.com/
1、register robots(machine) -> publish project(orchestrator package) -> robots(environments) -> process -> jobs
2、創建floating robot:創建machine -> 創建robot(username:運行-cmd-whoami)-〉 啓動uipath Robot(複製machine key,url到setting中)
url:https://platform.uipath.com/
3、創建standard robot:啓動uipath Robot(setting中獲取machine name)-> 創建machine -> 創建robot -> 複製machine key,url到setting中
4、jobs:allocate dynamic所有空閒robot按照指定次數執行腳本
5、schedule:設定定時任務執行process(setting可以設置節假日)
6、jobs logs:可以通過對robot的設置修改需要記錄的logs級別,通過activity(add log field)標記帶有額外值的日誌消息
7、asserts:類似於公共的config庫,通用於任意process的input(text、bool、int、credential賬號密碼);配合activity(get assert、Get Credential-Type Secure Text)使用;可選擇全部robot,或者指定robot
8、jobs(stop);配合activity(should stop)使用,可以起到,如被stop會執行特定行爲的效果,區別於kill操作
9、queue消息隊列:多臺robot協作,配合activity(add queue item、get transaction item、set transaction status設置結果成功還是失敗)、postpone transaction item 修改item的deadline等參數、set transaction progress返回階段性變化
10、queue最佳實踐:get tans->判斷(transItem Is Nothing->log)-> assign(transaction.SpecificContent("xx").ToString) -> 判斷(值格式isnumber等-> set trans status:failed)->open app->check open(set trans failed) -> enter values -> set trans successful
11、queue items status:new、in progress、failed/successful、abandon(get後超過24h沒有返回結果)
12、failed:可以設置是否retry和次數,設置,則失敗的item會重新推送
https://docs.uipath.com/orchestrator/

2、robotic enterprise framewok


1、標準企業級開發框架:https://github.com/UiPath/ReFrameWork,新版中支持在studio中直接創建
2、double.TryParse("1234,34,49",out temp)這個方法用來查看字符串"1234,34,49"是不是能夠轉成一個double類型的數字,如果能轉換成功則函數返回值爲true,且用out temp來保存這個轉換後的double,如果不能轉換則false,temp保持原來的值不變.
3、throw:New BusinessRuleException("credential is wrong!")
4、如果不使用queue,需要修改setting中的MaxRetryNumber(2)、需要在各個模塊包括exception/finally中處理流程參數transactionItem(type:datarow)

3、tips


1、on element appear 設置repeatForever爲False
2、能用快捷鍵代替就用快捷鍵代替

4、SAP


1、activity(click text):用於ui路徑比較難獲取,click的對象是文本超鏈接。
2、1結合位置(offset)選擇,可以點擊和text相關的ui,比如複選框/下拉菜單等
3、activity(get tablecell)+結合do while循環:可爬取真個表格內容、try catch來自動終止
4、activity(get attribute)+checked:獲取複選框的選中狀態

5、Security Training系統安全


1、Studio Security:code review、securing automation packages、isolating environments、verison control(SCCS)
2、Robot Security: 
Storing Credentials(Orches\Windo)、Manipulating Sensitive Data(trust channel-vpn/data encryption/limited environment-docshare)
Isolating Environments(development\uat\production)、Package Securing
3、orchestrator Security:Retrieving Credentials、User Roles、Multitenancy多租戶、Audit Trail操作記錄、Robot Logging、Authentication Security、Account Security、

6、Licensing Training許可證配置


1、License type:ocrchestrator(server)、studio(development)、robot(attended、unattended、nonproduction測試)
2、兩種User License模式(development\attended):named 指定用戶限制用戶數量、concurrent限制同時連接的用戶數量
3、unattended\nonproduction 只適用 concurrent runtime
4、tenant;對應獨立的部門、可進行獨立的license管理。只能採用一種user license模式
5、Standalone license單機許可證:named license/Node Locked license(不同用戶使用一臺mechine)

7、Computer Vision


1、應用與需要通過圖像識別獲取ui element,但對象的顏色、大小、背景會在一定程度上發生變化。
(就是相比image match,容錯率更高)
https://docs.uipath.com/activities/docs/about-the-ai-computer-vision-activities-pack
https://forum.uipath.com/t/computer-vision-update/101751
2、最佳實踐;
robot setting:login to console-no、font smoothing-yes
對區域的selection,保持最小範圍,並保存爲變量,方便調用,不會出錯

8、2018.4新特性

8.1 Studio


1、Global Exception Handler :一次設置,代替所有的try catch handle
2、Citrix automation:通過安裝此組件,對於原本無法獲取到UI element的app按鈕(包括虛擬環境),也可以獲取到了
3、Save As Template:用來保存一整套框架(類似於REFrame),包含多個process
4、Repo Browser:通過team來共享和管理版本
5、Process Libraries:可以把process發佈成library實現複用,library加載後是以一套activity的形式提供工具支持。
6、dark thema :暗黑系主題

8.2 Orchestrator

1、webhook:當事件發生時,向制定的url發送相關信息,用於支持
2、float robot:避免經常換電腦,要把掛在robot上的信息每次都要一起遷移,很麻煩
3、dark thema :暗黑系主題

9、2019.4新特性

9.1 Studio


1、GIT Integration & Workflow Diff Demo:增加了和github的對接功能,包括clone、push、branch等操作,並支持自由對比兩個process之間的區別
2、SOAP and Swagger Libraries Demo:創建library後,可在library裏面創建和調用orchestra api
3、Edit Settings:針對Project Settings、Library Properties、Global Settings進行了優化
4、Go!:可以在studio-manage package-go中找到大量可用的package
5、Libraries and Activities per Tenant:可以在orchestra中設置,控制某個tenant發佈的lib和act不會被其他tenant共享
6、Studio Agility Pack:優化了Argument和Variable,可以通過ctrl+m創建in_arg,ctrl+shift+m創建out_arg,並可以將arg和var相互轉化生成
7、Debugging:增加了可調節速度、exception handler workflow、focus、breakpoint等特性

9.2 Orchestrator


1、Real Time Monitoring:可以在monitor中實時查看robot、job、queue的狀態
2、Libraries and Activities Per Tenant:同studio
3、Universal Blob Storage:優化了存儲邏輯,沒看懂。。
4、Encryption Key per Tenant:每個tenant獨立密鑰
5、UiPath Orchestrator Mobile app
6、UiPath Recording:可以對某個process啓用recording,然後執行jobs,查看recording信息

9.3 Activities


1、AI Computer Vision
2、Regex Builder Matches:matches支持調用正則來從文本中提取制定信息,ismatch正則校驗是否符合規則
3、IBM Lotus Notes Suppor:支持lotus notes mail
4、Bulk Add Queue Items:支持批量添加queue,通過CSV/Excel
5、PDF Activities:增加了一些PDF的操作項
6、Support for variables in Selectors:selector支持變量
7、IntelligentOCR Activities Pack:https://docs.uipath.com/activities/docs/about-the-intelligent-ocr-activities-pack

9.4 Driver


1、Citrix XenApp and XenDesktop:針對虛擬桌面的selector器
2、Native RDP Support:通過遠程協議注入,支持可以直接click selection直接抓取遠程桌面上的軟件要素
3、JxBrowser Support
4、Microsoft Edge Browser Support
5、Robot Tray

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章