Using Edge while the robot is running

Hi all,

I’ve got a question about using a webpage, while a robot is using exactly the same page.

My user is running a robot. The robot performs actions on a webpage (UWA)(Edge).

While the robot is running, the user wants to use exactly the same webpage to perform other tasks.

This causes the robot to stop working and also send commands to the user’s webpage.

Is there a way to solve this issue?

Extra information

  • In the past, we also used Chrome as a browser. When the user performed the other tasks on the same page in Chrome, there weren’t any issues. But using Chrome is not an option anymore.

  • There’s also no issues when the user uses any other webpages while the robot is running.

  • RPA is not an option for this process.

  • Current Runtime version: 19.1.118.

@RobinT51

Using Chrome would make this much easier. Let me state the problem first just to set a baseline for my response. You have an application that you wish to perform automation against that you also want to have a user perform actions against while you are performing automations against the same application. In this case, you’ll need to launch a copy of the application. You cannot have a Robotic automation interacting with an application while a user is using the same application. Assuming your application supports it, it is possible to run two copies of the same application in Pega Robotics.

The best way to do this would be to use Chrome for the automation and Edge for the user. That will allow them to be visually separate as well (you can tell users not to interact with the Chrome version and leave that to the automation). If you cannot use Chrome, then it is possible, it will be a tricky and there will need to be someone knowledgeable building the automations.

You will need something to differentiate the two windows. You will need each instance to launch in its own window, or there will be nothing that you can use to tell each instance of the application apart. In this case, we’ll use the BrowserForm.Handle property. This is the window handle of the actual browser window. It will be unique and will not change throughout the life of the application. Whenever you launch a new copy, you can record the handle upon the creation of the starting page of the application. You can then store this value and then use it to logically search for the correct instance of the page you are interacting with.

Matching is a consideration. The adapter will match against any instance of Edge that is running. If both copies were on the same web page, only one would match (the first page created) and you could not automate the other without extra consideration. Pega Robotics provides for this by using a concept called clones. Essentially, this allows you to match against multiple instances of any given control when you enable the UseKeys property of the control you need to clone.

If you have not used clones before, I suggest you look at the topics below and practice a little to understand the concept better.

https://academy.pega.com/topic/usekeys-property/v2/in/23271/43306

https://docs.pega.com/bundle/robotic-automation-221/page/robotic-automation/creating-automations/cloned-controls-usekeys-property.html

In this case, you will enable the UseKeys property at the page level. This key will change whenever you navigate or if the page refreshes, so it will not be useful in identifying an instance of a particular page since it will always be random. Assuming you open each instance of this application in a separate window, you can access the Window Handle property of the page itself. See the attached screenshot for how to access this property. This value will be consistent for the window assuming it doesn’t close (and the user doesn’t merge the tab into another window).

As you navigate, whenever you are asked to provide the key, you will need to iterate the clone collection and locate the clone (and return its key) that matches the handle of the window you care about. This is something that I have done many times in the past, so it will work and be robust. Once you understand the concept, it isn’t too much to follow. If needed, I can construct a sample solution. Let me know if that might be helpful.

@ThomasSasnett Thank you for your extensive explanantion.

Since the robot I’m talking about is already build in a certain way it will be a lot of work to refactor it in the way you mention. On new robots it will give it a try for sure.

In my current situation I’ll try and see if any exceptions can be made, so Chrome can still be used by a few users.

@ThomasSasnett It seems like that if the user starts an Inprivate Edge session there are no issues anymore. This is a good solution in our case.

@RobinT51 This would certainly work. I apologize for not suggesting that. The extension is only interacting with one of the instances of Edge. I believe you will need to ensure that the In-Private version is launched after the first (adapter-connected one) is running. If you had the browser setting allowing the extensions to run when In-Private is enabled, then we could theoretically use the In-Private window if it were launched first.