The web application I'm testing has its Front End developed in Angular and I use UFT version 23.4. I want to execute the RunScript method on the Page object to execute the javascript function/statement that reloads the page (window.location.reload();). The browser I'm using is Chrome, and JavaScript is enabled in settings.
I have tried defining the statement directly and encapsulating it in a function or using the eval function and invoking it from a (.js) file, but I have not achieved the expected result in any way:
Browser("MyBrowser").Page("MyPage").RunScript "window.location.reload();"
Browser("MyBrowser").Page("MyPage").RunScript "eval(window.location.reload(););"
Browser("MyBrowser").Page("MyPage").RunScript "(function() { window.location.reload(); })();"
Why aren't my JavaScript executions working from UFT? Is there something I haven't taken into account?