The Testing Academy · Class Notes Friday, 2 October (IST)
Live class · study guide

Prompt engineering for QA: five principles, zero-shot and few-shot prompts, the RICE-POT framework, and a first push to GitHub

The last AI class before JavaScript starts: the four levels from prompting to LLM evaluations, five principles of a good prompt, a seven-step formula that ends in a reusable skill, zero-shot and few-shot prompting, and the RICE-POT framework, used live to generate a Selenium framework and then turned into a generic QA template. The class closed by pushing the work to a public GitHub repository.

By Pramod Dutta, The Testing Academy. Study notes from the third class of Playwright 4x, built from the session recording and the batch repository, which received the class's prompt files, template and generated framework as the class ended (commits "feat(framework): initial enterprise Selenium 4 + TestNG framework and RICE-POT prompt engineering materials" and "docs(prompt-eng): add generic RICE-POT QA template guide"). The generated framework was compiled but not run, because its tests log in to a real third-party site. The Eraser deck was not reachable while this page was written.

01

What this class covered

  • The four levels: prompting, skills, AI agents, LLM evaluations
  • Why a one-line instruction is not a prompt
  • Five principles: be specific, give context, name the format, set constraints, add anti-hallucination rules
  • The seven-step formula, ending in a reusable skill
  • Prompting strategies: zero-shot, few-shot, chain of thought, role-based
  • The RICE-POT framework, and a prompt written with it live
  • Checking what the model generated
  • Other frameworks, and when RICE-POT is too much
  • Turning the prompt into a generic QA template
  • Pushing the work to GitHub with a personal access token
  • VS Code and its forks
02

The four levels, from prompter to evaluator

The class mapped where the next 90 days should take you on the AI side, alongside Playwright:

  • L0, prompting. Instructing a model well, in GitHub Copilot, Codex, Claude Code, Kiro or a chat window. Most of the class put themselves here.
  • L1, skills. A reusable markdown file for each QA task: a test plan skill, a test case skill, a Playwright test skill, a Playwright API test skill. Built around your company's way of working, then published.
  • L2, AI agents. Agents built in n8n, Langflow or LangChain.
  • L3, LLM evaluations. Testing what the AI produces. This is the target to reach within the 90 days.
FROM PROMPTER TO EVALUATOR L0 Prompting instructing a model well L1 Skills one markdown file per task L2 AI agents n8n, Langflow or LangChain L3 LLM evaluations testing the AI's output the target within the 90 days most of the class starts here
Each level builds on the one below: a good prompt becomes a skill, skills become agents, and agents need evaluating.
03

A one-line instruction is not a prompt

"Create a test plan for app.vwo.com" feels like a prompt, but it is only an instruction. Prompt engineering is the practice of designing and refining the input so the model produces the desired result. That phrase is the test: if you cannot say what the desired result looks like, the model will invent one. As the last class put it, you tell the model what to do rather than ask it.

For a fuller grounding, the class shared a free course, Learn Prompting, which takes about an hour.

04

Five principles of a good prompt

Principle What it means Example from class
Be specific numbers and the shape of the result "Write five functional test cases covering valid and invalid input, empty fields and SQL injection, in Jira format."
Give context the documents the answer depends on "Given this PRD, write test cases covering the happy paths."
Name the output format which format, exactly a bug report in Jira format, not just "a bug report"
Set constraints the rules it must work within "Use only the PRD. Do not assume anything."
Add anti-hallucination rules make it ask instead of invent the rules from the last class

The first demo showed why. Asked for login test cases with no context, the model filled in email addresses and passwords of its own, which is hallucination dressed up as detail.

05

The seven-step formula, ending in a skill

SEVEN STEPS, AND THE LAST ONE IS THE POINT 1 Define the goal what does success look like? 2 Gather context PRD, API docs, screenshots 3 Pick a strategy zero-shot, few-shot and more 4 Structure the prompt a framework such as RICE-POT 5 Add constraints only the PRD, no assumptions 6 Test and iterate against the desired result 7 Save it as a skill document, reuse, publish Other QAs reuse it on the next ticket Steps 1 to 6 get one good answer. Step 7 turns the approach into something the whole team can run.
The thirty prompts it took to get a good test plan are not the asset. The approach behind them is, once it is written down as a skill.
  1. Define the goal. What exactly do you need, what will you do with it, and what does success look like? "Help me test this" is not a goal.
  2. Gather context. The PRD, API documentation, screenshots and UI mockups, error logs, previous test cases and constraints. The more you give, the better the answer.
  3. Pick a prompting strategy, from the next section.
  4. Structure the prompt with a framework, such as RICE-POT below.
  5. Add constraints.
  6. Test and iterate until the output matches the desired result.
  7. Document it and reuse it as a skill, then publish it so other QAs can use it.

