Question

Creating Multiple Instances of Windows Application

I have a requirement to create an automation that launches multiple instances of a windows application. The application path is C:\Program Files (x86)\ABCSystems\ABC.exe. Is there a way to do this using a list loop? I was able to launch the application once successfully but not multiple times.

Correct Answer
April 23, 2019 - 4:23pm

Is the application you need to launch also one that you'll have automations run against? If not, you can just use System.Diagnotics.Process.Start in an automation to launch the application. In this manner, you wouldn't have any adapter for the application. If you do want to have it automated, then the easiest way is to use MonitorAll and UseKeys to make a clone of the Top-Level form of the application and then write automations to handle specific instances of it.

I have attached a sample solution using Notepad that demonstrates how that would work.

Comments

Keep up to date on this post and subscribe to comments

Pega
April 23, 2019 - 4:23pm

Is the application you need to launch also one that you'll have automations run against? If not, you can just use System.Diagnotics.Process.Start in an automation to launch the application. In this manner, you wouldn't have any adapter for the application. If you do want to have it automated, then the easiest way is to use MonitorAll and UseKeys to make a clone of the Top-Level form of the application and then write automations to handle specific instances of it.

I have attached a sample solution using Notepad that demonstrates how that would work.

April 24, 2019 - 1:34pm
Response to tsasnett

Thank you this helped out a lot. One more question I could not find the component for System.Diagnostics.Process.Start in the Toolbox. Is there a specific dll that I need to add to get this component to show up?

Pega
April 24, 2019 - 6:33pm
Response to SharathM3315

1. Right-click an empty area in the Toolbox and select "Choose Items...".

2. Select the "Pega Robotics Static Members" tab.

3. Click the radio button for "From Global Assembly Cache".

4. Select the "System" assembly.

5. Locate the "Process" node.

6. Check the "Start" method.

7. Click "OK".

8. Drag the method from the Toolbox into your automation.

April 25, 2019 - 11:19am
Response to tsasnett

Thank you!