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

# Run Script

> Execute custom Playwright code snippets within your test

## Usecase

**Purpose:** This is a powerful, advanced action for users who need to run custom code snippets. It gives you direct access to the Playwright execution context, allowing you to perform complex actions, custom assertions, or page manipulations.

This option is available under the "Add an instruction" dropdown.

***

### Arguments

This action requires two inputs:

* **Enter Description here:** A plain-English overview of what your code does (e.g., "Fetches a value from local storage"). This is for your own reference to keep the test readable.
* **Enter your script here:** The actual Playwright-compatible JavaScript code you want to execute.

***

### How to Use

1. Select **"Run Script"** from the "Add an instruction" dropdown.
2. Fill in the **Description** and **Script** fields with your notes and code.
   <img src="https://mintcdn.com/litmuscheck/CakgjT-98Pfb8VJd/images/composing/RunScript.png?fit=max&auto=format&n=CakgjT-98Pfb8VJd&q=85&s=80bfd72d1c9e628218458e6eef0eefee" alt="Test script" width="594" height="346" data-path="images/composing/RunScript.png" />
3. Click the **"Add"** button. The custom script will immediately execute in the browser context.
4. You can see the result or output of your script in the execution window, just like a standard test step.
   <img src="https://mintcdn.com/litmuscheck/CakgjT-98Pfb8VJd/images/composing/RunScript02.png?fit=max&auto=format&n=CakgjT-98Pfb8VJd&q=85&s=043ada5d7a4dc8866d8667bb5e566e99" alt="Test script" width="568" height="193" data-path="images/composing/RunScript02.png" />
