Example - Notepad Automation
In this example, we will create automation to perform the following actions:
- Open the Notepad application and load a specified text file
- Insert a line of text at the end of the text file
- Save the text file
- Close the Notepad application
Prerequisites
- Create a text file Sample.txt on your desktop
- Open Notepad and load the above text file
- Open Process Designer and create a blank process. Give a name to that Process.
Process Designing
- Drag and drop Start Process Activity. Configure the following properties:
- File Name: assign "notepad.exe"
- Arguments: assign "<change-to-your-desktop-folder>/sample.txt"
- ** Process**: create a new variable of type ** Process** and provide the name of that variable here. For example: npprocess
- Create a string variable and assign some text value to be written into sample.txt
- Drag and drop Send Keys activity. Configure the following properties:
- Process: assign npprocess
- ** Text to send**: assign the variable name created in the previous step.
- Click on Element Selector and select the Notepad process from the dropdown. Select the text area UI element and press the [F2] key
- Type some text inside sample.txt opened in Notepad
- Drag and drop Mouse Click activity. Configure the following properties:
- Click Type: select Left_Click
- Process: assign npprocess
- Click on Element Selector and select the Notepad process from the dropdown. Select the File menu element and press [F2] key
- Drag and drop Mouse Click activity. Configure the following properties:
- Click Type: select Left_Click
- Process: assign npprocess
- Click on Element Selector and select the Notepad process from the dropdown. Select the File > Save menu element and press [F2] key
- Drag and drop Mouse Click activity. Configure the following properties:
- Click Type: select Left_Click
- Process: assign npprocess
- Click on Element Selector and select the Notepad process from the dropdown. Select the Close [X] menu element from top-right corner and press [F2] key
- Save the Process
- Click Run to execute the Process
Download Example