I need to rewrite a existing function which is created by the website when the page is loaded. The function is something like this:
function CheckStatus() {
var vcode = $.trim($("#insertCode").val()).toUpperCase();
var vreturn = encodeURIComponent(document.getElementById('text_return').value);
... (lots of other stuff)
}
And I would like to rewite this function to be like this:
function CheckStatus() {
return true;
}
If I paste this function in the chrome console, it rewrites with no problem. But when I try to do it with selenium It does not rewrite... I think it creates another function with the same name. My code in python using selenium webdriver is this:
driver.execute_script("function CheckStatus() { return true;}")
It does not return errors. Nothing happens actually.
Any clues how to solve this with selenium?
Thanks!