> For the complete documentation index, see [llms.txt](https://docs.puppetry.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.puppetry.app/master/test-step/target-commands.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.puppetry.app/master/test-step/target-commands.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
