# Record Tests (experimental)

{% hint style="info" %}
This is an experimental feature and may change or be removed in the future
{% endhint %}

Tests can be generated by recording your own interactions with the device through the browser.

Simply add `await session.record()` anywhere in your test and then run your test in headed mode (`npx playwright test --headed`)

```javascript
test('plays back my interactions', async ({ session }) => {
    await session.record()
})
```

Playwright will pause at `session.record()` and any interactions you make on the device will be put here.

Once you are finished, click the Resume button on the Playwright Inspector:

<figure><img src="https://github.com/appetizeio/appetize-docs-gitbook/blob/master/.gitbook/assets/playwright-inspector.png" alt=""><figcaption><p>Image of Playwright Inspector window</p></figcaption></figure>

You will see that `session.record()` has been replaced with your interactions:

```javascript
test('plays back my interactions', async ({ session }) => {
  // Recorded using session.record()
  // 1. click on element with class "android.widget.Button"
  // 2. click on element with class "android.widget.TextView"
  // 3. click on element with class "android.widget.Button"
  await session.playActions([
   ...
  ])
})
```

Run the test again and it will replay the recording.


---

# Agent Instructions: 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:

```
GET https://docs.appetize.io/testing/record-tests-experimental.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
