Added function to autogenerate test script