Verify that the methods that should be triggered by the actions are truly not executed. You can do it like this:
First, override the method to "inject" some flag that would be triggered by the action (it's Scala code, but you should get the idea):
val js: JavascriptExecutor = webDriver.asInstanceOf[JavascriptExecutor]
js.executeScript(myScript)
lazy val myScript: String = {
s"""
window.openNewWindowFlag = false;
SDK.openNewWindowFlag = function(url, width, height, onClose) {
openNewWindowFlag = true;
};
"""
}
Note, we adding the flag on the global (window) scope.
Then, run the action that should call some method (the one we override) and check if the flag changed:
val js: JavascriptExecutor = webDriver.asInstanceOf[JavascriptExecutor]
val isMethodTriggered = js.executeScript("return openNewWindowFlag").toString.toBoolean