If we have 2 Universal Web Adapter with same browser type (either chrome or Edge) in a project and both of them are started and if we close one browser session from browser window close button, the corresponding adapter is remains in started/running status (Adapter.IsRunning property returns the true value). We have to use adapter.Stop() method before we can start the application from adapter.Start() method.
The adapter status changes to stopped when we close all the browsers.
This issue is happening when we have more than 1 Universal Web Adapter of same browser type (either Edge or Chrome).
@PrashantK7443 You need to use the AcceptedDomains property to identify which domains are acceptable to a given Universal Web Adapter (UWA). The UWA works like MonitorAll would work for the StartMethod as it is associated with the entire Chrome/Edge process and not with a specific window. When you use the AcceptedDomains property, the UWA can then detect when no open windows are associated with a given adapter and stop that adapter.
Without any values in AcceptedDomains, the adapter will technically be associated with any Chrome or Edge processes that start after the adapter. This setting is also useful in conjunction with the BrowserStopMethod as you can use that to close only the pages associated with a given adapter when you stop it. With a blank AcceptedDomains property, closing a UWA will close all Chrome or Edge processes.
However, the adapter is showing as matched even when the Edge browser window opened from runtime is closed manually. Please note hat I have an Edge browser window open outside runtime with different URL. Please see attached screenshots for robot inspector.
@PrashantK7443 The Universal Web Adapter does not interact with the browser in the same way that the web adapter did with IE. It does not care about the process. Once the adapter is started, if you navigate any window or tab or other process associated with the browser type you selected within the adapter, it will match. It does not matter if you start processes before Runtime starts. The UWA communicates through a process started by the extension (OpenSpan.Translators…MessagingHost.exe). This process is started whenever the extension is started. If you had defined your BrowserStopMethod property to StopMatchedDocuments, then that window would close when you stop the adapter. If you want the adapter to stop when you close all windows for a particular web application, then use the AcceptedDomains property. Once all of those processes have closed, the adapter will be stopped. Please let me know if this isn’t clear though and I can put together an example.
“If you want the adapter to stop when you close all windows for a particular web application, then use the AcceptedDomains property. Once all of those processes have closed, the adapter will be stopped.”
This behaviour that you highlighted above related to AcceptedDomains is not the case with PegaRobotics 19.1.38 or 19.1.98.
The Adapter doesn’t stop unless all the windows/processes of the respective browser type is closed.
Would appreciate if you could test the behaviour with one of your PegaRobotic version and update us.
In the meanwhile, we are thinking of using below script if “AcceptedDomains” property doesn’t work as intended. Would like to know your thoughts
@SoKaps You are correct. I misspoke there. The adapter itself won’t stop unless the processes are stopped (or until you call Stop). I believe your script is fine, but for all those not C# inclined, you can accomplish the same thing by checking to see if any of your pages are created. The only caveat I see with your script (or checking for IsCreated) on any pages is that it will only account for pages you’ve interrogated.
@ThomasSasnett
Thanks Thomas! We want to cover scenario where user accidently closes the web app or it crashes for some reason, we are restarting the App and not just relying on isRunning property.