본문 바로가기
UiPath/UiPath Practice

UI Interactions : Demo1 - Part1 : Getting text from a Notepad

by kimyosunnyc 2020. 10. 28.

출처 : UiPath Academy

Video Demo1 - Part1 : Getting text from a Notepad

미리 정의된 메모장 파일에서 텍스트 가져오기

 

Demo 실행화면


📌 설정방법

What is RPA.txt
0.00MB

참고 : "What is RPA.text" 파일은 위에서 다운받아 사용한다.

  • Open Application Activity를 사용하고 메모장 앱 window를 표시한다. Arguments 속성에서 "What id RPA.txt"라는 파일 이름을 지정한다.
    컨테이너 내부: 
    • 텍스트 위치를 표시하여 텍스트를 캡처하기 위해 Get Text Activity를 사용한다. 문자열(String) 변수("RetrievedNotepadText")를 만들어 캡처한 텍스트를 저장한다.
    • Log Message Activity를 사용하여 문자열(String) 변수에서 캡처된 텍스트를 표시한다.
    • Workflow(워크플로우)가 끌날 때, Close Application Activity를 사용하여 메모장 파일을 닫는다.

1.1 GetNotepadText (Sequence)								
	Private = False							
	Activities							
		1.4 Open Application 'notepad.exe What' (OpenApplication)						
			Selector = <wnd app='notepad.exe' cls='Notepad' title='What is RPA.txt - Notepad' />					
			FileName = C:\Windows\System32\notepad.exe					
			Arguments = What is RPA.txt					
			Private = False					
			Body					
				1.5 Do (Sequence)				
					Private = False			
					Variables			
						RetrievedNotepadText(String)		
					Activities			
						1.9 Get Text 'editable text' (GetValue)		
							Value = RetrievedNotepadText	
							Target	
								Selector = <wnd aaname='Text Editor' cls='Edit' /><ctrl name='Text Editor' role='editable text' />
								WaitForReady = INTERACTIVE
							Private = False	
						1.6 Log Message (LogMessage)		
							Message = RetrievedNotepadText	
							Level = Info	
							Private = False	
		1.2 Close Application 'notepad.exe What' (CloseApplication)						
			Target					
				Selector = <wnd app='notepad.exe' cls='Notepad' title='What is RPA.txt - Notepad' />				
				WaitForReady = INTERACTIVE				
			Private = False					

📌 OUTPUT

Output

Debug started for file: GetNotepadText
UiInteraction_OutputMethods execution started
What is Robotic Process Automation?
Robotic Process Automation is the technology that allows anyone today to configure computer software, or a robot?to emulate and integrate the actions of a human interacting within digital systems to execute a business process. RPA robots utilize the user interface to capture data and manipulate applications just like humans do. They interpret, trigger responses and communicate with other systems in order to perform on a vast variety of repetitive tasks. Only substantially better: an RPA software robot never sleeps, makes zero mistakes and costs a lot less than an employee
UiInteraction_OutputMethods execution ended in: 00:00:01
반응형

댓글