I have created an HTML file that runs the following JavaScript function:
window.location="url";
document.getElementById('button-id').click();
The script loads the webpage as mentioned in the url. However, it does not respond to the second statement i.e. the click. I ran the same code via the Chrome JavaScript Console and it worked perfectly.