fixing before and after start up and close down of app in test script