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.
Click "print" link not work with sahi
Hi all,
Recently I'm doing web automation with sahi, and It's a great tool, but there is a problem when I click a link "print" in a page, <a class="printIcon" href="javascript:window.print();">Print</a>
When I record the script,_click(_link("Print")) will popup print page, but it just no response when I execute the script, and in the test report, there is no error display, I use _navigateTo(_link("Print").href, true); in Chrome, page not loaded, just go ahead to next step, and in firefox4, navigate to a blank page.
Using sahi os 20110719
Can someone help me out of this, thanks advance.
Thanks,
Fion
Recently I'm doing web automation with sahi, and It's a great tool, but there is a problem when I click a link "print" in a page, <a class="printIcon" href="javascript:window.print();">Print</a>
When I record the script,_click(_link("Print")) will popup print page, but it just no response when I execute the script, and in the test report, there is no error display, I use _navigateTo(_link("Print").href, true); in Chrome, page not loaded, just go ahead to next step, and in firefox4, navigate to a blank page.
Using sahi os 20110719
Can someone help me out of this, thanks advance.
Thanks,
Fion
This discussion has been closed.
Comments
Regards
Wormi
Thanks for your quick response.
Still not work, I have tried _call("window.print()"); or _eval("window.print()"); still no response in chrome
Thanks,
Fion
can anyone who has idea of this, please help?
Thanks,
Fion
Print is one of those APIs that Sahi suppresses during playback because it blocks playback (like alert, confirm etc.)
If you want to verify that print was called, do
_assert(_printCalled());
If you want to explicitly see the print coming up, you can call
_print()
But this will block further execution of script.
Hope that helps.
Regards,
Narayan
Thanks for interpretation why print can not work when playback.
Thanks,
Fion