web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Need help downlaodinhg...
Power Automate
Answered

Need help downlaodinhg a file

(0) ShareShare
ReportReport
Posted on by 431

I have a popup window that is a pdf viewer and it has a download icon at the top of the window.  I am using a Press Buton In Window" action to try to click the download button but it fails to find it. In the helper for that action, I selected the download icon. When I preview the selector in the selector builder I get:

> document[Class="Chrome_RenderWidgetHostHWND"] > pane[Id="ViewPDFFrame"] > document > document > button[Id="download"] When I test it in the selector builder it fails.

Attached is the Google inspector screenshot. I found a good article about downloading but am still stuck

https://powergi.net/2022/07/11/everything-about-downloading-files-from-the-web-using-power-automate/

 

 

 

 

 

 

Down;oad selector.png
I have the same question (0)
  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    You might need to make sure you are attaching to the pop-up window before you try clicking anything in it, because it is a different browser instance.

     

    We've had some trouble with the nested PDF viewer in a browser window in the past. The following steps are usually what we use (and I would like to point out that we really only use keystrokes when absolutely necessary, so this is one of those cases):

    WebAutomation.LaunchChrome.AttachToChromeByTitle TabTitle: $'''{InsertPopupTitleHere}''' AttachTimeout: 5 BrowserInstance=> BrowserPDF
     WebAutomation.GetDetailsOfWebPage BrowserInstance: BrowserPDF DetailsType: WebAutomation.DetailsType.URLAddress Details=> WebPageProperty
     WebAutomation.CloseWebBrowser BrowserInstance: BrowserPDF
     WebAutomation.CreateNewTab.CreateNewTab BrowserInstance: BrowserMain Url: WebPageProperty NewBrowserInstance=> BrowserPDF
     MouseAndKeyboard.SendKeys.FocusAndSendKeysByTitleClass Title: $'''Bankafstemning * - Google Chrome''' Class: $'''''' TextToSend: $'''{Control}({S})''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: False

    What it does is::

    1. Attaches to the PDF viewer pop-up and creates a new browser instance for that
    2. Retrieves the URL from the pop-up
    3. Closes the pop-up
    4. Opens the same URL as a new tab in the main browser window
    5. Sends Ctrl+S to this new tab, so that it calls out the Save As window of Chrome.

    You would then need the usual UI controls to save the file and then would also need to use Close browser again to close this new tab and return to the original one. But this works without failure when done right.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • Steve48 Profile Picture
    431 on at

    I ended up using a solution that involved using  send keys that worked. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 796

#2
Valantis Profile Picture

Valantis 568

#3
Haque Profile Picture

Haque 538

Last 30 days Overall leaderboard