Auto test action for script

Hello, I have a little script in automation, but when we copy the database, we need to test it manually every time.
Is it possible to do this automatically?
Thanks for your help