Create test onload function