Question
National Australia Bank Ltd
AU
Last activity: 18 Mar 2024 22:30 EDT
Chrome Widget Popup in Edge browser issues while clicking "OK" button.
Not able to perform click on "OK" button in the Chrome Popup Window which will appear post the click action on web application. The issue is observed only for the first instance of the chrome popup appearance.
If I manually click "OK" in the Chrome Popup Window, the subsequent chrome popup which appears in the process gets recognised by the script that we have used to perform click action.
Scenario1 :
Pega Case Opened in Edge Instance Window 1
Target App launched by RDA bot Opened in Edge Instance Window 2
Trigger RDA automation from Pega Case in Edge Window 1 instance, bot to interact with target app in Edge Instance window 2, while performing click action in target app Chrome Popup Window appears were the bot fails to identify the first instance of the chrome popup and does not perform "OK" button click. Once manually clicking on "OK" button the automation continues and the subsequent chrome popups are identified and bot clicks "OK button.
Scenario2 :
Sometimes the button action on the target app by the bot does not show up chrome popup window, whenever user actions manually perform button click in target app to display the chrome popup window and clicks "OK", post that subsequent popups are displayed and bot performs click action on "OK" button.
Have used C# script to handle the chrome popups.[This is standard scripts which I found in the community to handle chrome popup window]
***Edited by Moderator Rupashree to add Capability tags***
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
@VarunK03 Would you please add some of the following items? Please block any sensitive information.
- A screenshot of the popup you are seeing
- A screenshot of your automation
- The text of any scripts you are using
One thing to consider is if the popup is modal, then PerformClick will not return until the popup is dismissed. In that case, you would use a parallel process where one thread calls PerformClick to show the popup, while another thread handles the popup and ultimately closes it. The continuing thread (the bottom link off of the parallel process block) would be used to continue your automation after the popup.
National Australia Bank Ltd
AU
Script :
public void EdgePopUpClick(out bool blnAuthorise, out bool blnShortNmErr, out bool blnCntAddUpdate) { blnAuthorise = true; blnShortNmErr = false; blnCntAddUpdate = true;
try { Condition windowCondition = new PropertyCondition(AutomationElement.ClassNameProperty, "Chrome_WidgetWin_1"); Condition btnSaveCondition = new AndCondition(new PropertyCondition(AutomationElement.NameProperty, "OK"), new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Button)); Condition btnTextCondition = new AndCondition(new PropertyCondition(AutomationElement.ClassNameProperty, "Label"), new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Text));
Script :
public void EdgePopUpClick(out bool blnAuthorise, out bool blnShortNmErr, out bool blnCntAddUpdate) { blnAuthorise = true; blnShortNmErr = false; blnCntAddUpdate = true;
try { Condition windowCondition = new PropertyCondition(AutomationElement.ClassNameProperty, "Chrome_WidgetWin_1"); Condition btnSaveCondition = new AndCondition(new PropertyCondition(AutomationElement.NameProperty, "OK"), new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Button)); Condition btnTextCondition = new AndCondition(new PropertyCondition(AutomationElement.ClassNameProperty, "Label"), new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Text));
// AutomationElementCollection windows = AutomationElement.RootElement.FindAll(TreeScope.Children, windowCondition); AutomationElement windows = AutomationElement.RootElement.FindFirst(TreeScope.Children, windowCondition);
//foreach (AutomationElement window in windows) if (windows != null) { AutomationElement btnInsidedialog = windows.FindFirst(TreeScope.Descendants, btnSaveCondition); // AutomationElement btnInsidedialog = window.FindFirst(TreeScope.Descendants, btnSaveCondition); if (btnInsidedialog != null) { if (btnInsidedialog.Current.Name.Contains("OK")) { AutomationElementCollection labels = windows.FindAll(TreeScope.Descendants, btnTextCondition); //AutomationElementCollection labels = window.FindAll(TreeScope.Descendants, btnTextCondition); foreach (AutomationElement label in labels) { if (label.Current.Name.Contains("Client short name must be unique")) { blnShortNmErr = true; } else if (label.Current.Name.Contains("Authorisation failed")) { blnAuthorise = false; } else if (label.Current.Name.Contains("The contact is still referenced in the Advice page")) { blnCntAddUpdate = false; } }
InvokePattern btnpatternOpen = (InvokePattern)btnInsidedialog.GetCurrentPattern(InvokePattern.Pattern); btnpatternOpen.Invoke(); return; } } else { return; } } } catch { } return; }
National Australia Bank Ltd
AU
apologies , cant upload the images and the network doesn't allow, Its the Chrome confirmation popup(Chrome_WidgetWin_1) which the pega tool cannot interrogate, for this reason the C# scripts are recommended.
Version: Pega Robotics 19.1.120
Only the first instance of the Popup the script is not able to handle , If we perform handling of the popup manually post that on the 2nd or 3rd instance of the popup which will comes up in the next set of screens the script works.
Pegasystems Inc.
US
@VarunK03 I believe there is a later version of 19.1 where we do support more dialogs. We certainly do in 22.1 if the image below is a similar dialog. Is this the dialog you are using? If so, just remember that the PerformClick method of whatever you are triggering the dialog with will not return until the dialog is dismissed. This means that you must use a parallel process to handle the dialog as I describe above.
- Use the top link of the parallel process to call PerformClick and nothing else.
- Use a second link from the parallel process to handle the popup and ultimately close it.
- Use the bottom link off of the parallel process to continue your automation to the next step or your exit point.
Updated: 27 Feb 2024 20:31 EST
National Australia Bank Ltd
AU
The version used is 19.1.120, its not supported in this version, to handle that C# script has been used.
Yes its the same dialog as you mentioned in the image above, we have added the parallel component as you mentioned, but the issue still occurs.
Have opened SR for the same : INC-B7561
Pegasystems Inc.
US
@VarunK03 I don't have your exact dialog, but in your code, I cannot really see anything wrong with it. My guess if the button is not being clicked is that one of your conditions is incorrect. Microsoft has a tool called Accessibility Insights that can help you see the controls you'll need to locate in order for your code to operate against them. Have you used that to help determine which of the conditions isn't working?
National Australia Bank Ltd
AU
In the interrogation mode when we test actions for perform click, the dialog popup occurs,
In the code while using the parallel process - one thread performs click of button in a webpage and another thread (script) made to click the popup "OK" button.
But when we execute the automation the dialog popup does not occur even after the perform click of button on webpage.
If I manually perform click of button in a webpage, post that the automation runs fine by clicking the "OK" button in dialog popup
we used Inspect 32 bit exe for determining the controls within the dialog pop.
The issue is the dialog popup not getting displayed even after perfromclick of a button on a webpage. manually when clicked it comes up.
Pegasystems Inc.
US
@VarunK03I think I understand now. Your code for handling the dialog is working (probably), but your automation for causing the dialog is not. If so, we need to determine the difference between interrogation and runtime. If you are interacting with the page in a way that allows it to work in interrogation but not runtime. Something like inadvertently clicking the screen might trigger something on the site that allows it to work. You'll need to identify what that is. Since you can't provide screenshots or other information here, I suggest you open a support request. They can work with you via WebEx or MS Teams to view your environment and assist. If that is not possible, I would look at how you are triggering the dialog and see if there is an alternative method to trigger it. Is there a JavaScript function you can invoke? Can you try Sending keystrokes to the page instead of PerformClick to trigger this one? Is there anything you might be doing in interrogation mode that you can also write into your automation that allows it to work in one but not the other?
National Australia Bank Ltd
AU
I was able to identify the cause for not getting the popup being displayed.
If the Target web app is in the background the alert popups were not getting displayed with performclick method on a button or even with Javascript for making the button click on web page for displaying the alert popup in Edge browser.
If I make the respective target app webpage "Activate" (bring it to front) in automation before the perform click method or javascript for the button click, the alert popup was getting displayed and the C# script was able to click the "OK" button in the alert popup.If the target app webpage is in the background the alert popups were not getting displayed or getting handled by the automation.
Is this the behaviour of the alert popups(Chrome_WidgetWin_1) in Edge browser ? that specific webpage where the popups could occur has to be activated or bring it to foreground to handle the popups ? Since its a RDA scenario it will interrupt the users if they are clicking on unrelated apps when automations are running on their machines. How can we better handle the alert popups (Chrome_WidgetWin_1) in Edge browser in RDA use cases.?
National Australia Bank Ltd
AU
@ThomasSasnettthanks for the response,
If you can let me know or point out any directions on what could be the issues with the website causing this scenario ? so that I can discuss these with the Target website owners.
Pegasystems Inc.
US
@VarunK03 You might need to look into the behavior of the website to see if it is responding to any other events that might not be raised by the click alone. You can then try raising those events on the control before clicking to see if they cause it to work as expected. Our support team might be able to assist you with this if you'd like to open a support request.
Updated: 18 Mar 2024 22:30 EDT
National Australia Bank Ltd
AU
@ThomasSasnett Thank you for your suggestion,
The behaviour of the target web application is such that the when I manually click on some of the button, the popup appears, If I activate the window(bring it to front) of another application in edge browser(in an another Instance of Edge), the target application popup disappears. Seems like the popups are not staying when I activate manually (bring it to front) another instance of Edge.
But for some of the other popups it stays, even when we activate the window(bring it to front) of another application in edge browser(in an another Instance of Edge).
We had opened an SR request, informed that might be the behaviour of the target apps were the popups are not getting displayed or staying if the application in the background.