A test script is a code to perform a set of instructions on an application. It is used to verify whether the application is functioning as per the software requirements.
When you run your script, it gives the test results as a pass or fails, which is determined by whether the application works as per the expectations.