Skip to main content

Test Script

A Test Script is a set of instructions, typically written in a programming language, that automates the execution of a test case. Instead of a human tester manually performing a series of steps, a test script performs those actions automatically and reports the results. Test scripts are the backbone of test automation, allowing teams to run repetitive and complex tests quickly and efficiently.

Test Script vs. Test Case

  • A test case is a manual, human-readable document that outlines the steps to be performed.
  • A test script is the automated version of a test case, written in code and designed to be executed by a machine.

Example: A quality assurance team wants to automate the testing of their website's login feature. They would create a test script that uses an automation tool like Selenium. The script would contain code that automatically:

  1. Navigates to the login page.
  2. Inputs a username and password into the correct fields.
  3. Clicks the "Sign In" button.
  4. Verifies that the user is successfully redirected to their account dashboard.

This script can be run repeatedly to ensure the login functionality is working correctly every time new code is deployed.