# Target Commands

## target.type

Focuses the element, and then sends keyboard events for each character in the text

![](/files/-LhVKb_cTMZecAmJQk7O)

## target.select

Sets value on select element

![](/files/-LhVKemidM0zF-zWjUax)

## target.focus

Focuses the element

![](/files/-LhVKhPUluU0fzRSdoel)

## target.click

Emulates mouse click on the element

![](/files/-LhZhYVOcYb0WIdnn8K4)

## target.reset

Resets the input or form element

![](/files/-LhZh_vJgkVoqnkkLXTk)

## target.upload

Sets the value of a file input. Note that the target element must be INPUT of FILE type. It is also recommended to emulate click on the target (or clickable element calling the file browser) before going with this command

![](/files/-LhZhcYE7FFOmyMYwKKN)

## target.tap

Taps the element

![](/files/-LhZhf0Av-UMZkBJyUvX)

## target.scroll

Sets the number of pixels that an element's content is scrolled horizontally/vertically.

![](/files/-LhZhgsMospYE7AUNrdG)

## target.hover

Scrolls element into view if needed, and then hovers over the center of the element

![](/files/-LhZhjGXL_ghOK9rzq-j)

## target.checkBox

Toggles checkbox/radio state

![](/files/-LhZhlV-nLPkw_75P885)

## target.toggleClass

Toggles the specified class value (adds or removes)

![](/files/-LhZhps1m3bXm_h3-riL)

## target.setAttribute

Sets the value of an [attribute](https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute) on a target

![](/files/-LhZhtVeIo0bKfbCGRDi)

## target.screenshot

Takes a screenshot of the target element.

![](/files/-Ljpzg0dm7ma2P44C1KA)


---

# 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.puppetry.app/master/test-step/target-commands.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.
