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 to close PDF window
Hi,
From my application it will open a new window, in which it will render a PDF file.
When I try to hover on this window sahi controler is not displaying any Window name.
I hope sahi controller will run on browser window whose context type is Text/HTML
Problem:
When I trying to close open window(which contains PDF) using _closeWindow(), it is closing parent window.
could you please anyone help me closing newly open window.
From my application it will open a new window, in which it will render a PDF file.
When I try to hover on this window sahi controler is not displaying any Window name.
I hope sahi controller will run on browser window whose context type is Text/HTML
Problem:
When I trying to close open window(which contains PDF) using _closeWindow(), it is closing parent window.
could you please anyone help me closing newly open window.
Comments
Sahi will work on windows which have html content in it. If you are opening a PDF, it may not be possible to close it, unless you open the pdf in an iframe inside another window. You could try calling an external program to close it though.
(You can try using AutoIt or some simple VBScript to close it)
Regards,
Narayan
Could you please elobrate on this, and also explain me how to call VBScript from sahi.
Thanks in advance.
put closePdf.vbs to %sahi_home%\bin
_execute("wscript closePdf.vbs", true);
or
_execute("cscript closePdf.vbs", true);
console
Executing: wscript closePdf.vbs
or
Executing: cscript closePdf.vbs
then IE dead
OS: XP
BROWSER: IE8
SAHI 20100820
closePdf.vbs
AppWindow.java
Packages.AppWindow.closeWindowByTitle(".pdf");
You are a rock star!
Cheers!
Narayan
Have you solved the problem?
http://114.18.133.218/post-801-1.fhtml