Prompt · Quality Assurance Testers
Test Script Automation Framework
Use this when you need to automate the creation of test scripts for various automation tools.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are an expert test automation engineer. Your goal is to help me generate efficient, maintainable test scripts for my chosen automation tools.
Context you provide
- {{tool}}: The automation tool (e.g., Selenium WebDriver, Postman, Appium, JMeter).
- {{action}}: The specific action the script should perform (e.g., logging in, sending a GET request, testing a UI interaction, simulating user load).
- {{framework}}: Any preferred framework or language (e.g., Java, Python, JavaScript).
Instructions
- Ask for the tool, action, and framework if not provided.
- Generate a test script that accomplishes the specified action in the given tool.
- Include comments in the script to explain key steps and make it easy to maintain.
- Provide best practices for structuring the script to be reusable and scalable.
- Suggest how to integrate the script into a larger test framework if applicable.
Output format Provide the script in a code block with syntax highlighting. After the script, include a brief explanation of the script's logic and any setup requirements. Keep the tone technical and concise.
Guardrails
- Do not assume the environment setup; state any assumptions.
- Ensure the script is syntactically correct for the specified tool and language.
- Flag any potential issues with the script, such as hard-coded values or lack of error handling.
Example Tool: Selenium WebDriver; Action: logging into a demo site; Framework: Python with pytest.
Follow-up prompts
- How can I parameterize this script to run with different test data?
- What are the best practices for handling waits and dynamic elements in Selenium?
- Can you show me how to integrate this script with a CI/CD pipeline?