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 / Not able to capture fu...
Power Automate
Answered

Not able to capture full webpage screenshot with scroll bar in one <div>

(0) ShareShare
ReportReport
Posted on by 17

As part of some web site test automation, we need to capture screenshots of web pages where there may be a scroll bar in the one of the <div> element. 
PAD's 'Take screenshot of webpage' does not capture the entire content of that <div> if there is a scroll.
Any ideas, how to get PAD do this?

Tried using a Chrome extension by sending shortcut keys using PAD's 'Send Keys' action. But the popup "Microsoft Power Automate started debugging this browser" that comes up when JS is running, cause clipping at the bottom of the screenshot.
Note: The JS runs before 'Send Keys' action takes place but the popup remains visible for few seconds.

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Would zooming out of the page work for you? You could try doing that to fit the whole page into the screen.

     

    As to what you said about Send keys - I don't fully understand that. Can you share some screenshots of your flow and also what the page looks like?

    -------------------------------------------------------------------------

    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.

     

  • OkanMTL Profile Picture
    703 Super User 2024 Season 1 on at

    Hi,

     

    Not a direct solution, but you can use focus textfield in browser activity to scroll down and then take another screenshot. This works fine, but you're left with two screenshots (maybe merge them?). 

     

    Goodluck.

  • mvnagaraja Profile Picture
    17 on at

    Zooming out wont work because there are many web pages with different amount of content. Moreover, these screenshots will be used to verify the visual UI testing like UI text overlapping, clipping etc.


    About 'Send Keys' action, the Chrome extension which can take full page screenshot can be invoked using shortcut keys. These keys are sent using 'Send Keys' action. This does the job but the JS that gets invoked two steps before in the flow, results in the popup "Microsoft Power Automate started debugging this browser" and this popup message is causing clipping of the screenshot.

    We use JS to decide if a particular web page has a scroll or not and decide to use either PAD's 'Take web page screenshot' action or use Chrome's extension because PAD's option is not working if there is a scroll bar.

    See the attached file for sample web page layout we are working on.

    SampleWebPage.jpg
  • mvnagaraja Profile Picture
    17 on at

    This won't work as there are more than 200 web page per language and 20+ languages.

  • Verified answer
    mvnagaraja Profile Picture
    17 on at

    Found a work around for our problem.
    Step 1: Run a  PAD with the JS to run through all the web pages and make a list of which pages have scroll.
    Step 2: Run the main PAD using input from step 1 and toggle between using PAD web page screen capture and Chrome extension  screen capture between pages without scroll and pages with scroll respectively.

    Step 1 just took 10 mins for ~200 web pages which is acceptable. 

    Simple JS to check for scroll (I am new to JS, so sourced this from google):
    var element = document.getElementById('<name of the element>');
    if (element.scrollHeight > element.clientHeight)
            // web page has scroll
    else
            // web page has no scroll

    Tested this on few pages using console and confirmed it works. If anyone sees a problem with this JS, please correct me.

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Thanks for sharing this. I took the liberty of setting this as the solution to this topic. Would be great if you shared your JS code, if possible, though.

  • mvnagaraja Profile Picture
    17 on at

    I have updated my post above with JS.
    Thank you Agnius and OkanAT for suggestions.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 233 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 227 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 178

Last 30 days Overall leaderboard