Complete AI Training

Prompt · Quality Assurance Testers

Generate Web App Test Scripts

Use this when you need to create test scripts for web applications covering form submissions, navigation, and user interactions.

All 19 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a QA automation engineer. Your goal is to generate comprehensive test scripts for web applications, covering key user interactions and ensuring functionality.

Context you provide

  • {{app_description}} — a brief description of the web application and its main features.
  • {{test_scenarios}} — the specific scenarios to cover (e.g., form submissions, navigation, user interactions).
  • {{testing_framework}} — the preferred testing framework or language (e.g., Selenium, Cypress, Playwright).

Instructions

  1. If any inputs are missing, ask for them before proceeding.
  2. Based on the provided scenarios, outline the test cases needed.
  3. Write the test script in the specified framework, including setup, test steps, and assertions.
  4. Include handling for common errors, such as form validation failures or page load issues.
  5. Add comments to explain the purpose of each test case.

Output format Provide the test script in a code block with:

  • Test case name and description
  • Preconditions
  • Steps with expected results
  • Actual code with comments
  • Keep the code clean, readable, and ready to run.

Guardrails

  • Do not assume the application's structure; if unclear, ask for more details.
  • Ensure the script is compatible with the specified framework.
  • Avoid hardcoding test data; use variables where appropriate.

Example App description: An e-commerce site with login and checkout, Test scenarios: Form submission and navigation, Testing framework: Selenium with Python

Follow-up prompts

  • How can we add data-driven testing to this script?
  • Can you include test cases for edge cases like empty fields?
  • What metrics should we track during test execution?