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.
block unwanted javascript function on a web page
I have an application that call a win.close() function and stops the test until the page is close.
Is there some way to block unwanted javascript call or code with sahi?
Is there some way to block unwanted javascript call or code with sahi?
Comments
For example, if closeWindow() is the javascript function causing this, just add in your script. This will overwrite the already loaded function. You will have to add this to your script such that this call happens once you are on that page.
Another way to do it is to add a blank function definition at the end in sahi/htdocs/spr/playback.js
eg.
thanks for your reply , I have found the problem with your hint : the function launched is a window.opener.close() integrated in a javascript.The javascript create a form that launch an url with parameters and close itself in a wrong way.
If the buggy javascript in the browser is called TEST with sahi have I chance to replace it with a self made TEST javascript in the sahi script ?