> For the complete documentation index, see [llms.txt](https://bugowl.gitbook.io/bugowl-ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bugowl.gitbook.io/bugowl-ai/best-practices-for-writing-test-prompts.md).

# Best Practices for Writing Test Prompts

### Writing Effective Test Prompts

Learn how to write clear, actionable test prompts that BugOwl AI can understand and execute reliably.

#### Prompt Writing Guidelines

**Be Specific and Clear**

* Use simple, direct language
* Avoid ambiguous terms or complex sentences
* Be explicit about what you want to test

**Good Examples:**

* "Click the login button"
* "Enter '<test@example.com>' in the email field"
* "Verify the welcome message appears"

**Bad Examples:**

* "Do the login thing"
* "Check if it works"
* "Make sure everything is good"

#### Action-Oriented Language

**Use Action Verbs**

* Click, Enter, Select, Navigate, Verify, Check
* Be clear about the action you want performed
* Specify the target element or area

**Element Identification**

* Use visible text when possible ("Click 'Submit' button")
* Reference form labels ("Enter password in 'Password' field")
* Use page context ("Click the blue 'Login' button in the header")

#### Test Data Integration

**Using Variables**

* Reference test data with @syntax: "@email", "@password"
* Create meaningful variable names
* Use consistent naming across test cases

**Example:**

* "Enter @email in the email field"
* "Click @button\_text to submit the form"

#### Assertion Best Practices

**Clear Expectations**

* State exactly what should happen
* Use specific text or values to verify
* Include visual elements when important

**Good Assertions:**

* "Verify 'Welcome back, John!' message appears"
* "Check that the cart shows 3 items"
* "Confirm the page title is 'Dashboard'"

#### Common Patterns

**Login Flows**

* "Navigate to the login page"
* "Enter @email in the email field"
* "Enter @password in the password field"
* "Click the 'Sign In' button"
* "Verify the dashboard loads successfully"

**Form Submissions**

* "Fill out the contact form with @name, @email, @message"
* "Click 'Send Message' button"
* "Verify 'Thank you for your message' appears"

**Navigation Testing**

* "Click the 'Products' menu item"
* "Select 'Electronics' from the category dropdown"
* "Verify the products page loads with electronics items"

#### Tips for Success

**Keep It Simple**

* One action per step
* Use everyday language
* Avoid technical jargon

**Be Consistent**

* Use the same terminology throughout
* Follow a consistent format for similar actions
* Maintain naming conventions

**Test Edge Cases**

* Include error scenarios
* Test with invalid data
* Verify error messages appear correctly

#### What to Avoid

**Vague Instructions**

* "Test the login" (too broad)
* "Make sure it works" (not specific)
* "Check everything" (unclear scope)

**Complex Sentences**

* "Click the button that says submit and then wait for the page to load and then check if the success message appears" (too many actions)

**Technical Assumptions**

* "Click the #submit-btn element" (assumes technical knowledge)
* "Use the API endpoint" (not user-focused)

#### Example Test Case

**Test: User Login**

1. "Navigate to the login page"
2. "Enter @valid\_email in the email field"
3. "Enter @valid\_password in the password field"
4. "Click the 'Sign In' button"
5. "Verify the user dashboard loads"
6. "Check that 'Welcome, @user\_name' message appears"

**Test: Invalid Login**

1. "Navigate to the login page"
2. "Enter @invalid\_email in the email field"
3. "Enter @invalid\_password in the password field"
4. "Click the 'Sign In' button"
5. "Verify 'Invalid credentials' error message appears"
6. "Check that the login form is still visible"

Remember: The clearer your prompts, the more reliable your tests will be!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bugowl.gitbook.io/bugowl-ai/best-practices-for-writing-test-prompts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
