Question
Navy Federal Credit Union
US
Last activity: 30 Apr 2022 16:55 EDT
Unable to interrogate Edge browser Files selection window
Hi Team
Unable to interrogate Edge browser Files selection window
When I click on the Import button on a web application, file selection window is opened.
In file selection window I am trying to interrogate few controls.
But the page is not able to be interrogated, I tried with windows adapter path set to explorer.exe with MonitorAll and HookChildProcess to true but its not working
can someone guide me on how to get this working.
Attaching the page for more reference
-
Likes (1)
Josh Vincent -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 8 Oct 2021 12:50 EDT
Mountain American Credit Union
US
@ThomasSasnett @jeffbadger Thank you guys for all the help on this. I did get it working finally, just had to add the reference of the dll into my project first and then add it to the toolbox. This way the reference was always available and the build was successfull too. Appreciate the quick responses and help.
Updated: 3 Jun 2021 2:39 EDT
Pegasystems Inc.
IN
Hi Sandhya,
To automate this file Selection text box and file Open button, you have to write a UI Automation script. I suggest you, open a support ticket if you are unable to write a UI automation script.
Regards,
Srini
Updated: 3 Jun 2021 2:39 EDT
Pegasystems Inc.
US
@SandhyaN2531 The best way to work with these dialogs is to use UI Automation. I have found that while you can do this in a script, a component seems to work best. I have created one that I like to use for doing UI Automation things. It has a method specifically for handling this window (the same one that can be found here).
I have attached the component as a ZIP. You can get the DLL you need for the component from the bin directory in addition to the source code (which you'll want to keep with your solution source code as this code is not specifically provided by Pega and is added here to help get you started).
@SandhyaN2531 The best way to work with these dialogs is to use UI Automation. I have found that while you can do this in a script, a component seems to work best. I have created one that I like to use for doing UI Automation things. It has a method specifically for handling this window (the same one that can be found here).
I have attached the component as a ZIP. You can get the DLL you need for the component from the bin directory in addition to the source code (which you'll want to keep with your solution source code as this code is not specifically provided by Pega and is added here to help get you started).
To use it, place the following file (...Pega.Components.UIAutomationHelper\Pega.Components.UIAutomationHelper\bin\Debug\Pega.Components.UIAutomationHelper.dll) into the following folder on your development machine; %AppData%\Pegasystems\PublicAssemblies (create it if it doesn't exist). Then you can add this component to your toolbox. You can then add it to a Global Container. In your automation, call the following method; PopulateChromeOpenFileDialog(IntPtr browserWindowHandle, Int32 timeout, string fileName, out string message). The browserWindowHandle comes from the BrowserForm.Handle (sub) property of a web page interrogated with the universal web adapter. To get to this, you must click on the Explore Component Properties button in the Object Explorer window with your web page selected. You can then drag the Handle property out to your automation and pass it into this method of the component.
When you use this component in an automation, it should recognize it as a new reference and include the dll in the deployment package, so there should be nothing you need to do on a user's machine for this to work.
***I have tested this method against both Chrome and Edge and it works identically in both.
Navy Federal Credit Union
US
@ThomasSasnett @raos Thanks for the responses
Pegasystems Inc.
US
@ThomasSasnett I have updated this code with a slightly better method that should allow this to work with different languages. You pass in the text of the button you want to click (Open, Save, Abrir, Öffnen, etc...) and then it would click that button by text. The other controls required are all located by Classname which shouldn't change with the system language. I tested this on a machine set to Spanish, but I would welcome feedback on other languages as well.
Mountain American Credit Union
US
@ThomasSasnett I am getting error while adding the component to the toolbox. I am on v19.1. Any suggestions?
Pegasystems Inc.
US
@HardikV0You may need to place it in the installation folder then. You can also look in the StudioLog.txt (if you enable the FilePublisher for Studio) to see if it might indicate what it can't find. In theory, the only references it needs are all .Net related ones that you should have already.
-
Hardik Vora
Mountain American Credit Union
US
@ThomasSasnett The StudioLog.txt shows "Error: Requested registry access is not allowed.", but i do have admin rights on the dev box.
Pegasystems Inc.
US
@ThomasSasnett There is a quirk in 19.1 around the location of PublicAssemblies.
- If you are an admin on the machine, the PublicAssemblies folder must be inside of the install folder.
- If you are not an admin, the PublicAssemblies folder must be at %appdata%\Pegasystems\PublicAssemblies.
Also, the folder must be named PublicAssemblies (no other variation is permitted).
We will be changing this behavior in 21.1 to always use the location in %appdata% for PublicAssemblies.
-
Thomas Sasnett Hardik Vora
Pegasystems Inc.
US
@jeffbadger Thank you for clarifying Jeff,
Mountain American Credit Union
US
@ThomasSasnett @jeffbadger I did put the dll at "C:\Program Files (x86)\Pegasystems\Pega Robot Studio\PublicAssemblies\Pega.Components.UIAutomationHelper.dll"
Tried to load it from there but still seeing the same error:
Studio Log shows:
Updated: 6 Oct 2021 15:45 EDT
Mountain American Credit Union
US
@ThomasSasnett @jeffbadger Sorry. Probably i was on the wrong tab. Tried it from .NetFrameworkComponents and was able to add it successfully. However it doesnt let me add the component to my Global Container, doesnt popup any error as well. Its just if you drag it to container, nothing happens.
Output: Unable to resolve 'Pega.Components.UIAutomationHelper, Version= Proprietary information hidden, Culture=neutral, PublicKeyToken=null' assembly
Mountain American Credit Union
US
@ThomasSasnett Strange, but it started working ( well... partially :) ). That is: Added it to toolbox --> Added to my global container --> called the PopulateChromeOpenFileDialog method as you explained above with handler. But now when i try to build my solution, i get below error
'_GC.os' BuildError task: Could not resolve type Pega.Components.UIAutomationHelper.UIAutomationHelper.
FYI, my project is running on .net framework v4.6.1. Any suggestions?
Pegasystems Inc.
US
@HardikV0Can you add a screenshot of your references and also show the location of the DLL? On my machine, I have it placed right in the installation directory along with all of the other project dlls. I know Jeff mentioned the PublicAssemblies folder, but I have access to C:\Program Files (x86)\Pegasystems\Pega Robot Studio Plug-In and just placed them there. If you are using Studio, the folder will be named C:\Program Files (x86)\Pegasystems\Pega Robot Studio.
Accepted Solution
Updated: 8 Oct 2021 12:50 EDT
Mountain American Credit Union
US
@ThomasSasnett @jeffbadger Thank you guys for all the help on this. I did get it working finally, just had to add the reference of the dll into my project first and then add it to the toolbox. This way the reference was always available and the build was successfull too. Appreciate the quick responses and help.
Altisource
IN
@ThomasSasnett - The Handle property is not available in Universal Web Adapter in 19.1.66. Is this available in higher version.