> ## Documentation Index
> Fetch the complete documentation index at: https://docs.testavi.com/llms.txt
> Use this file to discover all available pages before exploring further.

> Avoid these common authoring mistakes to ensure your tests run reliably and clearly communicate intent

# Common Pitfalls When Writing Tests in Testavi

<AccordionGroup>
  <Accordion title="1. Incorrect or Misformatted Starting URL">
    **What happens:**

    Tests fail immediately or start on the wrong page.

    **Why it matters:**

    The Start URL is where Testavi begins your test flow—it must be complete and properly formatted.

    **Correct example:**

    Always include `https://` and the complete URL.

    <img src="https://mintcdn.com/testavi/flbTGuq-vK4oExzR/images/Screenshot2026-01-15at01.44.57.png?fit=max&auto=format&n=flbTGuq-vK4oExzR&q=85&s=d414e05f934ded7556c717e9ccfdff45" alt="Screenshot2026 01 15at01 44 57" width="904" height="168" data-path="images/Screenshot2026-01-15at01.44.57.png" />

    **Incorrect examples:**

    * Missing protocol (`https://`)

          <img src="https://mintcdn.com/testavi/flbTGuq-vK4oExzR/images/Screenshot2026-01-15at01.45.31.png?fit=max&auto=format&n=flbTGuq-vK4oExzR&q=85&s=35c92e8845cfb7f20103e529b2da7561" alt="Screenshot2026 01 15at01 45 31" width="906" height="174" data-path="images/Screenshot2026-01-15at01.45.31.png" />
    * Incomplete URLs

          <img src="https://mintcdn.com/testavi/flbTGuq-vK4oExzR/images/Screenshot2026-01-15at01.45.43.png?fit=max&auto=format&n=flbTGuq-vK4oExzR&q=85&s=64dfe160e3d37ce90998a0357d035630" alt="Screenshot2026 01 15at01 45 43" width="916" height="182" data-path="images/Screenshot2026-01-15at01.45.43.png" />

    <Tip>
      Always copy and paste the URL directly from the browser's address bar.
    </Tip>
  </Accordion>

  <Accordion title="2. Mixing Actions Inside 'Verify' Steps">
    **What happens:**

    Tests become semantically unclear or are misinterpreted.

    **Bad example:**

    <img src="https://mintcdn.com/testavi/flbTGuq-vK4oExzR/images/Screenshot2025-07-05at11.01.54AM.png?fit=max&auto=format&n=flbTGuq-vK4oExzR&q=85&s=2606525f3cbfd6cdcfbc4a70cf9b6b8e" alt="Screenshot2025 07 05at11 01 54AM" width="840" height="80" data-path="images/Screenshot2025-07-05at11.01.54AM.png" />

    **Good example:**

    <img src="https://mintcdn.com/testavi/flbTGuq-vK4oExzR/images/Screenshot2025-07-05at10.53.16AM.png?fit=max&auto=format&n=flbTGuq-vK4oExzR&q=85&s=92890171d906497fb7819ece8d461dc7" alt="Screenshot2025 07 05at10 53 16AM" width="840" height="132" data-path="images/Screenshot2025-07-05at10.53.16AM.png" />

    Separate verification and action into distinct steps.

    **Rule of thumb:**

    * **Actions** = things the test does (e.g., click, scroll)
    * **Verifications** = things the test checks (e.g., visible, present)

    Keep them in separate steps.
  </Accordion>

  <Accordion title="3. Using Go to URL Inside Test Steps">
    **What happens:** Testavi can't interpret "Go to URL" commands mid-test, causing scripts to fail.

    **Bad example:**

    <img src="https://mintcdn.com/testavi/flbTGuq-vK4oExzR/images/Screenshot2025-07-05at11.54.00AM.png?fit=max&auto=format&n=flbTGuq-vK4oExzR&q=85&s=2248425bc1e688ae0a8fb997395d5910" alt="Screenshot2025 07 05at11 54 00AM" width="840" height="127" data-path="images/Screenshot2025-07-05at11.54.00AM.png" />

    **Good example:**

    * Set the Start URL in your test's settings

          <img src="https://mintcdn.com/testavi/flbTGuq-vK4oExzR/images/Screenshot2025-07-05at11.54.57AM-1.png?fit=max&auto=format&n=flbTGuq-vK4oExzR&q=85&s=2670057d60c1867f1c05d11088d25547" alt="Screenshot2025 07 05at11 54 57AM 1" width="840" height="73" data-path="images/Screenshot2025-07-05at11.54.57AM-1.png" />
    * Use actions for in-test navigation (e.g., click on navigation links)

          <img src="https://mintcdn.com/testavi/flbTGuq-vK4oExzR/images/Screenshot2025-07-05at11.58.12AM.png?fit=max&auto=format&n=flbTGuq-vK4oExzR&q=85&s=a8d152b5e80a69f97c5cffe6cecae709" alt="Screenshot2025 07 05at11 58 12AM" width="840" height="126" data-path="images/Screenshot2025-07-05at11.58.12AM.png" />
  </Accordion>

  <Accordion title="4. Scrolling">
    **What happens:**

    The agent only interacts with elements in view unless instructed otherwise. Tests may fail to locate off-screen elements.

    **What to do:**

    Explicitly include scroll steps before verifications or actions.

    <img src="https://mintcdn.com/testavi/flbTGuq-vK4oExzR/images/Screenshot2025-07-05at12.09.50PM.png?fit=max&auto=format&n=flbTGuq-vK4oExzR&q=85&s=e786a73725836c95ab8bb9f813b969ba" alt="Screenshot2025 07 05at12 09 50PM" width="840" height="126" data-path="images/Screenshot2025-07-05at12.09.50PM.png" />

    The agent will also scroll to find out-of-viewport items, but specifying scrolls improves test stability. See Discrete Actions: Scroll.

    <Info>
      Remember that the agent sees only what a human sees. Include scroll instructions to ensure consistent element visibility.
    </Info>
  </Accordion>
</AccordionGroup>

## ✅ Authoring Do's & Don'ts

| ❌ Don't                          | ✅ Do                                                         |
| -------------------------------- | ------------------------------------------------------------ |
| Use incomplete or incorrect URLs | Use full URLs including `https://`, copy directly            |
| Mix actions and verifications    | Keep actions and checks in separate steps                    |
| Use "Go to URL" mid-test         | Set the start URL in test settings                           |
| Omit scroll instructions         | Explicitly include scroll steps before actions/verifications |
