We are conducting a proof of concept for automating a website. On this website, the user clicks a button that opens a file browser dialog for user to select a file to upload. Using Pega Robotics Studio 19.1.71, we tried automating the website using Universal Web Adapter in Chrome and Edge.
However, the automation is not able to trigger the file browser dialog to open using perform click and onchange raise event, only with a sendkey method. Is there another way to trigger the filebrowser without using send keys? The machine where robot will run will be locked, so the sendkey method will not work.
Attached is the screenshot for the File Upload website, and the events triggered when using perform click and onchange raise event.
If you used a Windows adapter with a StartMethod of MonitorAll to interrogate the Edge browser controls, then it would still require a SendKeys to click the Open button. I also wouldn't suggest this approach, but it does allow those controls to be interrogated.
Thank you for the feedback. We have used a windows adapter like you have mentioned for the File Browse window, and we are able to interrogate and test the methods. We are able to set the file path and click the Open button without using SendKey.
The challenge here is clicking the Choose File button control to activate the File Browse window, cannot activate the window using Perform Click and Raise Event methods, only with SendKey.
Is it because of a Chrome/Edge security, and is there any methods known to bypass it?
@MayAnnTenorio I have not found an easy way to trigger that control. It appears as though there is a security issue that prevents scripts from trigger those dialogs. The only way that might work that I could find would require rewriting the InnerHTML of the page to include another button that you'd click on that would trigger a script that clicks the upload dialog. I don't believe that the dialog will actually get created when your screen is locked though. I think that Windows knows the system is locked and will therefore not even draw the controls you've interrogated. They may work while you are testing because they have already been created when you lock your screen, however I believe that they won't exist if triggered while the screen is locked. My suggestion here is to run this with the screen unlocked. If that is not an option, then you'd likely need to pass on this requirement.