0

I want to take screenshot of the entire web page. I have tried using

capture page screenshot

But the problem is that it takes the screenshot only of the visible part of the webpage. I want the screenshot for the whole page.

Bence Kaulics
  • 7,066
  • 7
  • 33
  • 63

1 Answers1

3

You have to tinker something for yourself. For example you can setup a loop where you are sending PAGE DOWN keys to the browser to scroll down and take a screenshot after each iterations.

E.g.:

*** Settings ***
Library    SeleniumLibrary

*** Test Cases ***
Take Screenshot
    Open Browser    https://stackoverflow.com    Chrome
    FOR    ${i}    IN RANGE    4
        Capture Page Screenshot
        Press Keys    None    PAGE_DOWN
    END
    [Teardown]    Close All Browsers

You have to decide based on your application how many scrolls you need.

Bence Kaulics
  • 7,066
  • 7
  • 33
  • 63
  • I don't want multiple screenshots. I need a a single screenshot which has the entire page. Anyways thank for the response. – Sai Vikhyath Mar 08 '21 at 13:29
  • @SaiVikhyath I know, but I am afraid you cannot do that. Screenshot is what is on the screen, if something is not on the screen then it will not be part of the screenshot. You can try to merge them somehow. – Bence Kaulics Mar 08 '21 at 13:39
  • @SaiVikhyath Maybe you could check this: https://stackoverflow.com/a/30228308/3820025. – Bence Kaulics Mar 08 '21 at 13:55