> For the complete documentation index, see [llms.txt](https://docs.walnutai.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.walnutai.ai/test-and-quality-management/introduction-to-custom-methods/create-custom-methods-in-vs-code.md).

# Create Custom Methods in VS Code

After connecting your repository, follow the steps below to create and configure your Custom Method.

The WalnutAI VS Code extension allows you to seamlessly create, debug, sync, and manage Custom Methods directly from Visual Studio Code. Follow the steps below to set up the extension, create your Custom Method, and make it available for use in your WalnutAI tests.

**Steps to Create a Custom Method:**

* Open **VS Code** and navigate to the **Extensions** panel.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FMOLuRQja619dGEImZ1bc%2FScreenshot%202026-09-04%20at%201.44.43%E2%80%AFPM.png?alt=media&amp;token=ea0572c7-5fb9-4a2d-9d2d-0e4de36eda68" alt=""><figcaption></figcaption></figure>

* Search for **WalnutAI** in the search bar and click **Install**.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FH2q8s6mind9oVWSGEWlG%2FScreenshot%202026-09-04%20at%201.45.40%E2%80%AFPM.png?alt=media&amp;token=65ca008b-6728-40a2-aec5-9096ea204355" alt=""><figcaption></figcaption></figure>

* Once the WalnutAI icon appears in the sidebar, click on it and log in to your **WalnutAI account**.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FrRIcBWmgWe242QXhA671%2FScreenshot%202026-09-04%20at%201.47.38%E2%80%AFPM.png?alt=media&amp;token=471b3842-d565-4c35-bfe5-21652344d9dd" alt=""><figcaption></figcaption></figure>

* After logging in, open a folder where you want to work with your Custom Methods.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2F1b7Sc3qCu4EHYyzk7iYk%2FScreenshot%202026-09-04%20at%201.52.53%E2%80%AFPM.png?alt=media&amp;token=ec45d8b7-57cf-450a-a207-4da82ba1a741" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
As a prerequisite, please ensure that **Git Bash** and **Node.js** are installed on your system.
{% endhint %}

* Select the required **project** from the dropdown.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FxwCDs7cz8sdKqVyA1WM5%2FScreenshot%202026-09-04%20at%201.50.43%E2%80%AFPM.png?alt=media&amp;token=ce79f413-da3b-4939-be58-ea9c22189781" alt=""><figcaption></figcaption></figure>

* Once the project is selected, switch the tab to QA and click **Install Playwright MCP**.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2F4n8T8uRmdbpQWKNzZIaH%2FScreenshot%202026-09-04%20at%201.55.29%E2%80%AFPM.png?alt=media&amp;token=e8e2ea6c-c622-46d3-ae6f-2ddc203f3ab4" alt=""><figcaption></figcaption></figure>

* After installing Playwright MCP, click **Methods** to view the repository connected under it.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FFYG3zdqytdSH4hOCvgye%2FScreenshot%202026-09-04%20at%202.03.04%E2%80%AFPM.png?alt=media&amp;token=4f40cbba-1be0-4462-b793-d504710499cc" alt=""><figcaption></figcaption></figure>

* Once done, open and **initialize the repository**.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FkOlnzbUbHLvbO1b1l5mE%2FScreenshot%202026-09-04%20at%202.06.52%E2%80%AFPM.png?alt=media&amp;token=3d6b60d7-00df-4a5c-952d-ae6803e2c182" alt=""><figcaption></figcaption></figure>

* Click **Create Method** and enter a prompt describing the Custom Method you want to create. For example, you can enter a prompt such as **“*****Generate an employee ID starting with S, followed by four digits.*****”**

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2F5wL5qZ4MyTJsMsUpFz43%2FScreenshot%202026-09-29%20at%205.19.00%E2%80%AFPM.png?alt=media&amp;token=be3c87cc-4edb-44bf-8bde-2532c210b50a" alt=""><figcaption></figcaption></figure>

* Once you send the prompt, WalnutAI generates a code file for the Custom Method based on the prompt you provided.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FC0B01xnMnDlM6uxkRUvO%2FScreenshot%202026-09-29%20at%204.53.09%E2%80%AFPM.png?alt=media&amp;token=de1ec551-a017-4b3d-8890-9044382c45a7" alt=""><figcaption></figcaption></figure>

* Click **Sync** to sync the created Custom Method with the WalnutAI frontend.&#x20;

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FZVrbzXW9yE694rktke21%2FScreenshot%202026-09-29%20at%204.55.05%E2%80%AFPM.png?alt=media&amp;token=77957891-4525-4d74-9ac7-66ea4a1ac14b" alt=""><figcaption></figcaption></figure>

* In WalnutAI, navigate to **Admin Settings** and open **Custom Settings**.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FmdvHtZBolB44MFiFUsrS%2FScreenshot%202026-09-29%20at%204.56.38%E2%80%AFPM.png?alt=media&amp;token=2d1cb62e-8e36-4019-b258-c80f2f8bb332" alt=""><figcaption></figcaption></figure>

* Switch to the **Custom Methods** tab, locate the method you created, and if it is not synced, click **Sync Actions**.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FxTelw9j8uUkaZkT3KB4y%2FScreenshot%202026-09-29%20at%204.57.36%E2%80%AFPM.png?alt=media&amp;token=e93661c4-298b-4a56-b2f3-bac837f34d17" alt=""><figcaption></figcaption></figure>

* Once the method is synced, set breakpoints in **VS Code**, and **Enable Debug Mode** in VS Code.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FaMs3fPzBsNTotXFr2t2I%2FScreenshot%202026-09-29%20at%204.58.59%E2%80%AFPM.png?alt=media&amp;token=8ef751f2-f9ce-4a30-8b07-50025994648b" alt=""><figcaption></figcaption></figure>

* Add the created **Custom Method** to the required test case by typing **/** in the test step and select **Actions**.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FywPy7O6GBG0tfw2GwFDR%2FScreenshot%202026-09-29%20at%205.03.17%E2%80%AFPM.png?alt=media&amp;token=9078eccc-f742-4b55-8d84-557a1f9d65b5" alt=""><figcaption></figcaption></figure>

* From the **Actions** dropdown, select the created **Custom Method** and replace the required parameters.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FobBI2TznhXmoxJe7YlRa%2FScreenshot%202026-09-29%20at%205.04.51%E2%80%AFPM.png?alt=media&amp;token=9ad2e967-d97d-445d-8146-8a6ce734e0b3" alt=""><figcaption></figcaption></figure>

* Click **Debug** in the **WalnutAI** to debug the Custom Method and validate that it is working as expected.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FWVNBxxrfTPqK9DVBsMGp%2FScreenshot%202026-09-29%20at%205.05.45%E2%80%AFPM.png?alt=media&amp;token=497f7819-8db6-4107-8e2d-24168377a040" alt=""><figcaption></figcaption></figure>

* Click **Push** if you want to push the created Custom Method and your latest changes to the repository, making them accessible to your teammates as well.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FSddmve0AjApFEysyUfQc%2FScreenshot%202026-09-29%20at%205.09.12%E2%80%AFPM.png?alt=media&amp;token=f1e7628a-ec88-46b8-92a1-c72b6fc13fd9" alt=""><figcaption></figcaption></figure>

* Click **Pull** to retrieve the latest changes from the Git repository.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2F6g1VJIVFBTojhTocRRCQ%2FScreenshot%202026-09-29%20at%205.07.54%E2%80%AFPM.png?alt=media&amp;token=982eb223-6731-4bdd-915e-dc1f27f34ccb" alt=""><figcaption></figcaption></figure>
