18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Capture entire browser screen

ravinderravinder Members
edited November -1 in Sahi - Open Source
Hi,

Is it possible to capture entire browser screen?

I used following code...

function takeSnapShot($filename){
try {
var robot = new java.awt.Robot();
var toolkit = new java.awt.Toolkit.getDefaultToolkit();
var screenSize = toolkit.getScreenSize();
var screenRect = new java.awt.Rectangle(0, 0, screenSize.width, screenSize.height);
var image = robot.createScreenCapture(screenRect);

var file = new java.io.File("D:/path/"+$filename+".png");
javax.imageio.ImageIO.write(image, "png", file);
} catch (e) {
print(e);
}
}

// Call it
takeSnapShot("snapshot");

but it is capturing visible part only......and I want to capture entire browser screen....

thanks in advance!!

Comments

  • globalwormingglobalworming Moderators
    Hi ravinder

    if you are not working with Windows, I could provide some shell scripts which take screenshots of the whole screen and additionally maximizing the browser window. Just send me a mail if you like.

    Regards
    Wormi
  • Hello Ravinder,
    This feature is currently under development in Sahi Pro and will be available in the next release.

    Regards,
    dkulkarni
  • it's not work in parallel execution.

    Is it possible to take screen shot of particular window when we run test suite in parallel.
  • ferrferr Members
    u should use Screen_VidShot (geovid.com)
Sign In or Register to comment.