# Menu options

The `Write Tests` menu option can be used throughout IntelliJ:

* Right click in the [Project Tool Window](#project-tool-window).
* Right click in the [Structure Tool Window](#structure-tool-window).
* Right click in the [Text Editor](#text-editor).
* Use the [Diffblue Menu Bar](#diffblue-menu-bar).

The `Write Tests` menu option will create tests for your methods and classes but each menu option works slightly differently to produce tests for different parts of your code.

## Project Tool Window

When navigating through your project, you'll likely use the project tool window in IntelliJ. Right-click on any of the elements and select `Write Tests`. Diffblue Cover will attempt to write tests for everything it can find within that package (license limitations may apply).

<div align="left"><figure><img src="/files/mIx8Y8CxVrlCHDrnECWJ" alt="" width="563"><figcaption></figcaption></figure></div>

You can also select multiple classes with `Shift` or `CTRL` (`CMD` on MacOS). Cover will attempt to write tests for every class within your selection.

<div align="left"><figure><img src="/files/ceFNQ4qtILQOZhokaLH8" alt="" width="563"><figcaption></figcaption></figure></div>

## Structure Tool Window

Similar to the Project Tool Window, IntelliJ provides a Structure menu to help you navigate around your codebase. In particular, the structure menu will show classes, methods and other elements in the currently open file. As with the Project Tool Window, right-click on any method in the Structure Tool Window and select `Write Tests`, and you can also select multiple methods with `Shift` or `CTRL` (`CMD` on MacOS).

<div align="left"><figure><img src="/files/Q4p0cLUmKEMfJsdxnzdE" alt="" width="563"><figcaption></figcaption></figure></div>

## Text Editor

In the IntelliJ editor panel, you can right-click a method or class to display the `Write Tests` menu option - an alternative to the gutter icon, but also allows you to right-click anywhere within a class or method.

<div align="left"><figure><img src="/files/GZSb2vG1Fo8kZxPo2XC0" alt="" width="563"><figcaption></figcaption></figure></div>

The menu option is also available when making one or more editor selections.

<div align="left"><figure><img src="/files/BoxwbkitL8j4FMZGK7ch" alt="" width="563"><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="/files/1LEjIccad4YIpqwiRKlW" alt="" width="563"><figcaption></figcaption></figure></div>

## Diffblue Menu Bar

The `Write Tests` menu option is also available from the Diffblue menu bar. This will perform the exact same function as the menu option in the text editor.

<div align="left"><figure><img src="/files/7T87iWP17oxylvHdK2BV" alt="" width="443"><figcaption></figcaption></figure></div>


---

# 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://cover-docs-preview.diffblue.com/features/cover-plugin/writing-tests/write-tests-menu-option.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.