The real skill is turning prompts into skills. Suppose it takes thirty prompts to get a good test plan out of one Jira ticket. The valuable part is the approach you found, written down as generic steps so a junior QA can repeat it on the next ticket. Every QA activity can become a skill this way: requirement analysis, test planning, test case design, test data, execution, defect management, root cause analysis. Prompters become skill creators, and skills eventually become agents.

The class's analogy. Knowing how to make a good pizza helps nobody else until you write the recipe down. A skill file is the recipe.

06

Prompting strategies

Most people use only one strategy, asking. There are four worth knowing:

Task Strategy What it means
Simple: fix grammar, write an email zero-shot no examples, just the instruction
Custom-formatted, which is most QA work few-shot include one or more examples of the output you want
Complex analysis or architecture chain of thought ask for the reasoning step by step
Needs domain expertise role-based tell the model who it is, such as a senior QA engineer

"Shot" means example. The class's demo was a bug report: a bare "create a bug report for app.vwo.com where the login page is not working" is a zero-shot prompt. Adding the structure your team uses, with a filled-in example of how a finished report should look, makes it few-shot, and the result matches your format instead of the model's guess.

07

The RICE-POT framework

Out of the ten to fifteen prompt frameworks the class had tried, RICE-POT is the one it recommends for QA work. Each letter is a part of the prompt:

SEVEN PARTS OF ONE PROMPT IN THE CLASS'S PROMPT R Role who the model should be QA automation tester, 15+ years I Instructions numbered, exact directives XPath only, no Thread.sleep C Context the application and setting the Salesforce login page E Examples a sample of the shape you want a PageFactory LoginPage class P Parameters constraints and the quality bar production level, near-zero bad practice O Output exactly what to hand back 1 page object, 2 TestNG scripts T Tone voice and audience technical, enterprise-grade A simple task, such as an email to your manager, needs a role and some context, not all seven parts.
RICE-POT is a checklist as much as a format: each letter is a question the prompt must answer before the model has to guess.

The live example. The problem statement was to generate a production-ready Selenium framework in Java, with TestNG and Maven, for the Salesforce login page. The point was not Selenium, which nobody in the batch needs to know yet. The point was how much a real prompt has to say, and that it should be written so a junior QA could reuse it on another application. This is the prompt as written in class and pushed to the repo, typos included; the dashes in its section labels are shown as colons:

Text
Role:  You are a QA Automation Tester with 15+ years of experience. You have a very good understaing of the IT, CRM projects like the salesforce.com, You need to create a enterprise level Selenium with JAVA, Mavem, TestNG framework, it should follow the proper pattenrs and should ne production ready and enterprise levels grade.


Instructions:

1. Generate a Complete Selenium with Java automation script following the standard of enterprise level standards.
2. Automate and verify the results of the login page login.salesforce.com/?locale=in, ensure that UI is thoroughly tested with valid and invalid testcases.
3.[Critical] - Apply the TestNG annotations, @Test, @BeforeTest and others and and necessary setup/teardown logic.

