After clicking on the button i need to open some link in new tab, and than after the page would be loaded, I need to programmatically perform some actions on this page (like clicking on proper GUI elements etc).
For example this code should open in new tab http://stackoverflow.com and after that click on "Tags":
<button type=\"button\"
onclick="window.open('http://stackoverflow.com', '_blank');
document.getElementById('nav-tags').click();">Click Me!
</button>
but the function document.getElementById('nav-tags').click()
does not call.