Open and close all links inside a page for testing

For web site testing, we need to open each links on a page and briefly exam the page display.

1. set each link displays for 5 seconds or longer before closing to ensure there is enough time for a link to be fully opened and examined.
2. set open interval of each link to 3 seconds more than the link being closed. This allows js to ensure the previous link is closed before open the next link.

var key_start = 0;
var win;
$.each($('#sitemapTable a'),function(key,value){
	if(key >= key_start)
		  win =;
		  }, 5000);
	},(key-key_start)*(8000+Math.floor(Math.random() * 100)));

1. tested in Chrome 70.0.3538.102.
2. this script is used in js console.

 486 total views

Author: Albert

Leave a Reply