4. [Critical] Implement robust exception handling within both Page Object model and test scripts using structured try–catch blocks or explicit exception signatures.
5. [Mandatory] Use Page Object Model with PageFactory, including @FindBy, constructor initialization, and reusable action methods. 
6. [Mandatory] - It is important that you use only the xpath not the css selectors.
7.  [Don't] - Don't add comments, Thread.sleep and other bad coding practice.
8. [Generate] - Generate the 2 scritps only with the valid and invalid testcases of the login page. 
9. [DoNOTuse] Thread.sleep() anywhere; rely on WebDriverWait or implicit waits.

C : Context 
You are creating a login page scripts with proper framework for the sales force login, which is a AB Testing website with valid and invalid login page where in the login page you have the email, password and submit buttin with remember me fucntionality.

E: Example 
Example structure for PageFactory:

public class LoginPage { 
    @FindBy(xpath = "//input[@id='username']") WebElement username;
    @FindBy(xpath = "//input[@id='password']") WebElement password;
    @FindBy(xpath = "//input[@id='Login']") WebElement loginButton;

    public LoginPage(WebDriver driver) { PageFactory.initElements(driver, this); }

    public void doLogin(String user, String pass) { 
        username.sendKeys(user); 
        password.sendKeys(pass); 
        loginButton.click(); 
    }
}

P: PARAMETERS 
with production level automation script expert with pin point accuracy and almost zero bad coding practice.

O: Output 
Provide only:
1 Page Object file
2 TestNG test scripts
Maven project 
No explanations or additional content. 

T: Tone 
Technical, precisly, enterprise-grade, code-one.

Please make the entire step by step process and ask me what you are doing and explain to me also what you are doing step by step. Make sure that you first plan everything and show me what exactly you are going to create. Then only you are going to create afterwards step by step.

Notice how the instructions are tagged [Critical], [Mandatory] and [Don't], and how the last paragraph makes the model plan and explain before it writes anything.

08

Checking what the model generated

The agent built the framework in the editor while the class moved on, and it is in the repo as Selenium_Framework. It compiles: mvn test-compile succeeds against Java 17. In class the result was read as exactly two test cases, with a lead-management part as an extra. Set against the prompt, the generated code tells a fuller story:

The prompt asked for The generated framework
PageFactory with @FindBy no PageFactory: plain By locators
XPath only, no CSS 15 XPath, 6 By.id and 4 CSS locators; the login page itself uses only By.id
No comments comments throughout, such as the Javadoc in WaitUtils
No Thread.sleep none, as asked
Two scripts, valid and invalid login three login tests (page rendering, invalid credentials, empty credentials) and no valid-login test, plus a lead-management test class
Only one page object and two test scripts four page classes, utilities, reports, retries and a CI workflow

Two lessons follow. A detailed prompt raises the floor, but it does not guarantee the model obeys every line, so the output has to be checked against the prompt, which is what level L3 is about. And the anti-hallucination notes added to the same folder tell the model not to use PageFactory, the opposite of instruction 5. Give a model contradictory rules and you cannot predict which one wins.

The anti-hallucination notes in the repo. 03_Anti_Hallucinations.md collects four techniques for code generation: pin exact library versions, state what not to do, anchor the model with existing class and method signatures, and tell it to verify imports and dependencies rather than invent them.

09

Other frameworks, and when RICE-POT is too much

RICE-POT is not the only framework. Among the others shown were RACE (role, action, context, expectation) and STAR (situation, task, action, result), alongside chain-of-thought and tree-of-thoughts prompting. They are different shapes for the same job, and none is wrong.

The class's guidance: use RICE-POT for complex QA work, such as test plans, test case suites and framework generation. For a simple task it is overkill. An email to your manager needs a zero-shot prompt or a short RACE prompt: the role (a QA manager), the context (you are away for a month), and the action.

10

Turning the prompt into a generic QA template

A prompt written for one job is useful once. The class then asked a stronger model to turn it into a generic RICE-POT template for any QA task, and pushed it as 04_RICE_POT_Generic_QA_Template.md. It contains:

  • How to use it: choose a task, replace the placeholders, and set the output format.
  • A copy-ready master prompt with placeholders such as {{APPLICATION_NAME}}, {{FEATURE_NAME}}, {{ENVIRONMENT_AND_URL}}, {{IN_SCOPE}} and {{COUNTS_AND_LIMITS}}.
  • Four task profiles: a general QA task, a test plan, test cases, and automation.
  • Filled examples: a login test plan, five login test cases, and Selenium login automation.
  • A final review checklist.

Give a model the template and ask for a test plan, and it asks you for each placeholder first, then fills in the RICE-POT prompt itself. That is today's task.

11

Pushing the work to GitHub

Every exercise from day one goes into a public GitHub repository. The class's steps:

  1. Create the repository at github.com/new. The class named its repository LearnJSTSPlaywright4x and made it public.
  2. Create a personal access token: Settings, Developer settings, Personal access tokens, Tokens (classic). Give it an expiry, tick the repo scope, and generate it. It looks like a long string starting with ghp_.
  3. Ask the AI agent in your editor to commit the changes and push to your repository, and give it the token when it asks.

The repository is organised one folder per chapter, in course order: 00_chapter_Prompt_Eng today, then 01_chapter_JS_Basics and a keywords and literals chapter for next week.

Treat the token like a password. Anyone holding it can push to your repositories. The class stopped screen sharing while creating one. Give it an expiry, and never commit it to a file or show it on screen.

The team will run a one-hour session for anyone who cannot push yet. Only join if you need it.

12

VS Code and its forks

Cursor, Windsurf, Kiro and Antigravity are all VS Code underneath, with extra features on top. Antigravity's extra is a free AI quota with a Google account. Claude Code is a different tool, though its VS Code extension works inside VS Code. Anything you see done in one of these editors can be done in another. Extensions come from the marketplace, which the next class covers.

13

Tasks and announcements

Task 1, a test plan from the template. Using the generic RICE-POT template, ask your AI tool to create a test plan. It should ask you for each placeholder before writing anything. The task is in the batch space.

Task 2, push to GitHub. Create your public repository and push your 00_chapter_Prompt_Eng folder to it before Monday.

  • Files from today: all in the batch repo's prompt engineering chapter: the RICE-POT full form, the class's prompt, the problem statement, the anti-hallucination notes, the generic template and the generated framework.
  • Last class's research tasks, on open and closed models and the AI glossary, are still open if you have not finished them.
  • Watch the free Learn Prompting course (about an hour); the link is in the class chat.
  • No SDET Club access yet? Fill in the required access form with your phone number, and access follows the same day.
  • Next class, Monday: JavaScript from scratch. Have VS Code or Antigravity ready, with your GitHub account set up.