If a webapp have JS code such as the following:
for(i=0; i > -1; i++){var a=1}; // Infinite loop
and I use Selenium/Phantomjs to browse it, it will be stuck forever.
How can I solve this problem? Does phantomjs have an option to set a timeout for script execution?