18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
How can I get the PID of a browser window during a test?
I am running Sahi in batch mode and my scripts are designed to take screenshots at certain points. When I use the Sahi takeScreenShot() function (even if I use focusWindow()) I am getting screenshots of the foremost test only. I have a program that can take screenshots of hidden windows if I have the PID, but I can't seem to figure out how to get the PID of a browser window mid-test. Does anyone know how to do this?
Answers
Would he be willing to opensource it or share it?
Thanks
we can take screenshot of running browser in background even focus on another window, without using "_focuswindow " technique
this feature i have seen in selenium, below is the code which i have seen in selenium
any how selenium is open source, we can get the source code, by seeing that we can come to know how they have developed this technique
if possible, pls implement the same technique
Jkb's friend's solution sounds more interesting.
The following URL contains C# code to do something like this under windows:
http://stackoverflow.com/questions/242570/copying-content-from-a-hidden-or-clipped-window-in-xp
However, since it's C# code, and SAHI is built using java, you'd have to use java native interface to invoke it, so it's probably not what you're looking for.