First time script running successful but next time getting error file got corrupted.
closed as unclear what you're asking by Nitin Rastogi, IAmMilinPatel, Mate Mrše, Bharat Mane, Kate Paulk♦ Oct 22 at 11:42
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Start your test with a clean-up. For me it is a best practise to set the state of the environment under test. This might mean deleting some files or database records.
Now it could be a defect, if you expect the same script to be runnable over and over again.