To implement Robotic Process Automation, a feasibility study has been performed using the UiPath and AutoIT. I’ve used the community edition of UiPath and Freeware of AutoIT to kick-start the feasibility study task. The following information is about to cover the end-user action specific script preparation and execution without Robot. In the forthcoming post, I will be covering the Robot specific execution using different RPA tools available in the market. I’ve used Windows x64 bit machine with Win10 OS in this dry run.
Tried to prepare script for a simple scenario of open a pdf file using Adobe Reader (Open Adobe Reader, Open pdf file, Close Adobe Reader). UiPath is a pure Robotic Process Automation tool, which was used to prepare the script using the Automated Record option and I’ve tried to do the same task using the AutoIT under the manual mode of script preparation (Writing script in IDE)
Before getting into the action items, I would like to share some important information as specified below;
What is Robotic Process Automation?
Robotic Process Automation (RPA) is the application of technology that allows employees in a company to configure computer software or a “robot” to capture and interpret existing applications for processing a transaction, manipulating data, triggering responses and communicating with other digital systems.
What is UiPath?
UiPath is a leading Robotic Process Automation vendor providing a complete software platform to help organizations efficiently automate business processes.
https://www.uipath.com/community
What is AutoIT?
AutoIt is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks.
Coming to the script preparation task using AutoIT, please find the below script which has been prepared (typed) using the AutoIT user defined functions; Please refer the comments before each user-action triggered ones;
#include <Constants.au3>
#include <ScreenCapture.au3>
#include <Date.au3>
#include <MsgBoxConstants.au3>
;
; AutoIt Version: 3.0
; Language: English
; Platform: Win x86/x64
; Author: gopekanna@gmail.com
;
; Script Function:
; Open Adobe Acrobat application, open the pdf file in the adobe acrobat application and close the ;adobe acrobat application.
;
; Location of the HTML test report
Local $location = “\Test\Adobe_Test_Report.html”
AdobeTest()
If @error <> 0 Then Exit MsgBox(16, “Adobe Acrobat”, “Error while accesing the pdf. Please read the user manual. @error = ” & @error)
Func AdobeTest()
; Run Adobe Reader
Run(“C:\Program Files (x86)\Adobe\Acrobat 10.0\Acrobat\Acrobat.exe”)
If @error <> 0 Then Exit MsgBox(16, “Adobe Acrobat”, “Error while opening the pdf Application. Ensure Adobe Acrobat installed in this computer. @error = ” & @error)
; Wait for the Adobe application to become active.
WinWaitActive(“[CLASS:AcrobatSDIWindow]”)
; Maximize the window
WinSetState(“[CLASS:AcrobatSDIWindow]”, “”, @SW_MAXIMIZE )
; Open the pdf file
WinActivate(“[CLASS:AcrobatSDIWindow]”,”Adobe Acrobat Pro”)
Send (“!f”)
Send (“{ENTER}”)
WinWaitActive(“Open”)
Sleep(2000)
;Send (@MyDocumentsDir & “\Test\Certificate.pdf”)
Send (“C:\Temp\Certificate.pdf”)
Send (“{ENTER}”)
Sleep(2000)
; Get the title of the screen
Local $sText = WinGetTitle(“[ACTIVE]”)
Sleep(2000)
;Ensure the expected window is displayed
If StringInStr ($sText, “Certificate.pdf”) Then
; Take screenshot
_ScreenCapture_Capture(@MyDocumentsDir & “\Test\Pdf_File_Screenshot_Success” & @MDAY & @MON & @YEAR & @HOUR & @MIN & @SEC & “.jpg”)
Sleep(2000)
; Generate the HTML Report for success
FileWrite(@MyDocumentsDir & $location, “<b>PASS:</b> PDF file successfully opened. ” & “Date:” & @MDAY &”/”& @MON &”/”& @YEAR & ” ” & “Time:” & @HOUR & “:” & @MIN &”:”& @SEC & “<br/>”)
Else
; Take screenshot
_ScreenCapture_Capture(@MyDocumentsDir & “\Test\Pdf_File_Screenshot_Failure” & @MDAY & @MON & @YEAR & @HOUR & @MIN & @SEC & “.jpg”)
; Generate the HTML Report for failure
FileWrite(@MyDocumentsDir & $location, “<b>FAIL:</b> Error while open the PDF file. ” & “Date:” & @MDAY &”/”& @MON &”/”& @YEAR & ” ” & “Time:” & @HOUR & “:” & @MIN &”:”& @SEC & “<br/>”)
EndIf
; Close the Adobe Reader application
WinClose(“[CLASS:AcrobatSDIWindow]”)
; Wait till the application closed
WinWaitClose(“[CLASS:AcrobatSDIWindow]”)
MsgBox(64, “Message Box”, “Execution successfully completed!”,5)
EndFunc
; Finished
Please find the below video to visualize the execution part using AutoIT;
Now UiPath coming into action based on the below script preparation steps using automated record option.
Please refer the below link for Video tutorials and User Guide to try UiPath community edition in your machine;
https://www.uipath.com/tutorials
- Download and Install the UiPath Studio using the below URL;
https://www.uipath.com/community-edition-download
- Open the UiPath Studio
- Create a new blank project “TestRun”
- Create a new sequence “TestRun” à xaml file
- Drag and drop “Open Application” and select Adobe Reader exe
- Open the Adobe Reader Application
- Start recording
- Click “Open” option under File menu
- Select the file location (Used Manual Recording option of “click by text”)
- Select the pdf file “Certificate.pdf”
- Wait for 5 seconds
- Close the pdf file
Please find the below video file to visualize the execution part in UiPath Studio;
Thank you!!!
Looking forward to move towards the Business Process use cases in the forthcoming posts…