How can I create a scenario to run a program as a different user?
There are a couple of ways to create a scenario to run a program as a different user.
Windows allows you to start a program as an administrator (or a different user) by right-clicking on the application icon, and selecting the option "Run As USER".
You can create a scenario in ScenarioBuilder to imitate these actions by doing the following:
- Add a Find Image action to look for the application icon
- Add a Move Mouse and Click action as a child of the previous action. Select "Right" for Button and "Click" for Click Type in the properties.
- Add a Find Image action to look for the option "Run As USER".
Note: To capture the image, you will need to press the Ctrl key to change the image capture mode. Next, right click on the application icon to reveal the image you need to capture. Then press Ctrl key again to change the image capture mode and select the correct image.
4. Add a Move Mouse and Click action as a child of the previous action
You can also start a command prompt in ScenarioBuilder and use the RunAs command in windows to start your application with a specified user. To do that follow the steps below:
- The first step is to open the command prompt.
- The second step is to type in the command line to open Notepad with ruser001 and presses Enter key.
- The third step types in the password and presses Enter key (you can encrypt the password by checking the "Encrypt Text" box in the properties of the Type Text action).