> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.doc-detective.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.doc-detective.com/_mcp/server.

# Navigation and interaction, written as tests

> One procedure that opens a page, clicks, types, and checks the result, shown as plain prose, as detected tests, as inline tests, and as a standalone spec, in every supported format.

Each example on this page shows one documented procedure four ways:

| Tab        | What the file holds                                                                                                                 |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| Prose      | The documentation as a reader sees it, with no test statements.                                                                     |
| Detected   | The same prose inside a `test` statement. Doc Detective's default detection turns the links, bold text, and quoted text into steps. |
| Inline     | The same prose with a `step` statement after each instruction, and detection off.                                                   |
| Standalone | A spec file, in JSON or YAML, with no documentation source.                                                                         |

Every variant is a real file that Doc Detective runs, and a check confirms that the variants resolve to the same steps. For how each mode works, see [Detected tests](/docs/test-docs/detected), [Inline tests](/docs/test-docs/inline), and [Standalone tests](/docs/test-docs/standalone).

## Open a page, type, and check the result

This procedure uses [`goTo`](/docs/actions/goto), [`click`](/docs/actions/click), [`type`](/docs/actions/type), and [`find`](/docs/actions/find).

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Echo text back

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Click **Type here:**.
3. Type "Hello, Doc Detective".
4. Check that the page shows **Hello, Doc Detective** below the field.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Echo text back

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Click **Type here:**.
3. Type "Hello, Doc Detective".
4. Check that the page shows **Hello, Doc Detective** below the field.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Echo text back

. Go to http://localhost:8092/type-echo.html[the type echo page].
. Click *Type here:*.
. Type "Hello, Doc Detective".
. Check that the page shows *Hello, Doc Detective* below the field.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Echo text back</title></head>
<body>
<h1>Echo text back</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/type-echo.html">the type echo page</a>.</li>
  <li>Click <strong>Type here:</strong>.</li>
  <li>Type "Hello, Doc Detective".</li>
  <li>Check that the page shows <strong>Hello, Doc Detective</strong> below the field.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Echo text back
==============

#. Go to `the type echo page <http://localhost:8092/type-echo.html>`_.
#. Click **Type here:**.
#. Type "Hello, Doc Detective".
#. Check that the page shows **Hello, Doc Detective** below the field.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="type-echo">
  <title>Echo text back</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/type-echo.html" scope="external" format="html">the type echo page</xref>.</cmd></step>
      <step><cmd>Click <uicontrol>Type here:</uicontrol>.</cmd></step>
      <step><cmd>Type "Hello, Doc Detective".</cmd></step>
      <step><cmd>Check that the page shows <b>Hello, Doc Detective</b> below the field.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"type-echo","detectSteps":true} -->

# Echo text back

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Click **Type here:**.
3. Type "Hello, Doc Detective".
4. Check that the page shows **Hello, Doc Detective** below the field.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"type-echo","detectSteps":true} */}

# Echo text back

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Click **Type here:**.
3. Type "Hello, Doc Detective".
4. Check that the page shows **Hello, Doc Detective** below the field.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Echo text back

// (test {"testId":"type-echo","detectSteps":true})

. Go to http://localhost:8092/type-echo.html[the type echo page].
. Click *Type here:*.
. Type "Hello, Doc Detective".
. Check that the page shows *Hello, Doc Detective* below the field.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Echo text back</title></head>
<body>
<!-- test {"testId":"type-echo","detectSteps":true} -->
<h1>Echo text back</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/type-echo.html">the type echo page</a>.</li>
  <li>Click <strong>Type here:</strong>.</li>
  <li>Type "Hello, Doc Detective".</li>
  <li>Check that the page shows <strong>Hello, Doc Detective</strong> below the field.</li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Echo text back
==============

.. test {"testId":"type-echo","detectSteps":true}

#. Go to `the type echo page <http://localhost:8092/type-echo.html>`_.
#. Click **Type here:**.
#. Type "Hello, Doc Detective".
#. Check that the page shows **Hello, Doc Detective** below the field.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="type-echo">
  <title>Echo text back</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"type-echo","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/type-echo.html" scope="external" format="html">the type echo page</xref>.</cmd></step>
      <step><cmd>Click <uicontrol>Type here:</uicontrol>.</cmd></step>
      <step><cmd>Type "Hello, Doc Detective".</cmd></step>
      <step><cmd>Check that the page shows <b>Hello, Doc Detective</b> below the field.</cmd></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"type-echo","detectSteps":false} -->

# Echo text back

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
   <!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
2. Click **Type here:**.
   <!-- step {"click":"Type here:"} -->
3. Type "Hello, Doc Detective".
   <!-- step {"type":"Hello, Doc Detective"} -->
4. Check that the page shows **Hello, Doc Detective** below the field.
   <!-- step {"find":"Hello, Doc Detective"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"type-echo","detectSteps":false} */}

# Echo text back

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
   {/* step {"goTo":"http://localhost:8092/type-echo.html"} */}
2. Click **Type here:**.
   {/* step {"click":"Type here:"} */}
3. Type "Hello, Doc Detective".
   {/* step {"type":"Hello, Doc Detective"} */}
4. Check that the page shows **Hello, Doc Detective** below the field.
   {/* step {"find":"Hello, Doc Detective"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Echo text back

// (test {"testId":"type-echo","detectSteps":false})

. Go to http://localhost:8092/type-echo.html[the type echo page].
+
// (step {"goTo":"http://localhost:8092/type-echo.html"})
. Click *Type here:*.
+
// (step {"click":"Type here:"})
. Type "Hello, Doc Detective".
+
// (step {"type":"Hello, Doc Detective"})
. Check that the page shows *Hello, Doc Detective* below the field.
+
// (step {"find":"Hello, Doc Detective"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Echo text back</title></head>
<body>
<!-- test {"testId":"type-echo","detectSteps":false} -->
<h1>Echo text back</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/type-echo.html">the type echo page</a>.
    <!-- step {"goTo":"http://localhost:8092/type-echo.html"} --></li>
  <li>Click <strong>Type here:</strong>.
    <!-- step {"click":"Type here:"} --></li>
  <li>Type "Hello, Doc Detective".
    <!-- step {"type":"Hello, Doc Detective"} --></li>
  <li>Check that the page shows <strong>Hello, Doc Detective</strong> below the field.
    <!-- step {"find":"Hello, Doc Detective"} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Echo text back
==============

.. test {"testId":"type-echo","detectSteps":false}

#. Go to `the type echo page <http://localhost:8092/type-echo.html>`_.

   .. step {"goTo":"http://localhost:8092/type-echo.html"}

#. Click **Type here:**.

   .. step {"click":"Type here:"}

#. Type "Hello, Doc Detective".

   .. step {"type":"Hello, Doc Detective"}

#. Check that the page shows **Hello, Doc Detective** below the field.

   .. step {"find":"Hello, Doc Detective"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="type-echo">
  <title>Echo text back</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"type-echo","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/type-echo.html" scope="external" format="html">the type echo page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/></info></step>
      <step><cmd>Click <uicontrol>Type here:</uicontrol>.</cmd>
        <info><data name="doc-detective" value='step {"click":"Type here:"}'/></info></step>
      <step><cmd>Type "Hello, Doc Detective".</cmd>
        <info><data name="doc-detective" value='step {"type":"Hello, Doc Detective"}'/></info></step>
      <step><cmd>Check that the page shows <b>Hello, Doc Detective</b> below the field.</cmd>
        <info><data name="doc-detective" value='step {"find":"Hello, Doc Detective"}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "type-echo",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "click": "Type here:"
        },
        {
          "type": "Hello, Doc Detective"
        },
        {
          "find": "Hello, Doc Detective"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: type-echo
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - click: "Type here:"
      - type: Hello, Doc Detective
      - find: Hello, Doc Detective
```

### What detection finds

In every format, default detection resolves the prose to six steps:

| Prose               | Detected steps                                  |
| ------------------- | ----------------------------------------------- |
| Go to a link        | `goTo` the URL, then `checkLink` the same URL   |
| Click a bold phrase | `click` the phrase, then `find` the same phrase |
| A bold phrase       | `find` the phrase                               |

Detection matches each link and bold phrase against every default rule. A link after "Go to" is both opened and checked, and a bold phrase after "Click" is both clicked and found. The inline and standalone variants list only the four steps the procedure needs.

In DITA, the quoted text and the `<b>` element follow the shared rules, so DITA detects the same steps as the other formats. A `<uicontrol>` element is DITA's own way to mark the control to click.

## Wait for a slow page to load

This procedure uses the object form of [`goTo`](/docs/actions/goto) with `origin`, a relative `url`, `params`, `surface`, `timeout`, and every [`waitUntil`](/reference/schemas/goto) condition. It also uses [`find`](/docs/actions/find) with a `/regex/` in `elementText`, and [`wait`](/docs/actions/wait) with a number.

Two [`checkLink`](/docs/actions/checklink) steps show both shapes of each option. The first sets `statusCodes` as a list and `headers` as an object, with a `timeout`. The second sets `origin`, `params`, a single status code, and `headers` as a string with one `Name: value` header per line.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Wait for a slow page

1. Go to [the wait delay page](http://localhost:8092/wait-delay.html).
2. Wait until the page shows **Loaded after 2 seconds**.
3. Click **Trigger delayed action**.
4. Wait half a second for the action to finish.
5. Check that the page shows **Action complete!**.
6. Confirm that [the server's status endpoint](http://localhost:8092/status/200) and [the API health check](http://localhost:8092/api/health) respond.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Wait for a slow page

1. Go to [the wait delay page](http://localhost:8092/wait-delay.html).
2. Wait until the page shows **Loaded after 2 seconds**.
3. Click **Trigger delayed action**.
4. Wait half a second for the action to finish.
5. Check that the page shows **Action complete!**.
6. Confirm that [the server's status endpoint](http://localhost:8092/status/200) and [the API health check](http://localhost:8092/api/health) respond.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Wait for a slow page

. Go to http://localhost:8092/wait-delay.html[the wait delay page].
. Wait until the page shows *Loaded after 2 seconds*.
. Click *Trigger delayed action*.
. Wait half a second for the action to finish.
. Check that the page shows *Action complete!*.
. Confirm that http://localhost:8092/status/200[the server's status endpoint] and http://localhost:8092/api/health[the API health check] respond.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for a slow page</title></head>
<body>
<h1>Wait for a slow page</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/wait-delay.html">the wait delay page</a>.</li>
  <li>Wait until the page shows <strong>Loaded after 2 seconds</strong>.</li>
  <li>Click <strong>Trigger delayed action</strong>.</li>
  <li>Wait half a second for the action to finish.</li>
  <li>Check that the page shows <strong>Action complete!</strong>.</li>
  <li>Confirm that <a href="http://localhost:8092/status/200">the server's status endpoint</a> and <a href="http://localhost:8092/api/health">the API health check</a> respond.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Wait for a slow page
====================

#. Go to `the wait delay page <http://localhost:8092/wait-delay.html>`_.
#. Wait until the page shows **Loaded after 2 seconds**.
#. Click **Trigger delayed action**.
#. Wait half a second for the action to finish.
#. Check that the page shows **Action complete!**.
#. Confirm that `the server's status endpoint <http://localhost:8092/status/200>``_ and ``the API health check <http://localhost:8092/api/health>`_ respond.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-wait-load">
  <title>Wait for a slow page</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/wait-delay.html" scope="external" format="html">the wait delay page</xref>.</cmd></step>
      <step><cmd>Wait until the page shows <b>Loaded after 2 seconds</b>.</cmd></step>
      <step><cmd>Click <b>Trigger delayed action</b>.</cmd></step>
      <step><cmd>Wait half a second for the action to finish.</cmd></step>
      <step><cmd>Check that the page shows <b>Action complete!</b>.</cmd></step>
      <step><cmd>Confirm that <xref href="http://localhost:8092/status/200" scope="external" format="html">the server's status endpoint</xref> and <xref href="http://localhost:8092/api/health" scope="external" format="html">the API health check</xref> respond.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-wait-load","detectSteps":true} -->

# Wait for a slow page

1. Go to [the wait delay page](http://localhost:8092/wait-delay.html).
2. Wait until the page shows **Loaded after 2 seconds**.
3. Click **Trigger delayed action**.
4. Wait half a second for the action to finish.
   <!-- step {"wait":500} -->
5. Check that the page shows **Action complete!**.
6. Confirm that [the server's status endpoint](http://localhost:8092/status/200) and [the API health check](http://localhost:8092/api/health) respond.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-wait-load","detectSteps":true} */}

# Wait for a slow page

1. Go to [the wait delay page](http://localhost:8092/wait-delay.html).
2. Wait until the page shows **Loaded after 2 seconds**.
3. Click **Trigger delayed action**.
4. Wait half a second for the action to finish.
   {/* step {"wait":500} */}
5. Check that the page shows **Action complete!**.
6. Confirm that [the server's status endpoint](http://localhost:8092/status/200) and [the API health check](http://localhost:8092/api/health) respond.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Wait for a slow page

// (test {"testId":"nav-wait-load","detectSteps":true})

. Go to http://localhost:8092/wait-delay.html[the wait delay page].
. Wait until the page shows *Loaded after 2 seconds*.
. Click *Trigger delayed action*.
. Wait half a second for the action to finish.
+
// (step {"wait":500})
. Check that the page shows *Action complete!*.
. Confirm that http://localhost:8092/status/200[the server's status endpoint] and http://localhost:8092/api/health[the API health check] respond.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for a slow page</title></head>
<body>
<!-- test {"testId":"nav-wait-load","detectSteps":true} -->
<h1>Wait for a slow page</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/wait-delay.html">the wait delay page</a>.</li>
  <li>Wait until the page shows <strong>Loaded after 2 seconds</strong>.</li>
  <li>Click <strong>Trigger delayed action</strong>.</li>
  <li>Wait half a second for the action to finish.
    <!-- step {"wait":500} --></li>
  <li>Check that the page shows <strong>Action complete!</strong>.</li>
  <li>Confirm that <a href="http://localhost:8092/status/200">the server's status endpoint</a> and <a href="http://localhost:8092/api/health">the API health check</a> respond.</li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Wait for a slow page
====================

.. test {"testId":"nav-wait-load","detectSteps":true}

#. Go to `the wait delay page <http://localhost:8092/wait-delay.html>`_.
#. Wait until the page shows **Loaded after 2 seconds**.
#. Click **Trigger delayed action**.
#. Wait half a second for the action to finish.

   .. step {"wait":500}

#. Check that the page shows **Action complete!**.
#. Confirm that `the server's status endpoint <http://localhost:8092/status/200>``_ and ``the API health check <http://localhost:8092/api/health>`_ respond.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-wait-load">
  <title>Wait for a slow page</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-wait-load","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/wait-delay.html" scope="external" format="html">the wait delay page</xref>.</cmd></step>
      <step><cmd>Wait until the page shows <b>Loaded after 2 seconds</b>.</cmd></step>
      <step><cmd>Click <b>Trigger delayed action</b>.</cmd></step>
      <step><cmd>Wait half a second for the action to finish.</cmd>
        <info><data name="doc-detective" value='step {"wait":500}'/></info></step>
      <step><cmd>Check that the page shows <b>Action complete!</b>.</cmd></step>
      <step><cmd>Confirm that <xref href="http://localhost:8092/status/200" scope="external" format="html">the server's status endpoint</xref> and <xref href="http://localhost:8092/api/health" scope="external" format="html">the API health check</xref> respond.</cmd></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-wait-load","detectSteps":false} -->

# Wait for a slow page

1. Go to [the wait delay page](http://localhost:8092/wait-delay.html).
   <!-- step {"goTo":{"url":"/wait-delay.html","origin":"http://localhost:8092","params":{"source":"docs"},"surface":"chrome","timeout":30000,"waitUntil":{"networkIdleTime":500,"domIdleTime":500,"find":{"selector":"p","elementId":"auto-message","elementText":"Loaded after 2 seconds"}}}} -->
2. Wait until the page shows **Loaded after 2 seconds**.
   <!-- step {"find":{"selector":"#auto-message","elementText":"/^Loaded after \\d+ seconds$/","timeout":5000}} -->
3. Click **Trigger delayed action**.
   <!-- step {"click":"Trigger delayed action"} -->
4. Wait half a second for the action to finish.
   <!-- step {"wait":500} -->
5. Check that the page shows **Action complete!**.
   <!-- step {"find":"Action complete!"} -->
6. Confirm that [the server's status endpoint](http://localhost:8092/status/200) and [the API health check](http://localhost:8092/api/health) respond.
   <!-- step {"checkLink":{"url":"http://localhost:8092/status/200","statusCodes":[200,204],"headers":{"Accept":"application/json"},"timeout":5000}} -->
   <!-- step {"checkLink":{"url":"/api/health","origin":"http://localhost:8092","params":{"source":"docs"},"statusCodes":200,"headers":"Accept: application/json\nX-Test: docs"}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-wait-load","detectSteps":false} */}

# Wait for a slow page

1. Go to [the wait delay page](http://localhost:8092/wait-delay.html).
   {/* step {"goTo":{"url":"/wait-delay.html","origin":"http://localhost:8092","params":{"source":"docs"},"surface":"chrome","timeout":30000,"waitUntil":{"networkIdleTime":500,"domIdleTime":500,"find":{"selector":"p","elementId":"auto-message","elementText":"Loaded after 2 seconds"}}}} */}
2. Wait until the page shows **Loaded after 2 seconds**.
   {/* step {"find":{"selector":"#auto-message","elementText":"/^Loaded after \\d+ seconds$/","timeout":5000}} */}
3. Click **Trigger delayed action**.
   {/* step {"click":"Trigger delayed action"} */}
4. Wait half a second for the action to finish.
   {/* step {"wait":500} */}
5. Check that the page shows **Action complete!**.
   {/* step {"find":"Action complete!"} */}
6. Confirm that [the server's status endpoint](http://localhost:8092/status/200) and [the API health check](http://localhost:8092/api/health) respond.
   {/* step {"checkLink":{"url":"http://localhost:8092/status/200","statusCodes":[200,204],"headers":{"Accept":"application/json"},"timeout":5000}} */}
   {/* step {"checkLink":{"url":"/api/health","origin":"http://localhost:8092","params":{"source":"docs"},"statusCodes":200,"headers":"Accept: application/json\nX-Test: docs"}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Wait for a slow page

// (test {"testId":"nav-wait-load","detectSteps":false})

. Go to http://localhost:8092/wait-delay.html[the wait delay page].
+
// (step {"goTo":{"url":"/wait-delay.html","origin":"http://localhost:8092","params":{"source":"docs"},"surface":"chrome","timeout":30000,"waitUntil":{"networkIdleTime":500,"domIdleTime":500,"find":{"selector":"p","elementId":"auto-message","elementText":"Loaded after 2 seconds"}}}})
. Wait until the page shows *Loaded after 2 seconds*.
+
// (step {"find":{"selector":"#auto-message","elementText":"/^Loaded after \\d+ seconds$/","timeout":5000}})
. Click *Trigger delayed action*.
+
// (step {"click":"Trigger delayed action"})
. Wait half a second for the action to finish.
+
// (step {"wait":500})
. Check that the page shows *Action complete!*.
+
// (step {"find":"Action complete!"})
. Confirm that http://localhost:8092/status/200[the server's status endpoint] and http://localhost:8092/api/health[the API health check] respond.
+
// (step {"checkLink":{"url":"http://localhost:8092/status/200","statusCodes":[200,204],"headers":{"Accept":"application/json"},"timeout":5000}})
+
// (step {"checkLink":{"url":"/api/health","origin":"http://localhost:8092","params":{"source":"docs"},"statusCodes":200,"headers":"Accept: application/json\nX-Test: docs"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for a slow page</title></head>
<body>
<!-- test {"testId":"nav-wait-load","detectSteps":false} -->
<h1>Wait for a slow page</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/wait-delay.html">the wait delay page</a>.
    <!-- step {"goTo":{"url":"/wait-delay.html","origin":"http://localhost:8092","params":{"source":"docs"},"surface":"chrome","timeout":30000,"waitUntil":{"networkIdleTime":500,"domIdleTime":500,"find":{"selector":"p","elementId":"auto-message","elementText":"Loaded after 2 seconds"}}}} --></li>
  <li>Wait until the page shows <strong>Loaded after 2 seconds</strong>.
    <!-- step {"find":{"selector":"#auto-message","elementText":"/^Loaded after \\d+ seconds$/","timeout":5000}} --></li>
  <li>Click <strong>Trigger delayed action</strong>.
    <!-- step {"click":"Trigger delayed action"} --></li>
  <li>Wait half a second for the action to finish.
    <!-- step {"wait":500} --></li>
  <li>Check that the page shows <strong>Action complete!</strong>.
    <!-- step {"find":"Action complete!"} --></li>
  <li>Confirm that <a href="http://localhost:8092/status/200">the server's status endpoint</a> and <a href="http://localhost:8092/api/health">the API health check</a> respond.
    <!-- step {"checkLink":{"url":"http://localhost:8092/status/200","statusCodes":[200,204],"headers":{"Accept":"application/json"},"timeout":5000}} -->
    <!-- step {"checkLink":{"url":"/api/health","origin":"http://localhost:8092","params":{"source":"docs"},"statusCodes":200,"headers":"Accept: application/json\nX-Test: docs"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Wait for a slow page
====================

.. test {"testId":"nav-wait-load","detectSteps":false}

#. Go to `the wait delay page <http://localhost:8092/wait-delay.html>`_.

   .. step {"goTo":{"url":"/wait-delay.html","origin":"http://localhost:8092","params":{"source":"docs"},"surface":"chrome","timeout":30000,"waitUntil":{"networkIdleTime":500,"domIdleTime":500,"find":{"selector":"p","elementId":"auto-message","elementText":"Loaded after 2 seconds"}}}}

#. Wait until the page shows **Loaded after 2 seconds**.

   .. step {"find":{"selector":"#auto-message","elementText":"/^Loaded after \\d+ seconds$/","timeout":5000}}

#. Click **Trigger delayed action**.

   .. step {"click":"Trigger delayed action"}

#. Wait half a second for the action to finish.

   .. step {"wait":500}

#. Check that the page shows **Action complete!**.

   .. step {"find":"Action complete!"}

#. Confirm that `the server's status endpoint <http://localhost:8092/status/200>``_ and ``the API health check <http://localhost:8092/api/health>`_ respond.

   .. step {"checkLink":{"url":"http://localhost:8092/status/200","statusCodes":[200,204],"headers":{"Accept":"application/json"},"timeout":5000}}

   .. step {"checkLink":{"url":"/api/health","origin":"http://localhost:8092","params":{"source":"docs"},"statusCodes":200,"headers":"Accept: application/json\nX-Test: docs"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-wait-load">
  <title>Wait for a slow page</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-wait-load","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/wait-delay.html" scope="external" format="html">the wait delay page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"/wait-delay.html","origin":"http://localhost:8092","params":{"source":"docs"},"surface":"chrome","timeout":30000,"waitUntil":{"networkIdleTime":500,"domIdleTime":500,"find":{"selector":"p","elementId":"auto-message","elementText":"Loaded after 2 seconds"}}}}'/></info></step>
      <step><cmd>Wait until the page shows <b>Loaded after 2 seconds</b>.</cmd>
        <info><data name="doc-detective" value='step {"find":{"selector":"#auto-message","elementText":"/^Loaded after \\d+ seconds$/","timeout":5000}}'/></info></step>
      <step><cmd>Click <b>Trigger delayed action</b>.</cmd>
        <info><data name="doc-detective" value='step {"click":"Trigger delayed action"}'/></info></step>
      <step><cmd>Wait half a second for the action to finish.</cmd>
        <info><data name="doc-detective" value='step {"wait":500}'/></info></step>
      <step><cmd>Check that the page shows <b>Action complete!</b>.</cmd>
        <info><data name="doc-detective" value='step {"find":"Action complete!"}'/></info></step>
      <step><cmd>Confirm that <xref href="http://localhost:8092/status/200" scope="external" format="html">the server's status endpoint</xref> and <xref href="http://localhost:8092/api/health" scope="external" format="html">the API health check</xref> respond.</cmd>
        <info><data name="doc-detective" value='step {"checkLink":{"url":"http://localhost:8092/status/200","statusCodes":[200,204],"headers":{"Accept":"application/json"},"timeout":5000}}'/><data name="doc-detective" value='step {"checkLink":{"url":"/api/health","origin":"http://localhost:8092","params":{"source":"docs"},"statusCodes":200,"headers":"Accept: application/json\nX-Test: docs"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-wait-load",
      "steps": [
        {
          "goTo": {
            "url": "/wait-delay.html",
            "origin": "http://localhost:8092",
            "params": {
              "source": "docs"
            },
            "surface": "chrome",
            "timeout": 30000,
            "waitUntil": {
              "networkIdleTime": 500,
              "domIdleTime": 500,
              "find": {
                "selector": "p",
                "elementId": "auto-message",
                "elementText": "Loaded after 2 seconds"
              }
            }
          }
        },
        {
          "find": {
            "selector": "#auto-message",
            "elementText": "/^Loaded after \\d+ seconds$/",
            "timeout": 5000
          }
        },
        {
          "click": "Trigger delayed action"
        },
        {
          "wait": 500
        },
        {
          "find": "Action complete!"
        },
        {
          "checkLink": {
            "url": "http://localhost:8092/status/200",
            "statusCodes": [
              200,
              204
            ],
            "headers": {
              "Accept": "application/json"
            },
            "timeout": 5000
          }
        },
        {
          "checkLink": {
            "url": "/api/health",
            "origin": "http://localhost:8092",
            "params": {
              "source": "docs"
            },
            "statusCodes": 200,
            "headers": "Accept: application/json\nX-Test: docs"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-wait-load
    steps:
      - goTo:
          url: /wait-delay.html
          origin: http://localhost:8092
          params:
            source: docs
          surface: chrome
          timeout: 30000
          waitUntil:
            networkIdleTime: 500
            domIdleTime: 500
            find:
              selector: p
              elementId: auto-message
              elementText: Loaded after 2 seconds
      - find:
          selector: "#auto-message"
          elementText: /^Loaded after \d+ seconds$/
          timeout: 5000
      - click: Trigger delayed action
      - wait: 500
      - find: Action complete!
      - checkLink:
          url: http://localhost:8092/status/200
          statusCodes:
            - 200
            - 204
          headers:
            Accept: application/json
          timeout: 5000
      - checkLink:
          url: /api/health
          origin: http://localhost:8092
          params:
            source: docs
          statusCodes: 200
          headers: |-
            Accept: application/json
            X-Test: docs
```

### What detection finds

No default rule detects a pause, so every detected variant carries a `step` statement for the `wait`. Detection resolves the rest of the prose to the string forms:

| Prose               | Detected steps                                    |
| ------------------- | ------------------------------------------------- |
| Go to a link        | `goTo` the URL, then `checkLink` the same URL     |
| A bold phrase       | `find` the phrase                                 |
| Click a bold phrase | `click` the phrase, then `find` the same phrase   |
| Any other link      | `checkLink` the URL with the default status codes |

Detected steps can't set `waitUntil`, query parameters, a regular expression, or accepted status codes. Write a `step` statement, as the inline variants do, when a page loads slowly or a link returns a status outside the defaults.

## Fill in a form by element attributes

This procedure locates elements by their attributes, not only by a CSS selector: `elementText`, `elementId`, `elementTestId`, `elementAria`, `elementClass` (as a string and as a list), and `elementAttribute`. It uses them on three actions:

* [`find`](/docs/actions/find) with `moveTo`, `timeout`, `surface`, `click` as `true` and as a button name, and `type` as an object, a list, and a string.
* [`type`](/docs/actions/type) with a `surface` and a `waitUntil` that waits for the network and the DOM to go idle and for an element to appear.
* [`click`](/docs/actions/click) with `timeout`, and `surface` as an engine name and as an object.

For every field, see the [`find`](/reference/schemas/find), [`type`](/reference/schemas/type), and [`click`](/reference/schemas/click) schemas.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Fill in a form by element attributes

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Submit by ID** button near the top of the page.
3. Click the username field and type "kittens".
4. Click the password field and type "hunter2".
5. Click the contact email field and type "you@example.com".
6. Type "-cat" at the end of the username.
7. Type "docs" in the search field, and wait for the page to settle.
8. Check that the **Submit Order** button is enabled.
9. Click **Save**.
10. Click **Login Submit**.
11. Confirm that the page shows **Operation successful**.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Fill in a form by element attributes

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Submit by ID** button near the top of the page.
3. Click the username field and type "kittens".
4. Click the password field and type "hunter2".
5. Click the contact email field and type "you@example.com".
6. Type "-cat" at the end of the username.
7. Type "docs" in the search field, and wait for the page to settle.
8. Check that the **Submit Order** button is enabled.
9. Click **Save**.
10. Click **Login Submit**.
11. Confirm that the page shows **Operation successful**.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Fill in a form by element attributes

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
. Find the *Submit by ID* button near the top of the page.
. Click the username field and type "kittens".
. Click the password field and type "hunter2".
. Click the contact email field and type "you@example.com".
. Type "-cat" at the end of the username.
. Type "docs" in the search field, and wait for the page to settle.
. Check that the *Submit Order* button is enabled.
. Click *Save*.
. Click *Login Submit*.
. Confirm that the page shows *Operation successful*.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Fill in a form by element attributes</title></head>
<body>
<h1>Fill in a form by element attributes</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.</li>
  <li>Find the <strong>Submit by ID</strong> button near the top of the page.</li>
  <li>Click the username field and type "kittens".</li>
  <li>Click the password field and type "hunter2".</li>
  <li>Click the contact email field and type "you@example.com".</li>
  <li>Type "-cat" at the end of the username.</li>
  <li>Type "docs" in the search field, and wait for the page to settle.</li>
  <li>Check that the <strong>Submit Order</strong> button is enabled.</li>
  <li>Click <strong>Save</strong>.</li>
  <li>Click <strong>Login Submit</strong>.</li>
  <li>Confirm that the page shows <strong>Operation successful</strong>.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Fill in a form by element attributes
====================================

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.
#. Find the **Submit by ID** button near the top of the page.
#. Click the username field and type "kittens".
#. Click the password field and type "hunter2".
#. Click the contact email field and type "you@example.com".
#. Type "-cat" at the end of the username.
#. Type "docs" in the search field, and wait for the page to settle.
#. Check that the **Submit Order** button is enabled.
#. Click **Save**.
#. Click **Login Submit**.
#. Confirm that the page shows **Operation successful**.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elements">
  <title>Fill in a form by element attributes</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd></step>
      <step><cmd>Find the <b>Submit by ID</b> button near the top of the page.</cmd></step>
      <step><cmd>Click the username field and type "kittens".</cmd></step>
      <step><cmd>Click the password field and type "hunter2".</cmd></step>
      <step><cmd>Click the contact email field and type "you@example.com".</cmd></step>
      <step><cmd>Type "-cat" at the end of the username.</cmd></step>
      <step><cmd>Type "docs" in the search field, and wait for the page to settle.</cmd></step>
      <step><cmd>Check that the <b>Submit Order</b> button is enabled.</cmd></step>
      <step><cmd>Click <b>Save</b>.</cmd></step>
      <step><cmd>Click <b>Login Submit</b>.</cmd></step>
      <step><cmd>Confirm that the page shows <b>Operation successful</b>.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-find-elements","detectSteps":true} -->

# Fill in a form by element attributes

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Submit by ID** button near the top of the page.
3. Click the username field and type "kittens".
4. Click the password field and type "hunter2".
5. Click the contact email field and type "you@example.com".
6. Type "-cat" at the end of the username.
7. Type "docs" in the search field, and wait for the page to settle.
8. Check that the **Submit Order** button is enabled.
9. Click **Save**.
10. Click **Login Submit**.
11. Confirm that the page shows **Operation successful**.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-find-elements","detectSteps":true} */}

# Fill in a form by element attributes

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Submit by ID** button near the top of the page.
3. Click the username field and type "kittens".
4. Click the password field and type "hunter2".
5. Click the contact email field and type "you@example.com".
6. Type "-cat" at the end of the username.
7. Type "docs" in the search field, and wait for the page to settle.
8. Check that the **Submit Order** button is enabled.
9. Click **Save**.
10. Click **Login Submit**.
11. Confirm that the page shows **Operation successful**.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Fill in a form by element attributes

// (test {"testId":"nav-find-elements","detectSteps":true})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
. Find the *Submit by ID* button near the top of the page.
. Click the username field and type "kittens".
. Click the password field and type "hunter2".
. Click the contact email field and type "you@example.com".
. Type "-cat" at the end of the username.
. Type "docs" in the search field, and wait for the page to settle.
. Check that the *Submit Order* button is enabled.
. Click *Save*.
. Click *Login Submit*.
. Confirm that the page shows *Operation successful*.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Fill in a form by element attributes</title></head>
<body>
<!-- test {"testId":"nav-find-elements","detectSteps":true} -->
<h1>Fill in a form by element attributes</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.</li>
  <li>Find the <strong>Submit by ID</strong> button near the top of the page.</li>
  <li>Click the username field and type "kittens".</li>
  <li>Click the password field and type "hunter2".</li>
  <li>Click the contact email field and type "you@example.com".</li>
  <li>Type "-cat" at the end of the username.</li>
  <li>Type "docs" in the search field, and wait for the page to settle.</li>
  <li>Check that the <strong>Submit Order</strong> button is enabled.</li>
  <li>Click <strong>Save</strong>.</li>
  <li>Click <strong>Login Submit</strong>.</li>
  <li>Confirm that the page shows <strong>Operation successful</strong>.</li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Fill in a form by element attributes
====================================

.. test {"testId":"nav-find-elements","detectSteps":true}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.
#. Find the **Submit by ID** button near the top of the page.
#. Click the username field and type "kittens".
#. Click the password field and type "hunter2".
#. Click the contact email field and type "you@example.com".
#. Type "-cat" at the end of the username.
#. Type "docs" in the search field, and wait for the page to settle.
#. Check that the **Submit Order** button is enabled.
#. Click **Save**.
#. Click **Login Submit**.
#. Confirm that the page shows **Operation successful**.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elements">
  <title>Fill in a form by element attributes</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elements","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd></step>
      <step><cmd>Find the <b>Submit by ID</b> button near the top of the page.</cmd></step>
      <step><cmd>Click the username field and type "kittens".</cmd></step>
      <step><cmd>Click the password field and type "hunter2".</cmd></step>
      <step><cmd>Click the contact email field and type "you@example.com".</cmd></step>
      <step><cmd>Type "-cat" at the end of the username.</cmd></step>
      <step><cmd>Type "docs" in the search field, and wait for the page to settle.</cmd></step>
      <step><cmd>Check that the <b>Submit Order</b> button is enabled.</cmd></step>
      <step><cmd>Click <b>Save</b>.</cmd></step>
      <step><cmd>Click <b>Login Submit</b>.</cmd></step>
      <step><cmd>Confirm that the page shows <b>Operation successful</b>.</cmd></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-find-elements","detectSteps":false} -->

# Fill in a form by element attributes

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Submit by ID** button near the top of the page.
   <!-- step {"find":{"elementId":"submit-button","elementText":"Submit by ID","elementAria":"Submit form button","moveTo":true}} -->
3. Click the username field and type "kittens".
   <!-- step {"find":{"selector":"input","elementTestId":"username-field","click":true,"type":{"keys":["kittens"]},"timeout":10000}} -->
4. Click the password field and type "hunter2".
   <!-- step {"find":{"elementTestId":"password-field","elementClass":"form-control","click":"left","type":"hunter2","surface":"chrome"}} -->
5. Click the contact email field and type "you@example.com".
   <!-- step {"find":{"elementId":"contact-email","elementAttribute":{"data-validation":"email-regex-validator"},"click":true,"type":["you@example.com"]}} -->
6. Type "-cat" at the end of the username.
   <!-- step {"type":{"keys":"-cat","elementId":"username-input","elementTestId":"username-field","elementAttribute":{"placeholder":"Username"}}} -->
7. Type "docs" in the search field, and wait for the page to settle.
   <!-- step {"type":{"keys":["docs"],"elementAria":"Search input field","elementClass":["form-control"],"surface":"chrome","timeout":5000,"waitUntil":{"networkIdleTime":100,"domIdleTime":100,"find":{"elementTestId":"result-display","elementText":"Operation successful"}}}} -->
8. Check that the **Submit Order** button is enabled.
   <!-- step {"find":{"selector":"button","elementText":"/^Submit Ord/","elementTestId":"checkout-button","elementClass":["btn","/^btn-prim/"],"elementAttribute":{"data-enabled":"true","disabled":false}}} -->
9. Click **Save**.
   <!-- step {"click":{"elementText":"Save","elementAttribute":{"aria-label":"Save document button"},"elementClass":"btn-primary","timeout":5000,"surface":"chrome"}} -->
10. Click **Login Submit**.
   <!-- step {"click":{"elementTestId":"login-form-submit","elementClass":["btn","btn-large"],"surface":{"browser":"chrome"}}} -->
11. Confirm that the page shows **Operation successful**.
   <!-- step {"find":"Operation successful"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-find-elements","detectSteps":false} */}

# Fill in a form by element attributes

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Submit by ID** button near the top of the page.
   {/* step {"find":{"elementId":"submit-button","elementText":"Submit by ID","elementAria":"Submit form button","moveTo":true}} */}
3. Click the username field and type "kittens".
   {/* step {"find":{"selector":"input","elementTestId":"username-field","click":true,"type":{"keys":["kittens"]},"timeout":10000}} */}
4. Click the password field and type "hunter2".
   {/* step {"find":{"elementTestId":"password-field","elementClass":"form-control","click":"left","type":"hunter2","surface":"chrome"}} */}
5. Click the contact email field and type "you@example.com".
   {/* step {"find":{"elementId":"contact-email","elementAttribute":{"data-validation":"email-regex-validator"},"click":true,"type":["you@example.com"]}} */}
6. Type "-cat" at the end of the username.
   {/* step {"type":{"keys":"-cat","elementId":"username-input","elementTestId":"username-field","elementAttribute":{"placeholder":"Username"}}} */}
7. Type "docs" in the search field, and wait for the page to settle.
   {/* step {"type":{"keys":["docs"],"elementAria":"Search input field","elementClass":["form-control"],"surface":"chrome","timeout":5000,"waitUntil":{"networkIdleTime":100,"domIdleTime":100,"find":{"elementTestId":"result-display","elementText":"Operation successful"}}}} */}
8. Check that the **Submit Order** button is enabled.
   {/* step {"find":{"selector":"button","elementText":"/^Submit Ord/","elementTestId":"checkout-button","elementClass":["btn","/^btn-prim/"],"elementAttribute":{"data-enabled":"true","disabled":false}}} */}
9. Click **Save**.
   {/* step {"click":{"elementText":"Save","elementAttribute":{"aria-label":"Save document button"},"elementClass":"btn-primary","timeout":5000,"surface":"chrome"}} */}
10. Click **Login Submit**.
   {/* step {"click":{"elementTestId":"login-form-submit","elementClass":["btn","btn-large"],"surface":{"browser":"chrome"}}} */}
11. Confirm that the page shows **Operation successful**.
   {/* step {"find":"Operation successful"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Fill in a form by element attributes

// (test {"testId":"nav-find-elements","detectSteps":false})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Submit by ID* button near the top of the page.
+
// (step {"find":{"elementId":"submit-button","elementText":"Submit by ID","elementAria":"Submit form button","moveTo":true}})
. Click the username field and type "kittens".
+
// (step {"find":{"selector":"input","elementTestId":"username-field","click":true,"type":{"keys":["kittens"]},"timeout":10000}})
. Click the password field and type "hunter2".
+
// (step {"find":{"elementTestId":"password-field","elementClass":"form-control","click":"left","type":"hunter2","surface":"chrome"}})
. Click the contact email field and type "you@example.com".
+
// (step {"find":{"elementId":"contact-email","elementAttribute":{"data-validation":"email-regex-validator"},"click":true,"type":["you@example.com"]}})
. Type "-cat" at the end of the username.
+
// (step {"type":{"keys":"-cat","elementId":"username-input","elementTestId":"username-field","elementAttribute":{"placeholder":"Username"}}})
. Type "docs" in the search field, and wait for the page to settle.
+
// (step {"type":{"keys":["docs"],"elementAria":"Search input field","elementClass":["form-control"],"surface":"chrome","timeout":5000,"waitUntil":{"networkIdleTime":100,"domIdleTime":100,"find":{"elementTestId":"result-display","elementText":"Operation successful"}}}})
. Check that the *Submit Order* button is enabled.
+
// (step {"find":{"selector":"button","elementText":"/^Submit Ord/","elementTestId":"checkout-button","elementClass":["btn","/^btn-prim/"],"elementAttribute":{"data-enabled":"true","disabled":false}}})
. Click *Save*.
+
// (step {"click":{"elementText":"Save","elementAttribute":{"aria-label":"Save document button"},"elementClass":"btn-primary","timeout":5000,"surface":"chrome"}})
. Click *Login Submit*.
+
// (step {"click":{"elementTestId":"login-form-submit","elementClass":["btn","btn-large"],"surface":{"browser":"chrome"}}})
. Confirm that the page shows *Operation successful*.
+
// (step {"find":"Operation successful"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Fill in a form by element attributes</title></head>
<body>
<!-- test {"testId":"nav-find-elements","detectSteps":false} -->
<h1>Fill in a form by element attributes</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Submit by ID</strong> button near the top of the page.
    <!-- step {"find":{"elementId":"submit-button","elementText":"Submit by ID","elementAria":"Submit form button","moveTo":true}} --></li>
  <li>Click the username field and type "kittens".
    <!-- step {"find":{"selector":"input","elementTestId":"username-field","click":true,"type":{"keys":["kittens"]},"timeout":10000}} --></li>
  <li>Click the password field and type "hunter2".
    <!-- step {"find":{"elementTestId":"password-field","elementClass":"form-control","click":"left","type":"hunter2","surface":"chrome"}} --></li>
  <li>Click the contact email field and type "you@example.com".
    <!-- step {"find":{"elementId":"contact-email","elementAttribute":{"data-validation":"email-regex-validator"},"click":true,"type":["you@example.com"]}} --></li>
  <li>Type "-cat" at the end of the username.
    <!-- step {"type":{"keys":"-cat","elementId":"username-input","elementTestId":"username-field","elementAttribute":{"placeholder":"Username"}}} --></li>
  <li>Type "docs" in the search field, and wait for the page to settle.
    <!-- step {"type":{"keys":["docs"],"elementAria":"Search input field","elementClass":["form-control"],"surface":"chrome","timeout":5000,"waitUntil":{"networkIdleTime":100,"domIdleTime":100,"find":{"elementTestId":"result-display","elementText":"Operation successful"}}}} --></li>
  <li>Check that the <strong>Submit Order</strong> button is enabled.
    <!-- step {"find":{"selector":"button","elementText":"/^Submit Ord/","elementTestId":"checkout-button","elementClass":["btn","/^btn-prim/"],"elementAttribute":{"data-enabled":"true","disabled":false}}} --></li>
  <li>Click <strong>Save</strong>.
    <!-- step {"click":{"elementText":"Save","elementAttribute":{"aria-label":"Save document button"},"elementClass":"btn-primary","timeout":5000,"surface":"chrome"}} --></li>
  <li>Click <strong>Login Submit</strong>.
    <!-- step {"click":{"elementTestId":"login-form-submit","elementClass":["btn","btn-large"],"surface":{"browser":"chrome"}}} --></li>
  <li>Confirm that the page shows <strong>Operation successful</strong>.
    <!-- step {"find":"Operation successful"} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Fill in a form by element attributes
====================================

.. test {"testId":"nav-find-elements","detectSteps":false}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Submit by ID** button near the top of the page.

   .. step {"find":{"elementId":"submit-button","elementText":"Submit by ID","elementAria":"Submit form button","moveTo":true}}

#. Click the username field and type "kittens".

   .. step {"find":{"selector":"input","elementTestId":"username-field","click":true,"type":{"keys":["kittens"]},"timeout":10000}}

#. Click the password field and type "hunter2".

   .. step {"find":{"elementTestId":"password-field","elementClass":"form-control","click":"left","type":"hunter2","surface":"chrome"}}

#. Click the contact email field and type "you@example.com".

   .. step {"find":{"elementId":"contact-email","elementAttribute":{"data-validation":"email-regex-validator"},"click":true,"type":["you@example.com"]}}

#. Type "-cat" at the end of the username.

   .. step {"type":{"keys":"-cat","elementId":"username-input","elementTestId":"username-field","elementAttribute":{"placeholder":"Username"}}}

#. Type "docs" in the search field, and wait for the page to settle.

   .. step {"type":{"keys":["docs"],"elementAria":"Search input field","elementClass":["form-control"],"surface":"chrome","timeout":5000,"waitUntil":{"networkIdleTime":100,"domIdleTime":100,"find":{"elementTestId":"result-display","elementText":"Operation successful"}}}}

#. Check that the **Submit Order** button is enabled.

   .. step {"find":{"selector":"button","elementText":"/^Submit Ord/","elementTestId":"checkout-button","elementClass":["btn","/^btn-prim/"],"elementAttribute":{"data-enabled":"true","disabled":false}}}

#. Click **Save**.

   .. step {"click":{"elementText":"Save","elementAttribute":{"aria-label":"Save document button"},"elementClass":"btn-primary","timeout":5000,"surface":"chrome"}}

#. Click **Login Submit**.

   .. step {"click":{"elementTestId":"login-form-submit","elementClass":["btn","btn-large"],"surface":{"browser":"chrome"}}}

#. Confirm that the page shows **Operation successful**.

   .. step {"find":"Operation successful"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elements">
  <title>Fill in a form by element attributes</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elements","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Submit by ID</b> button near the top of the page.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementId":"submit-button","elementText":"Submit by ID","elementAria":"Submit form button","moveTo":true}}'/></info></step>
      <step><cmd>Click the username field and type "kittens".</cmd>
        <info><data name="doc-detective" value='step {"find":{"selector":"input","elementTestId":"username-field","click":true,"type":{"keys":["kittens"]},"timeout":10000}}'/></info></step>
      <step><cmd>Click the password field and type "hunter2".</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementTestId":"password-field","elementClass":"form-control","click":"left","type":"hunter2","surface":"chrome"}}'/></info></step>
      <step><cmd>Click the contact email field and type "you@example.com".</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementId":"contact-email","elementAttribute":{"data-validation":"email-regex-validator"},"click":true,"type":["you@example.com"]}}'/></info></step>
      <step><cmd>Type "-cat" at the end of the username.</cmd>
        <info><data name="doc-detective" value='step {"type":{"keys":"-cat","elementId":"username-input","elementTestId":"username-field","elementAttribute":{"placeholder":"Username"}}}'/></info></step>
      <step><cmd>Type "docs" in the search field, and wait for the page to settle.</cmd>
        <info><data name="doc-detective" value='step {"type":{"keys":["docs"],"elementAria":"Search input field","elementClass":["form-control"],"surface":"chrome","timeout":5000,"waitUntil":{"networkIdleTime":100,"domIdleTime":100,"find":{"elementTestId":"result-display","elementText":"Operation successful"}}}}'/></info></step>
      <step><cmd>Check that the <b>Submit Order</b> button is enabled.</cmd>
        <info><data name="doc-detective" value='step {"find":{"selector":"button","elementText":"/^Submit Ord/","elementTestId":"checkout-button","elementClass":["btn","/^btn-prim/"],"elementAttribute":{"data-enabled":"true","disabled":false}}}'/></info></step>
      <step><cmd>Click <b>Save</b>.</cmd>
        <info><data name="doc-detective" value='step {"click":{"elementText":"Save","elementAttribute":{"aria-label":"Save document button"},"elementClass":"btn-primary","timeout":5000,"surface":"chrome"}}'/></info></step>
      <step><cmd>Click <b>Login Submit</b>.</cmd>
        <info><data name="doc-detective" value='step {"click":{"elementTestId":"login-form-submit","elementClass":["btn","btn-large"],"surface":{"browser":"chrome"}}}'/></info></step>
      <step><cmd>Confirm that the page shows <b>Operation successful</b>.</cmd>
        <info><data name="doc-detective" value='step {"find":"Operation successful"}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-find-elements",
      "steps": [
        {
          "goTo": "http://localhost:8092/enhanced-elements.html"
        },
        {
          "find": {
            "elementId": "submit-button",
            "elementText": "Submit by ID",
            "elementAria": "Submit form button",
            "moveTo": true
          }
        },
        {
          "find": {
            "selector": "input",
            "elementTestId": "username-field",
            "click": true,
            "type": {
              "keys": [
                "kittens"
              ]
            },
            "timeout": 10000
          }
        },
        {
          "find": {
            "elementTestId": "password-field",
            "elementClass": "form-control",
            "click": "left",
            "type": "hunter2",
            "surface": "chrome"
          }
        },
        {
          "find": {
            "elementId": "contact-email",
            "elementAttribute": {
              "data-validation": "email-regex-validator"
            },
            "click": true,
            "type": [
              "you@example.com"
            ]
          }
        },
        {
          "type": {
            "keys": "-cat",
            "elementId": "username-input",
            "elementTestId": "username-field",
            "elementAttribute": {
              "placeholder": "Username"
            }
          }
        },
        {
          "type": {
            "keys": [
              "docs"
            ],
            "elementAria": "Search input field",
            "elementClass": [
              "form-control"
            ],
            "surface": "chrome",
            "timeout": 5000,
            "waitUntil": {
              "networkIdleTime": 100,
              "domIdleTime": 100,
              "find": {
                "elementTestId": "result-display",
                "elementText": "Operation successful"
              }
            }
          }
        },
        {
          "find": {
            "selector": "button",
            "elementText": "/^Submit Ord/",
            "elementTestId": "checkout-button",
            "elementClass": [
              "btn",
              "/^btn-prim/"
            ],
            "elementAttribute": {
              "data-enabled": "true",
              "disabled": false
            }
          }
        },
        {
          "click": {
            "elementText": "Save",
            "elementAttribute": {
              "aria-label": "Save document button"
            },
            "elementClass": "btn-primary",
            "timeout": 5000,
            "surface": "chrome"
          }
        },
        {
          "click": {
            "elementTestId": "login-form-submit",
            "elementClass": [
              "btn",
              "btn-large"
            ],
            "surface": {
              "browser": "chrome"
            }
          }
        },
        {
          "find": "Operation successful"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-find-elements
    steps:
      - goTo: http://localhost:8092/enhanced-elements.html
      - find:
          elementId: submit-button
          elementText: Submit by ID
          elementAria: Submit form button
          moveTo: true
      - find:
          selector: input
          elementTestId: username-field
          click: true
          type:
            keys:
              - kittens
          timeout: 10000
      - find:
          elementTestId: password-field
          elementClass: form-control
          click: left
          type: hunter2
          surface: chrome
      - find:
          elementId: contact-email
          elementAttribute:
            data-validation: email-regex-validator
          click: true
          type:
            - you@example.com
      - type:
          keys: -cat
          elementId: username-input
          elementTestId: username-field
          elementAttribute:
            placeholder: Username
      - type:
          keys:
            - docs
          elementAria: Search input field
          elementClass:
            - form-control
          surface: chrome
          timeout: 5000
          waitUntil:
            networkIdleTime: 100
            domIdleTime: 100
            find:
              elementTestId: result-display
              elementText: Operation successful
      - find:
          selector: button
          elementText: /^Submit Ord/
          elementTestId: checkout-button
          elementClass:
            - btn
            - /^btn-prim/
          elementAttribute:
            data-enabled: "true"
            disabled: false
      - click:
          elementText: Save
          elementAttribute:
            aria-label: Save document button
          elementClass: btn-primary
          timeout: 5000
          surface: chrome
      - click:
          elementTestId: login-form-submit
          elementClass:
            - btn
            - btn-large
          surface:
            browser: chrome
      - find: Operation successful
```

### What detection finds

Detection matches a bold phrase by its visible text, so it finds **Submit by ID** and **Submit Order**. It can't check an ID, a test ID, a class, or an attribute. Each `Type "…"` becomes a `type` step with no target, because the fields have no visible label to bold. The inline variants find each field by its attributes and type into it.

## Search with toolbar icons

This procedure finds icons by a picture of them, with `elementImage` on the `waitUntil.find` of [`goTo`](/docs/actions/goto), on [`click`](/docs/actions/click), and on [`find`](/docs/actions/find). The picture comes as `base64` with a `threshold`, as a `path` with a `color`, and as a path string. The `find` step sets `click` to an object with `button` and `duration`. It also uses [`type`](/docs/actions/type) with an array that ends in the `$ENTER$` key, and with an object that sets `keys`, `selector`, and `inputDelay`.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Search from the toolbar

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
2. Click the magnifying-glass icon next to the search box.
3. Type "doc detective" and press Enter.
4. Check that the status bar shows **doc detective**.
5. Type "-docs" at the end of the search box.
6. Check that the status bar shows **doc detective-docs**.
7. Right-click the save icon and hold the button for half a second.
8. Check that the status bar records the right-click.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Search from the toolbar

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
2. Click the magnifying-glass icon next to the search box.
3. Type "doc detective" and press Enter.
4. Check that the status bar shows **doc detective**.
5. Type "-docs" at the end of the search box.
6. Check that the status bar shows **doc detective-docs**.
7. Right-click the save icon and hold the button for half a second.
8. Check that the status bar records the right-click.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Search from the toolbar

. Go to http://localhost:8092/find-image.html[the toolbar page].
. Click the magnifying-glass icon next to the search box.
. Type "doc detective" and press Enter.
. Check that the status bar shows *doc detective*.
. Type "-docs" at the end of the search box.
. Check that the status bar shows *doc detective-docs*.
. Right-click the save icon and hold the button for half a second.
. Check that the status bar records the right-click.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Search from the toolbar</title></head>
<body>
<h1>Search from the toolbar</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/find-image.html">the toolbar page</a>.</li>
  <li>Click the magnifying-glass icon next to the search box.</li>
  <li>Type "doc detective" and press Enter.</li>
  <li>Check that the status bar shows <strong>doc detective</strong>.</li>
  <li>Type "-docs" at the end of the search box.</li>
  <li>Check that the status bar shows <strong>doc detective-docs</strong>.</li>
  <li>Right-click the save icon and hold the button for half a second.</li>
  <li>Check that the status bar records the right-click.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Search from the toolbar
=======================

#. Go to `the toolbar page <http://localhost:8092/find-image.html>`_.
#. Click the magnifying-glass icon next to the search box.
#. Type "doc detective" and press Enter.
#. Check that the status bar shows **doc detective**.
#. Type "-docs" at the end of the search box.
#. Check that the status bar shows **doc detective-docs**.
#. Right-click the save icon and hold the button for half a second.
#. Check that the status bar records the right-click.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-search-icons">
  <title>Search from the toolbar</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/find-image.html" scope="external" format="html">the toolbar page</xref>.</cmd></step>
      <step><cmd>Click the magnifying-glass icon next to the search box.</cmd></step>
      <step><cmd>Type "doc detective" and press Enter.</cmd></step>
      <step><cmd>Check that the status bar shows <b>doc detective</b>.</cmd></step>
      <step><cmd>Type "-docs" at the end of the search box.</cmd></step>
      <step><cmd>Check that the status bar shows <b>doc detective-docs</b>.</cmd></step>
      <step><cmd>Right-click the save icon and hold the button for half a second.</cmd></step>
      <step><cmd>Check that the status bar records the right-click.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-search-icons","detectSteps":true} -->

# Search from the toolbar

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   <!-- step {"goTo":{"url":"http://localhost:8092/find-image.html","waitUntil":{"find":{"elementImage":{"base64":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMxYTVmYjQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNNSAzaDExbDUgNXYxMWEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMSAyLTJ6Ii8+PHBhdGggZD0iTTE3IDIxdi04SDd2OCIvPjxwYXRoIGQ9Ik03IDN2NWg4Ii8+PC9zdmc+Cg==","threshold":0.9}}}}} -->
2. Click the magnifying-glass icon next to the search box.
   <!-- step {"click":{"elementImage":{"path":"search.svg","color":"#444444"},"elementId":"search-icon"}} -->
3. Type "doc detective" and press Enter.
4. Check that the status bar shows **doc detective**.
5. Type "-docs" at the end of the search box.
6. Check that the status bar shows **doc detective-docs**.
7. Right-click the save icon and hold the button for half a second.
   <!-- step {"find":{"elementImage":"save.svg","click":{"button":"right","duration":500}}} -->
8. Check that the status bar records the right-click.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-search-icons","detectSteps":true} */}

# Search from the toolbar

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   {/* step {"goTo":{"url":"http://localhost:8092/find-image.html","waitUntil":{"find":{"elementImage":{"base64":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMxYTVmYjQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNNSAzaDExbDUgNXYxMWEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMSAyLTJ6Ii8+PHBhdGggZD0iTTE3IDIxdi04SDd2OCIvPjxwYXRoIGQ9Ik03IDN2NWg4Ii8+PC9zdmc+Cg==","threshold":0.9}}}}} */}
2. Click the magnifying-glass icon next to the search box.
   {/* step {"click":{"elementImage":{"path":"search.svg","color":"#444444"},"elementId":"search-icon"}} */}
3. Type "doc detective" and press Enter.
4. Check that the status bar shows **doc detective**.
5. Type "-docs" at the end of the search box.
6. Check that the status bar shows **doc detective-docs**.
7. Right-click the save icon and hold the button for half a second.
   {/* step {"find":{"elementImage":"save.svg","click":{"button":"right","duration":500}}} */}
8. Check that the status bar records the right-click.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Search from the toolbar

// (test {"testId":"nav-search-icons","detectSteps":true})

. Go to http://localhost:8092/find-image.html[the toolbar page].
+
// (step {"goTo":{"url":"http://localhost:8092/find-image.html","waitUntil":{"find":{"elementImage":{"base64":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMxYTVmYjQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNNSAzaDExbDUgNXYxMWEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMSAyLTJ6Ii8+PHBhdGggZD0iTTE3IDIxdi04SDd2OCIvPjxwYXRoIGQ9Ik03IDN2NWg4Ii8+PC9zdmc+Cg==","threshold":0.9}}}}})
. Click the magnifying-glass icon next to the search box.
+
// (step {"click":{"elementImage":{"path":"search.svg","color":"#444444"},"elementId":"search-icon"}})
. Type "doc detective" and press Enter.
. Check that the status bar shows *doc detective*.
. Type "-docs" at the end of the search box.
. Check that the status bar shows *doc detective-docs*.
. Right-click the save icon and hold the button for half a second.
+
// (step {"find":{"elementImage":"save.svg","click":{"button":"right","duration":500}}})
. Check that the status bar records the right-click.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Search from the toolbar</title></head>
<body>
<!-- test {"testId":"nav-search-icons","detectSteps":true} -->
<h1>Search from the toolbar</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/find-image.html">the toolbar page</a>.
    <!-- step {"goTo":{"url":"http://localhost:8092/find-image.html","waitUntil":{"find":{"elementImage":{"base64":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMxYTVmYjQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNNSAzaDExbDUgNXYxMWEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMSAyLTJ6Ii8+PHBhdGggZD0iTTE3IDIxdi04SDd2OCIvPjxwYXRoIGQ9Ik03IDN2NWg4Ii8+PC9zdmc+Cg==","threshold":0.9}}}}} --></li>
  <li>Click the magnifying-glass icon next to the search box.
    <!-- step {"click":{"elementImage":{"path":"search.svg","color":"#444444"},"elementId":"search-icon"}} --></li>
  <li>Type "doc detective" and press Enter.</li>
  <li>Check that the status bar shows <strong>doc detective</strong>.</li>
  <li>Type "-docs" at the end of the search box.</li>
  <li>Check that the status bar shows <strong>doc detective-docs</strong>.</li>
  <li>Right-click the save icon and hold the button for half a second.
    <!-- step {"find":{"elementImage":"save.svg","click":{"button":"right","duration":500}}} --></li>
  <li>Check that the status bar records the right-click.</li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Search from the toolbar
=======================

.. test {"testId":"nav-search-icons","detectSteps":true}

#. Go to `the toolbar page <http://localhost:8092/find-image.html>`_.

   .. step {"goTo":{"url":"http://localhost:8092/find-image.html","waitUntil":{"find":{"elementImage":{"base64":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMxYTVmYjQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNNSAzaDExbDUgNXYxMWEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMSAyLTJ6Ii8+PHBhdGggZD0iTTE3IDIxdi04SDd2OCIvPjxwYXRoIGQ9Ik03IDN2NWg4Ii8+PC9zdmc+Cg==","threshold":0.9}}}}}

#. Click the magnifying-glass icon next to the search box.

   .. step {"click":{"elementImage":{"path":"search.svg","color":"#444444"},"elementId":"search-icon"}}

#. Type "doc detective" and press Enter.
#. Check that the status bar shows **doc detective**.
#. Type "-docs" at the end of the search box.
#. Check that the status bar shows **doc detective-docs**.
#. Right-click the save icon and hold the button for half a second.

   .. step {"find":{"elementImage":"save.svg","click":{"button":"right","duration":500}}}

#. Check that the status bar records the right-click.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-search-icons">
  <title>Search from the toolbar</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-search-icons","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/find-image.html" scope="external" format="html">the toolbar page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/find-image.html","waitUntil":{"find":{"elementImage":{"base64":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMxYTVmYjQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNNSAzaDExbDUgNXYxMWEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMSAyLTJ6Ii8+PHBhdGggZD0iTTE3IDIxdi04SDd2OCIvPjxwYXRoIGQ9Ik03IDN2NWg4Ii8+PC9zdmc+Cg==","threshold":0.9}}}}}'/></info></step>
      <step><cmd>Click the magnifying-glass icon next to the search box.</cmd>
        <info><data name="doc-detective" value='step {"click":{"elementImage":{"path":"search.svg","color":"#444444"},"elementId":"search-icon"}}'/></info></step>
      <step><cmd>Type "doc detective" and press Enter.</cmd></step>
      <step><cmd>Check that the status bar shows <b>doc detective</b>.</cmd></step>
      <step><cmd>Type "-docs" at the end of the search box.</cmd></step>
      <step><cmd>Check that the status bar shows <b>doc detective-docs</b>.</cmd></step>
      <step><cmd>Right-click the save icon and hold the button for half a second.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementImage":"save.svg","click":{"button":"right","duration":500}}}'/></info></step>
      <step><cmd>Check that the status bar records the right-click.</cmd></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-search-icons","detectSteps":false} -->

# Search from the toolbar

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   <!-- step {"goTo":{"url":"http://localhost:8092/find-image.html","waitUntil":{"find":{"elementImage":{"base64":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMxYTVmYjQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNNSAzaDExbDUgNXYxMWEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMSAyLTJ6Ii8+PHBhdGggZD0iTTE3IDIxdi04SDd2OCIvPjxwYXRoIGQ9Ik03IDN2NWg4Ii8+PC9zdmc+Cg==","threshold":0.9}}}}} -->
2. Click the magnifying-glass icon next to the search box.
   <!-- step {"click":{"elementImage":{"path":"search.svg","color":"#444444"},"elementId":"search-icon"}} -->
3. Type "doc detective" and press Enter.
   <!-- step {"type":["doc detective","$ENTER$"]} -->
4. Check that the status bar shows **doc detective**.
   <!-- step {"find":{"selector":"#echo","elementText":"doc detective"}} -->
5. Type "-docs" at the end of the search box.
   <!-- step {"type":{"keys":"-docs","selector":"#query","inputDelay":100}} -->
6. Check that the status bar shows **doc detective-docs**.
   <!-- step {"find":{"selector":"#echo","elementText":"doc detective-docs"}} -->
7. Right-click the save icon and hold the button for half a second.
   <!-- step {"find":{"elementImage":"save.svg","click":{"button":"right","duration":500}}} -->
8. Check that the status bar records the right-click.
   <!-- step {"find":{"selector":"#log","elementText":"/^click button=2/"}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-search-icons","detectSteps":false} */}

# Search from the toolbar

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   {/* step {"goTo":{"url":"http://localhost:8092/find-image.html","waitUntil":{"find":{"elementImage":{"base64":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMxYTVmYjQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNNSAzaDExbDUgNXYxMWEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMSAyLTJ6Ii8+PHBhdGggZD0iTTE3IDIxdi04SDd2OCIvPjxwYXRoIGQ9Ik03IDN2NWg4Ii8+PC9zdmc+Cg==","threshold":0.9}}}}} */}
2. Click the magnifying-glass icon next to the search box.
   {/* step {"click":{"elementImage":{"path":"search.svg","color":"#444444"},"elementId":"search-icon"}} */}
3. Type "doc detective" and press Enter.
   {/* step {"type":["doc detective","$ENTER$"]} */}
4. Check that the status bar shows **doc detective**.
   {/* step {"find":{"selector":"#echo","elementText":"doc detective"}} */}
5. Type "-docs" at the end of the search box.
   {/* step {"type":{"keys":"-docs","selector":"#query","inputDelay":100}} */}
6. Check that the status bar shows **doc detective-docs**.
   {/* step {"find":{"selector":"#echo","elementText":"doc detective-docs"}} */}
7. Right-click the save icon and hold the button for half a second.
   {/* step {"find":{"elementImage":"save.svg","click":{"button":"right","duration":500}}} */}
8. Check that the status bar records the right-click.
   {/* step {"find":{"selector":"#log","elementText":"/^click button=2/"}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Search from the toolbar

// (test {"testId":"nav-search-icons","detectSteps":false})

. Go to http://localhost:8092/find-image.html[the toolbar page].
+
// (step {"goTo":{"url":"http://localhost:8092/find-image.html","waitUntil":{"find":{"elementImage":{"base64":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMxYTVmYjQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNNSAzaDExbDUgNXYxMWEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMSAyLTJ6Ii8+PHBhdGggZD0iTTE3IDIxdi04SDd2OCIvPjxwYXRoIGQ9Ik03IDN2NWg4Ii8+PC9zdmc+Cg==","threshold":0.9}}}}})
. Click the magnifying-glass icon next to the search box.
+
// (step {"click":{"elementImage":{"path":"search.svg","color":"#444444"},"elementId":"search-icon"}})
. Type "doc detective" and press Enter.
+
// (step {"type":["doc detective","$ENTER$"]})
. Check that the status bar shows *doc detective*.
+
// (step {"find":{"selector":"#echo","elementText":"doc detective"}})
. Type "-docs" at the end of the search box.
+
// (step {"type":{"keys":"-docs","selector":"#query","inputDelay":100}})
. Check that the status bar shows *doc detective-docs*.
+
// (step {"find":{"selector":"#echo","elementText":"doc detective-docs"}})
. Right-click the save icon and hold the button for half a second.
+
// (step {"find":{"elementImage":"save.svg","click":{"button":"right","duration":500}}})
. Check that the status bar records the right-click.
+
// (step {"find":{"selector":"#log","elementText":"/^click button=2/"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Search from the toolbar</title></head>
<body>
<!-- test {"testId":"nav-search-icons","detectSteps":false} -->
<h1>Search from the toolbar</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/find-image.html">the toolbar page</a>.
    <!-- step {"goTo":{"url":"http://localhost:8092/find-image.html","waitUntil":{"find":{"elementImage":{"base64":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMxYTVmYjQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNNSAzaDExbDUgNXYxMWEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMSAyLTJ6Ii8+PHBhdGggZD0iTTE3IDIxdi04SDd2OCIvPjxwYXRoIGQ9Ik03IDN2NWg4Ii8+PC9zdmc+Cg==","threshold":0.9}}}}} --></li>
  <li>Click the magnifying-glass icon next to the search box.
    <!-- step {"click":{"elementImage":{"path":"search.svg","color":"#444444"},"elementId":"search-icon"}} --></li>
  <li>Type "doc detective" and press Enter.
    <!-- step {"type":["doc detective","$ENTER$"]} --></li>
  <li>Check that the status bar shows <strong>doc detective</strong>.
    <!-- step {"find":{"selector":"#echo","elementText":"doc detective"}} --></li>
  <li>Type "-docs" at the end of the search box.
    <!-- step {"type":{"keys":"-docs","selector":"#query","inputDelay":100}} --></li>
  <li>Check that the status bar shows <strong>doc detective-docs</strong>.
    <!-- step {"find":{"selector":"#echo","elementText":"doc detective-docs"}} --></li>
  <li>Right-click the save icon and hold the button for half a second.
    <!-- step {"find":{"elementImage":"save.svg","click":{"button":"right","duration":500}}} --></li>
  <li>Check that the status bar records the right-click.
    <!-- step {"find":{"selector":"#log","elementText":"/^click button=2/"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Search from the toolbar
=======================

.. test {"testId":"nav-search-icons","detectSteps":false}

#. Go to `the toolbar page <http://localhost:8092/find-image.html>`_.

   .. step {"goTo":{"url":"http://localhost:8092/find-image.html","waitUntil":{"find":{"elementImage":{"base64":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMxYTVmYjQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNNSAzaDExbDUgNXYxMWEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMSAyLTJ6Ii8+PHBhdGggZD0iTTE3IDIxdi04SDd2OCIvPjxwYXRoIGQ9Ik03IDN2NWg4Ii8+PC9zdmc+Cg==","threshold":0.9}}}}}

#. Click the magnifying-glass icon next to the search box.

   .. step {"click":{"elementImage":{"path":"search.svg","color":"#444444"},"elementId":"search-icon"}}

#. Type "doc detective" and press Enter.

   .. step {"type":["doc detective","$ENTER$"]}

#. Check that the status bar shows **doc detective**.

   .. step {"find":{"selector":"#echo","elementText":"doc detective"}}

#. Type "-docs" at the end of the search box.

   .. step {"type":{"keys":"-docs","selector":"#query","inputDelay":100}}

#. Check that the status bar shows **doc detective-docs**.

   .. step {"find":{"selector":"#echo","elementText":"doc detective-docs"}}

#. Right-click the save icon and hold the button for half a second.

   .. step {"find":{"elementImage":"save.svg","click":{"button":"right","duration":500}}}

#. Check that the status bar records the right-click.

   .. step {"find":{"selector":"#log","elementText":"/^click button=2/"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-search-icons">
  <title>Search from the toolbar</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-search-icons","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/find-image.html" scope="external" format="html">the toolbar page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/find-image.html","waitUntil":{"find":{"elementImage":{"base64":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMxYTVmYjQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNNSAzaDExbDUgNXYxMWEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMSAyLTJ6Ii8+PHBhdGggZD0iTTE3IDIxdi04SDd2OCIvPjxwYXRoIGQ9Ik03IDN2NWg4Ii8+PC9zdmc+Cg==","threshold":0.9}}}}}'/></info></step>
      <step><cmd>Click the magnifying-glass icon next to the search box.</cmd>
        <info><data name="doc-detective" value='step {"click":{"elementImage":{"path":"search.svg","color":"#444444"},"elementId":"search-icon"}}'/></info></step>
      <step><cmd>Type "doc detective" and press Enter.</cmd>
        <info><data name="doc-detective" value='step {"type":["doc detective","$ENTER$"]}'/></info></step>
      <step><cmd>Check that the status bar shows <b>doc detective</b>.</cmd>
        <info><data name="doc-detective" value='step {"find":{"selector":"#echo","elementText":"doc detective"}}'/></info></step>
      <step><cmd>Type "-docs" at the end of the search box.</cmd>
        <info><data name="doc-detective" value='step {"type":{"keys":"-docs","selector":"#query","inputDelay":100}}'/></info></step>
      <step><cmd>Check that the status bar shows <b>doc detective-docs</b>.</cmd>
        <info><data name="doc-detective" value='step {"find":{"selector":"#echo","elementText":"doc detective-docs"}}'/></info></step>
      <step><cmd>Right-click the save icon and hold the button for half a second.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementImage":"save.svg","click":{"button":"right","duration":500}}}'/></info></step>
      <step><cmd>Check that the status bar records the right-click.</cmd>
        <info><data name="doc-detective" value='step {"find":{"selector":"#log","elementText":"/^click button=2/"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-search-icons",
      "steps": [
        {
          "goTo": {
            "url": "http://localhost:8092/find-image.html",
            "waitUntil": {
              "find": {
                "elementImage": {
                  "base64": "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMxYTVmYjQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNNSAzaDExbDUgNXYxMWEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMSAyLTJ6Ii8+PHBhdGggZD0iTTE3IDIxdi04SDd2OCIvPjxwYXRoIGQ9Ik03IDN2NWg4Ii8+PC9zdmc+Cg==",
                  "threshold": 0.9
                }
              }
            }
          }
        },
        {
          "click": {
            "elementImage": {
              "path": "search.svg",
              "color": "#444444"
            },
            "elementId": "search-icon"
          }
        },
        {
          "type": [
            "doc detective",
            "$ENTER$"
          ]
        },
        {
          "find": {
            "selector": "#echo",
            "elementText": "doc detective"
          }
        },
        {
          "type": {
            "keys": "-docs",
            "selector": "#query",
            "inputDelay": 100
          }
        },
        {
          "find": {
            "selector": "#echo",
            "elementText": "doc detective-docs"
          }
        },
        {
          "find": {
            "elementImage": "save.svg",
            "click": {
              "button": "right",
              "duration": 500
            }
          }
        },
        {
          "find": {
            "selector": "#log",
            "elementText": "/^click button=2/"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-search-icons
    steps:
      - goTo:
          url: http://localhost:8092/find-image.html
          waitUntil:
            find:
              elementImage:
                base64: PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMxYTVmYjQiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cGF0aCBkPSJNNSAzaDExbDUgNXYxMWEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMlY1YTIgMiAwIDAgMSAyLTJ6Ii8+PHBhdGggZD0iTTE3IDIxdi04SDd2OCIvPjxwYXRoIGQ9Ik03IDN2NWg4Ii8+PC9zdmc+Cg==
                threshold: 0.9
      - click:
          elementImage:
            path: search.svg
            color: "#444444"
          elementId: search-icon
      - type:
          - doc detective
          - $ENTER$
      - find:
          selector: "#echo"
          elementText: doc detective
      - type:
          keys: -docs
          selector: "#query"
          inputDelay: 100
      - find:
          selector: "#echo"
          elementText: doc detective-docs
      - find:
          elementImage: save.svg
          click:
            button: right
            duration: 500
      - find:
          selector: "#log"
          elementText: /^click button=2/
```

The icon pictures, `search.svg` and `save.svg`, sit in the example's folder, and the `base64` value is `save.svg` encoded. A relative `elementImage` path resolves against the file that holds the step. See [Find elements by image](/docs/test-docs/find-elements-by-image).

### What detection finds

No default rule matches an icon by its picture, so every detected variant carries `step` statements for the two icon steps. It also carries a `goTo` statement, so those steps open the page even when detection is off. Detection turns each `Type "…"` into a `type` step and each bold phrase into a `find` step. The detected `type` steps send the quoted text only, without the `$ENTER$` key or the input delay.

## Drag widgets and scroll the page

This procedure uses [`dragAndDrop`](/docs/actions/draganddrop) twice. The first drag sets a text `source`, an object `target` with a `timeout`, and a `duration`. The second sets an object `source` located by text, class, and attributes, a selector string `target`, and a `surface`. It also uses [`click`](/docs/actions/click) with `selector`, `button`, and a `duration` that holds the press. [`swipe`](/docs/actions/swipe) appears in all three forms: a direction, an object with `direction`, `distance`, and `duration`, and a point-to-point object with `from` and `to`. The two object forms also name the `surface` to swipe.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Drag widgets and scroll the page

1. Go to [the drag and drop page](http://localhost:8092/drag-drop-test.html).
2. Drag **Table** onto **Drop Zone 1**.
3. Check that **Table (dropped)** appears in the drop zone.
4. Press and hold **Chart** for one second.
5. Drag **Chart** onto **Drop Zone 2**.
6. Check that **Chart (dropped)** appears in the second drop zone.
7. Swipe up to scroll toward the bottom of the page.
8. Swipe down a third of the screen to scroll back.
9. Swipe from the middle of the page toward the top.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Drag widgets and scroll the page

1. Go to [the drag and drop page](http://localhost:8092/drag-drop-test.html).
2. Drag **Table** onto **Drop Zone 1**.
3. Check that **Table (dropped)** appears in the drop zone.
4. Press and hold **Chart** for one second.
5. Drag **Chart** onto **Drop Zone 2**.
6. Check that **Chart (dropped)** appears in the second drop zone.
7. Swipe up to scroll toward the bottom of the page.
8. Swipe down a third of the screen to scroll back.
9. Swipe from the middle of the page toward the top.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Drag widgets and scroll the page

. Go to http://localhost:8092/drag-drop-test.html[the drag and drop page].
. Drag *Table* onto *Drop Zone 1*.
. Check that *Table (dropped)* appears in the drop zone.
. Press and hold *Chart* for one second.
. Drag *Chart* onto *Drop Zone 2*.
. Check that *Chart (dropped)* appears in the second drop zone.
. Swipe up to scroll toward the bottom of the page.
. Swipe down a third of the screen to scroll back.
. Swipe from the middle of the page toward the top.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Drag widgets and scroll the page</title></head>
<body>
<h1>Drag widgets and scroll the page</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/drag-drop-test.html">the drag and drop page</a>.</li>
  <li>Drag <strong>Table</strong> onto <strong>Drop Zone 1</strong>.</li>
  <li>Check that <strong>Table (dropped)</strong> appears in the drop zone.</li>
  <li>Press and hold <strong>Chart</strong> for one second.</li>
  <li>Drag <strong>Chart</strong> onto <strong>Drop Zone 2</strong>.</li>
  <li>Check that <strong>Chart (dropped)</strong> appears in the second drop zone.</li>
  <li>Swipe up to scroll toward the bottom of the page.</li>
  <li>Swipe down a third of the screen to scroll back.</li>
  <li>Swipe from the middle of the page toward the top.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Drag widgets and scroll the page
================================

#. Go to `the drag and drop page <http://localhost:8092/drag-drop-test.html>`_.
#. Drag **Table** onto **Drop Zone 1**.
#. Check that **Table (dropped)** appears in the drop zone.
#. Press and hold **Chart** for one second.
#. Drag **Chart** onto **Drop Zone 2**.
#. Check that **Chart (dropped)** appears in the second drop zone.
#. Swipe up to scroll toward the bottom of the page.
#. Swipe down a third of the screen to scroll back.
#. Swipe from the middle of the page toward the top.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-drag-swipe">
  <title>Drag widgets and scroll the page</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/drag-drop-test.html" scope="external" format="html">the drag and drop page</xref>.</cmd></step>
      <step><cmd>Drag <b>Table</b> onto <b>Drop Zone 1</b>.</cmd></step>
      <step><cmd>Check that <b>Table (dropped)</b> appears in the drop zone.</cmd></step>
      <step><cmd>Press and hold <b>Chart</b> for one second.</cmd></step>
      <step><cmd>Drag <b>Chart</b> onto <b>Drop Zone 2</b>.</cmd></step>
      <step><cmd>Check that <b>Chart (dropped)</b> appears in the second drop zone.</cmd></step>
      <step><cmd>Swipe up to scroll toward the bottom of the page.</cmd></step>
      <step><cmd>Swipe down a third of the screen to scroll back.</cmd></step>
      <step><cmd>Swipe from the middle of the page toward the top.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-drag-swipe","detectSteps":true} -->

# Drag widgets and scroll the page

1. Go to [the drag and drop page](http://localhost:8092/drag-drop-test.html).
   <!-- step {"goTo":"http://localhost:8092/drag-drop-test.html"} -->
2. Drag **Table** onto **Drop Zone 1**.
   <!-- step {"dragAndDrop":{"source":"Table","target":{"selector":".drop-zone","elementText":"Drop Zone 1","timeout":5000},"duration":500}} -->
3. Check that **Table (dropped)** appears in the drop zone.
4. Press and hold **Chart** for one second.
   <!-- step {"click":{"selector":".draggable[data-widget=\"chart\"]","button":"left","duration":1000}} -->
5. Drag **Chart** onto **Drop Zone 2**.
   <!-- step {"dragAndDrop":{"source":{"elementText":"Chart","elementClass":"draggable","elementAttribute":{"data-widget":"chart","draggable":"true"},"timeout":5000},"target":".drop-zone[data-drop=\"zone2\"]","surface":"chrome"}} -->
6. Check that **Chart (dropped)** appears in the second drop zone.
7. Swipe up to scroll toward the bottom of the page.
   <!-- step {"swipe":"up"} -->
8. Swipe down a third of the screen to scroll back.
   <!-- step {"swipe":{"direction":"down","distance":0.3,"duration":300,"surface":"chrome"}} -->
9. Swipe from the middle of the page toward the top.
   <!-- step {"swipe":{"from":{"x":400,"y":400},"to":{"x":400,"y":250},"duration":300,"surface":{"browser":"chrome"}}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-drag-swipe","detectSteps":true} */}

# Drag widgets and scroll the page

1. Go to [the drag and drop page](http://localhost:8092/drag-drop-test.html).
   {/* step {"goTo":"http://localhost:8092/drag-drop-test.html"} */}
2. Drag **Table** onto **Drop Zone 1**.
   {/* step {"dragAndDrop":{"source":"Table","target":{"selector":".drop-zone","elementText":"Drop Zone 1","timeout":5000},"duration":500}} */}
3. Check that **Table (dropped)** appears in the drop zone.
4. Press and hold **Chart** for one second.
   {/* step {"click":{"selector":".draggable[data-widget=\"chart\"]","button":"left","duration":1000}} */}
5. Drag **Chart** onto **Drop Zone 2**.
   {/* step {"dragAndDrop":{"source":{"elementText":"Chart","elementClass":"draggable","elementAttribute":{"data-widget":"chart","draggable":"true"},"timeout":5000},"target":".drop-zone[data-drop=\"zone2\"]","surface":"chrome"}} */}
6. Check that **Chart (dropped)** appears in the second drop zone.
7. Swipe up to scroll toward the bottom of the page.
   {/* step {"swipe":"up"} */}
8. Swipe down a third of the screen to scroll back.
   {/* step {"swipe":{"direction":"down","distance":0.3,"duration":300,"surface":"chrome"}} */}
9. Swipe from the middle of the page toward the top.
   {/* step {"swipe":{"from":{"x":400,"y":400},"to":{"x":400,"y":250},"duration":300,"surface":{"browser":"chrome"}}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Drag widgets and scroll the page

// (test {"testId":"nav-drag-swipe","detectSteps":true})

. Go to http://localhost:8092/drag-drop-test.html[the drag and drop page].
+
// (step {"goTo":"http://localhost:8092/drag-drop-test.html"})
. Drag *Table* onto *Drop Zone 1*.
+
// (step {"dragAndDrop":{"source":"Table","target":{"selector":".drop-zone","elementText":"Drop Zone 1","timeout":5000},"duration":500}})
. Check that *Table (dropped)* appears in the drop zone.
. Press and hold *Chart* for one second.
+
// (step {"click":{"selector":".draggable[data-widget=\"chart\"]","button":"left","duration":1000}})
. Drag *Chart* onto *Drop Zone 2*.
+
// (step {"dragAndDrop":{"source":{"elementText":"Chart","elementClass":"draggable","elementAttribute":{"data-widget":"chart","draggable":"true"},"timeout":5000},"target":".drop-zone[data-drop=\"zone2\"]","surface":"chrome"}})
. Check that *Chart (dropped)* appears in the second drop zone.
. Swipe up to scroll toward the bottom of the page.
+
// (step {"swipe":"up"})
. Swipe down a third of the screen to scroll back.
+
// (step {"swipe":{"direction":"down","distance":0.3,"duration":300,"surface":"chrome"}})
. Swipe from the middle of the page toward the top.
+
// (step {"swipe":{"from":{"x":400,"y":400},"to":{"x":400,"y":250},"duration":300,"surface":{"browser":"chrome"}}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Drag widgets and scroll the page</title></head>
<body>
<!-- test {"testId":"nav-drag-swipe","detectSteps":true} -->
<h1>Drag widgets and scroll the page</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/drag-drop-test.html">the drag and drop page</a>.
    <!-- step {"goTo":"http://localhost:8092/drag-drop-test.html"} --></li>
  <li>Drag <strong>Table</strong> onto <strong>Drop Zone 1</strong>.
    <!-- step {"dragAndDrop":{"source":"Table","target":{"selector":".drop-zone","elementText":"Drop Zone 1","timeout":5000},"duration":500}} --></li>
  <li>Check that <strong>Table (dropped)</strong> appears in the drop zone.</li>
  <li>Press and hold <strong>Chart</strong> for one second.
    <!-- step {"click":{"selector":".draggable[data-widget=\"chart\"]","button":"left","duration":1000}} --></li>
  <li>Drag <strong>Chart</strong> onto <strong>Drop Zone 2</strong>.
    <!-- step {"dragAndDrop":{"source":{"elementText":"Chart","elementClass":"draggable","elementAttribute":{"data-widget":"chart","draggable":"true"},"timeout":5000},"target":".drop-zone[data-drop=\"zone2\"]","surface":"chrome"}} --></li>
  <li>Check that <strong>Chart (dropped)</strong> appears in the second drop zone.</li>
  <li>Swipe up to scroll toward the bottom of the page.
    <!-- step {"swipe":"up"} --></li>
  <li>Swipe down a third of the screen to scroll back.
    <!-- step {"swipe":{"direction":"down","distance":0.3,"duration":300,"surface":"chrome"}} --></li>
  <li>Swipe from the middle of the page toward the top.
    <!-- step {"swipe":{"from":{"x":400,"y":400},"to":{"x":400,"y":250},"duration":300,"surface":{"browser":"chrome"}}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Drag widgets and scroll the page
================================

.. test {"testId":"nav-drag-swipe","detectSteps":true}

#. Go to `the drag and drop page <http://localhost:8092/drag-drop-test.html>`_.

   .. step {"goTo":"http://localhost:8092/drag-drop-test.html"}

#. Drag **Table** onto **Drop Zone 1**.

   .. step {"dragAndDrop":{"source":"Table","target":{"selector":".drop-zone","elementText":"Drop Zone 1","timeout":5000},"duration":500}}

#. Check that **Table (dropped)** appears in the drop zone.
#. Press and hold **Chart** for one second.

   .. step {"click":{"selector":".draggable[data-widget=\"chart\"]","button":"left","duration":1000}}

#. Drag **Chart** onto **Drop Zone 2**.

   .. step {"dragAndDrop":{"source":{"elementText":"Chart","elementClass":"draggable","elementAttribute":{"data-widget":"chart","draggable":"true"},"timeout":5000},"target":".drop-zone[data-drop=\"zone2\"]","surface":"chrome"}}

#. Check that **Chart (dropped)** appears in the second drop zone.
#. Swipe up to scroll toward the bottom of the page.

   .. step {"swipe":"up"}

#. Swipe down a third of the screen to scroll back.

   .. step {"swipe":{"direction":"down","distance":0.3,"duration":300,"surface":"chrome"}}

#. Swipe from the middle of the page toward the top.

   .. step {"swipe":{"from":{"x":400,"y":400},"to":{"x":400,"y":250},"duration":300,"surface":{"browser":"chrome"}}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-drag-swipe">
  <title>Drag widgets and scroll the page</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-drag-swipe","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/drag-drop-test.html" scope="external" format="html">the drag and drop page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/drag-drop-test.html"}'/></info></step>
      <step><cmd>Drag <b>Table</b> onto <b>Drop Zone 1</b>.</cmd>
        <info><data name="doc-detective" value='step {"dragAndDrop":{"source":"Table","target":{"selector":".drop-zone","elementText":"Drop Zone 1","timeout":5000},"duration":500}}'/></info></step>
      <step><cmd>Check that <b>Table (dropped)</b> appears in the drop zone.</cmd></step>
      <step><cmd>Press and hold <b>Chart</b> for one second.</cmd>
        <info><data name="doc-detective" value='step {"click":{"selector":".draggable[data-widget=\"chart\"]","button":"left","duration":1000}}'/></info></step>
      <step><cmd>Drag <b>Chart</b> onto <b>Drop Zone 2</b>.</cmd>
        <info><data name="doc-detective" value='step {"dragAndDrop":{"source":{"elementText":"Chart","elementClass":"draggable","elementAttribute":{"data-widget":"chart","draggable":"true"},"timeout":5000},"target":".drop-zone[data-drop=\"zone2\"]","surface":"chrome"}}'/></info></step>
      <step><cmd>Check that <b>Chart (dropped)</b> appears in the second drop zone.</cmd></step>
      <step><cmd>Swipe up to scroll toward the bottom of the page.</cmd>
        <info><data name="doc-detective" value='step {"swipe":"up"}'/></info></step>
      <step><cmd>Swipe down a third of the screen to scroll back.</cmd>
        <info><data name="doc-detective" value='step {"swipe":{"direction":"down","distance":0.3,"duration":300,"surface":"chrome"}}'/></info></step>
      <step><cmd>Swipe from the middle of the page toward the top.</cmd>
        <info><data name="doc-detective" value='step {"swipe":{"from":{"x":400,"y":400},"to":{"x":400,"y":250},"duration":300,"surface":{"browser":"chrome"}}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-drag-swipe","detectSteps":false} -->

# Drag widgets and scroll the page

1. Go to [the drag and drop page](http://localhost:8092/drag-drop-test.html).
   <!-- step {"goTo":"http://localhost:8092/drag-drop-test.html"} -->
2. Drag **Table** onto **Drop Zone 1**.
   <!-- step {"dragAndDrop":{"source":"Table","target":{"selector":".drop-zone","elementText":"Drop Zone 1","timeout":5000},"duration":500}} -->
3. Check that **Table (dropped)** appears in the drop zone.
   <!-- step {"find":{"selector":".drop-zone .dropped-item","elementText":"Table (dropped)"}} -->
4. Press and hold **Chart** for one second.
   <!-- step {"click":{"selector":".draggable[data-widget=\"chart\"]","button":"left","duration":1000}} -->
5. Drag **Chart** onto **Drop Zone 2**.
   <!-- step {"dragAndDrop":{"source":{"elementText":"Chart","elementClass":"draggable","elementAttribute":{"data-widget":"chart","draggable":"true"},"timeout":5000},"target":".drop-zone[data-drop=\"zone2\"]","surface":"chrome"}} -->
6. Check that **Chart (dropped)** appears in the second drop zone.
   <!-- step {"find":{"selector":".drop-zone[data-drop=\"zone2\"] .dropped-item","elementText":"Chart (dropped)"}} -->
7. Swipe up to scroll toward the bottom of the page.
   <!-- step {"swipe":"up"} -->
8. Swipe down a third of the screen to scroll back.
   <!-- step {"swipe":{"direction":"down","distance":0.3,"duration":300,"surface":"chrome"}} -->
9. Swipe from the middle of the page toward the top.
   <!-- step {"swipe":{"from":{"x":400,"y":400},"to":{"x":400,"y":250},"duration":300,"surface":{"browser":"chrome"}}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-drag-swipe","detectSteps":false} */}

# Drag widgets and scroll the page

1. Go to [the drag and drop page](http://localhost:8092/drag-drop-test.html).
   {/* step {"goTo":"http://localhost:8092/drag-drop-test.html"} */}
2. Drag **Table** onto **Drop Zone 1**.
   {/* step {"dragAndDrop":{"source":"Table","target":{"selector":".drop-zone","elementText":"Drop Zone 1","timeout":5000},"duration":500}} */}
3. Check that **Table (dropped)** appears in the drop zone.
   {/* step {"find":{"selector":".drop-zone .dropped-item","elementText":"Table (dropped)"}} */}
4. Press and hold **Chart** for one second.
   {/* step {"click":{"selector":".draggable[data-widget=\"chart\"]","button":"left","duration":1000}} */}
5. Drag **Chart** onto **Drop Zone 2**.
   {/* step {"dragAndDrop":{"source":{"elementText":"Chart","elementClass":"draggable","elementAttribute":{"data-widget":"chart","draggable":"true"},"timeout":5000},"target":".drop-zone[data-drop=\"zone2\"]","surface":"chrome"}} */}
6. Check that **Chart (dropped)** appears in the second drop zone.
   {/* step {"find":{"selector":".drop-zone[data-drop=\"zone2\"] .dropped-item","elementText":"Chart (dropped)"}} */}
7. Swipe up to scroll toward the bottom of the page.
   {/* step {"swipe":"up"} */}
8. Swipe down a third of the screen to scroll back.
   {/* step {"swipe":{"direction":"down","distance":0.3,"duration":300,"surface":"chrome"}} */}
9. Swipe from the middle of the page toward the top.
   {/* step {"swipe":{"from":{"x":400,"y":400},"to":{"x":400,"y":250},"duration":300,"surface":{"browser":"chrome"}}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Drag widgets and scroll the page

// (test {"testId":"nav-drag-swipe","detectSteps":false})

. Go to http://localhost:8092/drag-drop-test.html[the drag and drop page].
+
// (step {"goTo":"http://localhost:8092/drag-drop-test.html"})
. Drag *Table* onto *Drop Zone 1*.
+
// (step {"dragAndDrop":{"source":"Table","target":{"selector":".drop-zone","elementText":"Drop Zone 1","timeout":5000},"duration":500}})
. Check that *Table (dropped)* appears in the drop zone.
+
// (step {"find":{"selector":".drop-zone .dropped-item","elementText":"Table (dropped)"}})
. Press and hold *Chart* for one second.
+
// (step {"click":{"selector":".draggable[data-widget=\"chart\"]","button":"left","duration":1000}})
. Drag *Chart* onto *Drop Zone 2*.
+
// (step {"dragAndDrop":{"source":{"elementText":"Chart","elementClass":"draggable","elementAttribute":{"data-widget":"chart","draggable":"true"},"timeout":5000},"target":".drop-zone[data-drop=\"zone2\"]","surface":"chrome"}})
. Check that *Chart (dropped)* appears in the second drop zone.
+
// (step {"find":{"selector":".drop-zone[data-drop=\"zone2\"] .dropped-item","elementText":"Chart (dropped)"}})
. Swipe up to scroll toward the bottom of the page.
+
// (step {"swipe":"up"})
. Swipe down a third of the screen to scroll back.
+
// (step {"swipe":{"direction":"down","distance":0.3,"duration":300,"surface":"chrome"}})
. Swipe from the middle of the page toward the top.
+
// (step {"swipe":{"from":{"x":400,"y":400},"to":{"x":400,"y":250},"duration":300,"surface":{"browser":"chrome"}}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Drag widgets and scroll the page</title></head>
<body>
<!-- test {"testId":"nav-drag-swipe","detectSteps":false} -->
<h1>Drag widgets and scroll the page</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/drag-drop-test.html">the drag and drop page</a>.
    <!-- step {"goTo":"http://localhost:8092/drag-drop-test.html"} --></li>
  <li>Drag <strong>Table</strong> onto <strong>Drop Zone 1</strong>.
    <!-- step {"dragAndDrop":{"source":"Table","target":{"selector":".drop-zone","elementText":"Drop Zone 1","timeout":5000},"duration":500}} --></li>
  <li>Check that <strong>Table (dropped)</strong> appears in the drop zone.
    <!-- step {"find":{"selector":".drop-zone .dropped-item","elementText":"Table (dropped)"}} --></li>
  <li>Press and hold <strong>Chart</strong> for one second.
    <!-- step {"click":{"selector":".draggable[data-widget=\"chart\"]","button":"left","duration":1000}} --></li>
  <li>Drag <strong>Chart</strong> onto <strong>Drop Zone 2</strong>.
    <!-- step {"dragAndDrop":{"source":{"elementText":"Chart","elementClass":"draggable","elementAttribute":{"data-widget":"chart","draggable":"true"},"timeout":5000},"target":".drop-zone[data-drop=\"zone2\"]","surface":"chrome"}} --></li>
  <li>Check that <strong>Chart (dropped)</strong> appears in the second drop zone.
    <!-- step {"find":{"selector":".drop-zone[data-drop=\"zone2\"] .dropped-item","elementText":"Chart (dropped)"}} --></li>
  <li>Swipe up to scroll toward the bottom of the page.
    <!-- step {"swipe":"up"} --></li>
  <li>Swipe down a third of the screen to scroll back.
    <!-- step {"swipe":{"direction":"down","distance":0.3,"duration":300,"surface":"chrome"}} --></li>
  <li>Swipe from the middle of the page toward the top.
    <!-- step {"swipe":{"from":{"x":400,"y":400},"to":{"x":400,"y":250},"duration":300,"surface":{"browser":"chrome"}}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Drag widgets and scroll the page
================================

.. test {"testId":"nav-drag-swipe","detectSteps":false}

#. Go to `the drag and drop page <http://localhost:8092/drag-drop-test.html>`_.

   .. step {"goTo":"http://localhost:8092/drag-drop-test.html"}

#. Drag **Table** onto **Drop Zone 1**.

   .. step {"dragAndDrop":{"source":"Table","target":{"selector":".drop-zone","elementText":"Drop Zone 1","timeout":5000},"duration":500}}

#. Check that **Table (dropped)** appears in the drop zone.

   .. step {"find":{"selector":".drop-zone .dropped-item","elementText":"Table (dropped)"}}

#. Press and hold **Chart** for one second.

   .. step {"click":{"selector":".draggable[data-widget=\"chart\"]","button":"left","duration":1000}}

#. Drag **Chart** onto **Drop Zone 2**.

   .. step {"dragAndDrop":{"source":{"elementText":"Chart","elementClass":"draggable","elementAttribute":{"data-widget":"chart","draggable":"true"},"timeout":5000},"target":".drop-zone[data-drop=\"zone2\"]","surface":"chrome"}}

#. Check that **Chart (dropped)** appears in the second drop zone.

   .. step {"find":{"selector":".drop-zone[data-drop=\"zone2\"] .dropped-item","elementText":"Chart (dropped)"}}

#. Swipe up to scroll toward the bottom of the page.

   .. step {"swipe":"up"}

#. Swipe down a third of the screen to scroll back.

   .. step {"swipe":{"direction":"down","distance":0.3,"duration":300,"surface":"chrome"}}

#. Swipe from the middle of the page toward the top.

   .. step {"swipe":{"from":{"x":400,"y":400},"to":{"x":400,"y":250},"duration":300,"surface":{"browser":"chrome"}}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-drag-swipe">
  <title>Drag widgets and scroll the page</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-drag-swipe","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/drag-drop-test.html" scope="external" format="html">the drag and drop page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/drag-drop-test.html"}'/></info></step>
      <step><cmd>Drag <b>Table</b> onto <b>Drop Zone 1</b>.</cmd>
        <info><data name="doc-detective" value='step {"dragAndDrop":{"source":"Table","target":{"selector":".drop-zone","elementText":"Drop Zone 1","timeout":5000},"duration":500}}'/></info></step>
      <step><cmd>Check that <b>Table (dropped)</b> appears in the drop zone.</cmd>
        <info><data name="doc-detective" value='step {"find":{"selector":".drop-zone .dropped-item","elementText":"Table (dropped)"}}'/></info></step>
      <step><cmd>Press and hold <b>Chart</b> for one second.</cmd>
        <info><data name="doc-detective" value='step {"click":{"selector":".draggable[data-widget=\"chart\"]","button":"left","duration":1000}}'/></info></step>
      <step><cmd>Drag <b>Chart</b> onto <b>Drop Zone 2</b>.</cmd>
        <info><data name="doc-detective" value='step {"dragAndDrop":{"source":{"elementText":"Chart","elementClass":"draggable","elementAttribute":{"data-widget":"chart","draggable":"true"},"timeout":5000},"target":".drop-zone[data-drop=\"zone2\"]","surface":"chrome"}}'/></info></step>
      <step><cmd>Check that <b>Chart (dropped)</b> appears in the second drop zone.</cmd>
        <info><data name="doc-detective" value='step {"find":{"selector":".drop-zone[data-drop=\"zone2\"] .dropped-item","elementText":"Chart (dropped)"}}'/></info></step>
      <step><cmd>Swipe up to scroll toward the bottom of the page.</cmd>
        <info><data name="doc-detective" value='step {"swipe":"up"}'/></info></step>
      <step><cmd>Swipe down a third of the screen to scroll back.</cmd>
        <info><data name="doc-detective" value='step {"swipe":{"direction":"down","distance":0.3,"duration":300,"surface":"chrome"}}'/></info></step>
      <step><cmd>Swipe from the middle of the page toward the top.</cmd>
        <info><data name="doc-detective" value='step {"swipe":{"from":{"x":400,"y":400},"to":{"x":400,"y":250},"duration":300,"surface":{"browser":"chrome"}}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-drag-swipe",
      "steps": [
        {
          "goTo": "http://localhost:8092/drag-drop-test.html"
        },
        {
          "dragAndDrop": {
            "source": "Table",
            "target": {
              "selector": ".drop-zone",
              "elementText": "Drop Zone 1",
              "timeout": 5000
            },
            "duration": 500
          }
        },
        {
          "find": {
            "selector": ".drop-zone .dropped-item",
            "elementText": "Table (dropped)"
          }
        },
        {
          "click": {
            "selector": ".draggable[data-widget=\"chart\"]",
            "button": "left",
            "duration": 1000
          }
        },
        {
          "dragAndDrop": {
            "source": {
              "elementText": "Chart",
              "elementClass": "draggable",
              "elementAttribute": {
                "data-widget": "chart",
                "draggable": "true"
              },
              "timeout": 5000
            },
            "target": ".drop-zone[data-drop=\"zone2\"]",
            "surface": "chrome"
          }
        },
        {
          "find": {
            "selector": ".drop-zone[data-drop=\"zone2\"] .dropped-item",
            "elementText": "Chart (dropped)"
          }
        },
        {
          "swipe": "up"
        },
        {
          "swipe": {
            "direction": "down",
            "distance": 0.3,
            "duration": 300,
            "surface": "chrome"
          }
        },
        {
          "swipe": {
            "from": {
              "x": 400,
              "y": 400
            },
            "to": {
              "x": 400,
              "y": 250
            },
            "duration": 300,
            "surface": {
              "browser": "chrome"
            }
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-drag-swipe
    steps:
      - goTo: http://localhost:8092/drag-drop-test.html
      - dragAndDrop:
          source: Table
          target:
            selector: .drop-zone
            elementText: Drop Zone 1
            timeout: 5000
          duration: 500
      - find:
          selector: .drop-zone .dropped-item
          elementText: Table (dropped)
      - click:
          selector: .draggable[data-widget="chart"]
          button: left
          duration: 1000
      - dragAndDrop:
          source:
            elementText: Chart
            elementClass: draggable
            elementAttribute:
              data-widget: chart
              draggable: "true"
            timeout: 5000
          target: .drop-zone[data-drop="zone2"]
          surface: chrome
      - find:
          selector: .drop-zone[data-drop="zone2"] .dropped-item
          elementText: Chart (dropped)
      - swipe: up
      - swipe:
          direction: down
          distance: 0.3
          duration: 300
          surface: chrome
      - swipe:
          from:
            x: 400
            y: 400
          to:
            x: 400
            y: 250
          duration: 300
          surface:
            browser: chrome
```

### What detection finds

No default rule detects a drag, a press and hold, or a swipe, so every detected variant carries `step` statements for them. A `goTo` statement opens the page even when detection is off. Detection adds a `find` step for each bold phrase. Those steps confirm that **Table**, **Drop Zone 1**, **Chart**, and **Drop Zone 2** are on the page before the steps that use them.

## Enter text in a DITA task

This procedure uses DITA's own detection rules. They turn an `<xref>` into [`goTo`](/docs/actions/goto) and [`checkLink`](/docs/actions/checklink) steps, a `<userinput>` typed into a `<uicontrol>` into a [`type`](/docs/actions/type) step, a `<wintitle>` into a [`find`](/docs/actions/find) step, and a `<link>` into a `checkLink` step.

#### Prose

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-dita-controls">
  <title>Enter text in a field</title>
  <taskbody>
    <steps>
      <step><cmd>Open <xref href="http://localhost:8092/type-echo.html" scope="external" format="html">the type echo page</xref>.</cmd></step>
      <step><cmd>Check that the page title reads <wintitle>Type Echo Test Page</wintitle>.</cmd></step>
      <step><cmd>Type <userinput>Hello, DITA</userinput> into the <uicontrol>Type here:</uicontrol> field.</cmd></step>
      <step><cmd>Check that the page shows <b>Hello, DITA</b> below the field.</cmd></step>
    </steps>
  </taskbody>
  <related-links>
    <link href="http://localhost:8092/index.html" scope="external" format="html"><linktext>Test server home</linktext></link>
  </related-links>
</task>
```

#### Detected

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-dita-controls">
  <title>Enter text in a field</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-dita-controls","detectSteps":true}'/>
    <steps>
      <step><cmd>Open <xref href="http://localhost:8092/type-echo.html" scope="external" format="html">the type echo page</xref>.</cmd></step>
      <step><cmd>Check that the page title reads <wintitle>Type Echo Test Page</wintitle>.</cmd></step>
      <step><cmd>Type <userinput>Hello, DITA</userinput> into the <uicontrol>Type here:</uicontrol> field.</cmd></step>
      <step><cmd>Check that the page shows <b>Hello, DITA</b> below the field.</cmd></step>
    </steps>
  </taskbody>
  <related-links>
    <link href="http://localhost:8092/index.html" scope="external" format="html"><linktext>Test server home</linktext></link>
  </related-links>
</task>
```

#### Inline

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-dita-controls">
  <title>Enter text in a field</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-dita-controls","detectSteps":false}'/>
    <steps>
      <step><cmd>Open <xref href="http://localhost:8092/type-echo.html" scope="external" format="html">the type echo page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/></info></step>
      <step><cmd>Check that the page title reads <wintitle>Type Echo Test Page</wintitle>.</cmd>
        <info><data name="doc-detective" value='step {"find":"Type Echo Test Page"}'/></info></step>
      <step><cmd>Type <userinput>Hello, DITA</userinput> into the <uicontrol>Type here:</uicontrol> field.</cmd>
        <info><data name="doc-detective" value='step {"type":{"keys":"Hello, DITA","elementAria":"Type here:"}}'/></info></step>
      <step><cmd>Check that the page shows <b>Hello, DITA</b> below the field.</cmd>
        <info><data name="doc-detective" value='step {"find":"Hello, DITA"}'/></info></step>
    </steps>
  </taskbody>
  <related-links>
    <link href="http://localhost:8092/index.html" scope="external" format="html"><linktext>Test server home</linktext></link>
  </related-links>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-dita-controls",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": "Type Echo Test Page"
        },
        {
          "type": {
            "keys": "Hello, DITA",
            "elementAria": "Type here:"
          }
        },
        {
          "find": "Hello, DITA"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-dita-controls
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find: Type Echo Test Page
      - type:
          keys: Hello, DITA
          elementAria: "Type here:"
      - find: Hello, DITA
```

This example is DITA only, plus the standalone spec, because `<wintitle>`, `<userinput>`, `<uicontrol>`, and `<link>` have no equivalent in the other formats.

### What detection finds

| DITA source                                                       | Detected steps                                                                                                                            |
| ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `<xref>` after "Open"                                             | `goTo` the URL, then `checkLink` the same URL                                                                                             |
| `<wintitle>`                                                      | `find` the title text on the page                                                                                                         |
| `Type <userinput>…</userinput> into the <uicontrol>…</uicontrol>` | `type` the `<userinput>` text into the field whose accessible name is the `<uicontrol>` text, with `elementAria`, then `find` the control |
| `<b>`                                                             | `find` the text                                                                                                                           |
| `<link>` in `<related-links>`                                     | `checkLink` the URL                                                                                                                       |

The `<related-links>` section comes after `<taskbody>`, so the test has no `test end` statement and runs to the end of the topic. That way the detected test includes the related link. The inline variant can't place a `step` statement after the link, so the inline and standalone variants leave it out.

## How the permutation examples work

Each example in the sections below varies one setting, or one deliberate combination, in a short procedure. Detected variants carry a `step` statement for the varied step when default detection can't produce it. They also carry a `goTo` statement, so they still open the page with detection off.

For clicking, typing, dragging, uploading, iframes, swiping, waiting, and checking links, see [Interaction options](/reference/docs-as-tests/interaction-options).

## `goTo` permutations

Each example opens a page with one [`goTo`](/docs/actions/goto) option set, then checks the page with [`find`](/docs/actions/find).

### `waitUntil.networkIdleTime: 500`

**Varies:** `goTo.waitUntil.networkIdleTime` · **Value:** `500` · **Effect:** the step waits until the page has made no network requests for 500 milliseconds, so content that a request loads is there.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Wait for network requests to finish

1. Go to [the network test page](http://localhost:8092/waitUntil-test-network.html).
2. Check that the page shows **Content loaded from API**.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Wait for network requests to finish

1. Go to [the network test page](http://localhost:8092/waitUntil-test-network.html).
2. Check that the page shows **Content loaded from API**.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Wait for network requests to finish

. Go to http://localhost:8092/waitUntil-test-network.html[the network test page].
. Check that the page shows *Content loaded from API*.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for network requests to finish</title></head>
<body>
<h1>Wait for network requests to finish</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/waitUntil-test-network.html">the network test page</a>.</li>
  <li>Check that the page shows <strong>Content loaded from API</strong>.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Wait for network requests to finish
===================================

#. Go to `the network test page <http://localhost:8092/waitUntil-test-network.html>`_.
#. Check that the page shows **Content loaded from API**.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-waituntil-networkidle">
  <title>Wait for network requests to finish</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/waitUntil-test-network.html" scope="external" format="html">the network test page</xref>.</cmd></step>
      <step><cmd>Check that the page shows <b>Content loaded from API</b>.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-goto-waituntil-networkidle","detectSteps":true} -->

# Wait for network requests to finish

1. Go to [the network test page](http://localhost:8092/waitUntil-test-network.html).
   <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-network.html","waitUntil":{"networkIdleTime":500}}} -->
2. Check that the page shows **Content loaded from API**.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-goto-waituntil-networkidle","detectSteps":true} */}

# Wait for network requests to finish

1. Go to [the network test page](http://localhost:8092/waitUntil-test-network.html).
   {/* step {"goTo":{"url":"http://localhost:8092/waitUntil-test-network.html","waitUntil":{"networkIdleTime":500}}} */}
2. Check that the page shows **Content loaded from API**.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Wait for network requests to finish

// (test {"testId":"nav-goto-waituntil-networkidle","detectSteps":true})

. Go to http://localhost:8092/waitUntil-test-network.html[the network test page].
+
// (step {"goTo":{"url":"http://localhost:8092/waitUntil-test-network.html","waitUntil":{"networkIdleTime":500}}})
. Check that the page shows *Content loaded from API*.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for network requests to finish</title></head>
<body>
<!-- test {"testId":"nav-goto-waituntil-networkidle","detectSteps":true} -->
<h1>Wait for network requests to finish</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/waitUntil-test-network.html">the network test page</a>.
    <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-network.html","waitUntil":{"networkIdleTime":500}}} --></li>
  <li>Check that the page shows <strong>Content loaded from API</strong>.</li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Wait for network requests to finish
===================================

.. test {"testId":"nav-goto-waituntil-networkidle","detectSteps":true}

#. Go to `the network test page <http://localhost:8092/waitUntil-test-network.html>`_.

   .. step {"goTo":{"url":"http://localhost:8092/waitUntil-test-network.html","waitUntil":{"networkIdleTime":500}}}

#. Check that the page shows **Content loaded from API**.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-waituntil-networkidle">
  <title>Wait for network requests to finish</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-goto-waituntil-networkidle","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/waitUntil-test-network.html" scope="external" format="html">the network test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/waitUntil-test-network.html","waitUntil":{"networkIdleTime":500}}}'/></info></step>
      <step><cmd>Check that the page shows <b>Content loaded from API</b>.</cmd></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-goto-waituntil-networkidle","detectSteps":false} -->

# Wait for network requests to finish

1. Go to [the network test page](http://localhost:8092/waitUntil-test-network.html).
   <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-network.html","waitUntil":{"networkIdleTime":500}}} -->
2. Check that the page shows **Content loaded from API**.
   <!-- step {"find":"Content loaded from API"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-goto-waituntil-networkidle","detectSteps":false} */}

# Wait for network requests to finish

1. Go to [the network test page](http://localhost:8092/waitUntil-test-network.html).
   {/* step {"goTo":{"url":"http://localhost:8092/waitUntil-test-network.html","waitUntil":{"networkIdleTime":500}}} */}
2. Check that the page shows **Content loaded from API**.
   {/* step {"find":"Content loaded from API"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Wait for network requests to finish

// (test {"testId":"nav-goto-waituntil-networkidle","detectSteps":false})

. Go to http://localhost:8092/waitUntil-test-network.html[the network test page].
+
// (step {"goTo":{"url":"http://localhost:8092/waitUntil-test-network.html","waitUntil":{"networkIdleTime":500}}})
. Check that the page shows *Content loaded from API*.
+
// (step {"find":"Content loaded from API"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for network requests to finish</title></head>
<body>
<!-- test {"testId":"nav-goto-waituntil-networkidle","detectSteps":false} -->
<h1>Wait for network requests to finish</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/waitUntil-test-network.html">the network test page</a>.
    <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-network.html","waitUntil":{"networkIdleTime":500}}} --></li>
  <li>Check that the page shows <strong>Content loaded from API</strong>.
    <!-- step {"find":"Content loaded from API"} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Wait for network requests to finish
===================================

.. test {"testId":"nav-goto-waituntil-networkidle","detectSteps":false}

#. Go to `the network test page <http://localhost:8092/waitUntil-test-network.html>`_.

   .. step {"goTo":{"url":"http://localhost:8092/waitUntil-test-network.html","waitUntil":{"networkIdleTime":500}}}

#. Check that the page shows **Content loaded from API**.

   .. step {"find":"Content loaded from API"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-waituntil-networkidle">
  <title>Wait for network requests to finish</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-goto-waituntil-networkidle","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/waitUntil-test-network.html" scope="external" format="html">the network test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/waitUntil-test-network.html","waitUntil":{"networkIdleTime":500}}}'/></info></step>
      <step><cmd>Check that the page shows <b>Content loaded from API</b>.</cmd>
        <info><data name="doc-detective" value='step {"find":"Content loaded from API"}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-goto-waituntil-networkidle",
      "steps": [
        {
          "goTo": {
            "url": "http://localhost:8092/waitUntil-test-network.html",
            "waitUntil": {
              "networkIdleTime": 500
            }
          }
        },
        {
          "find": "Content loaded from API"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-goto-waituntil-networkidle
    steps:
      - goTo:
          url: http://localhost:8092/waitUntil-test-network.html
          waitUntil:
            networkIdleTime: 500
      - find: Content loaded from API
```

### `waitUntil.domIdleTime: 1000`

**Varies:** `goTo.waitUntil.domIdleTime` · **Value:** `1000` · **Effect:** the step waits until the DOM has stopped changing for one second.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Wait for the page to stop changing

1. Go to [the DOM mutations page](http://localhost:8092/waitUntil-test-dom-mutations.html).
2. Check that the page shows **All mutations complete**.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Wait for the page to stop changing

1. Go to [the DOM mutations page](http://localhost:8092/waitUntil-test-dom-mutations.html).
2. Check that the page shows **All mutations complete**.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Wait for the page to stop changing

. Go to http://localhost:8092/waitUntil-test-dom-mutations.html[the DOM mutations page].
. Check that the page shows *All mutations complete*.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for the page to stop changing</title></head>
<body>
<h1>Wait for the page to stop changing</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/waitUntil-test-dom-mutations.html">the DOM mutations page</a>.</li>
  <li>Check that the page shows <strong>All mutations complete</strong>.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Wait for the page to stop changing
==================================

#. Go to `the DOM mutations page <http://localhost:8092/waitUntil-test-dom-mutations.html>`_.
#. Check that the page shows **All mutations complete**.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-waituntil-domidle">
  <title>Wait for the page to stop changing</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/waitUntil-test-dom-mutations.html" scope="external" format="html">the DOM mutations page</xref>.</cmd></step>
      <step><cmd>Check that the page shows <b>All mutations complete</b>.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-goto-waituntil-domidle","detectSteps":true} -->

# Wait for the page to stop changing

1. Go to [the DOM mutations page](http://localhost:8092/waitUntil-test-dom-mutations.html).
   <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-dom-mutations.html","waitUntil":{"domIdleTime":1000}}} -->
2. Check that the page shows **All mutations complete**.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-goto-waituntil-domidle","detectSteps":true} */}

# Wait for the page to stop changing

1. Go to [the DOM mutations page](http://localhost:8092/waitUntil-test-dom-mutations.html).
   {/* step {"goTo":{"url":"http://localhost:8092/waitUntil-test-dom-mutations.html","waitUntil":{"domIdleTime":1000}}} */}
2. Check that the page shows **All mutations complete**.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Wait for the page to stop changing

// (test {"testId":"nav-goto-waituntil-domidle","detectSteps":true})

. Go to http://localhost:8092/waitUntil-test-dom-mutations.html[the DOM mutations page].
+
// (step {"goTo":{"url":"http://localhost:8092/waitUntil-test-dom-mutations.html","waitUntil":{"domIdleTime":1000}}})
. Check that the page shows *All mutations complete*.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for the page to stop changing</title></head>
<body>
<!-- test {"testId":"nav-goto-waituntil-domidle","detectSteps":true} -->
<h1>Wait for the page to stop changing</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/waitUntil-test-dom-mutations.html">the DOM mutations page</a>.
    <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-dom-mutations.html","waitUntil":{"domIdleTime":1000}}} --></li>
  <li>Check that the page shows <strong>All mutations complete</strong>.</li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Wait for the page to stop changing
==================================

.. test {"testId":"nav-goto-waituntil-domidle","detectSteps":true}

#. Go to `the DOM mutations page <http://localhost:8092/waitUntil-test-dom-mutations.html>`_.

   .. step {"goTo":{"url":"http://localhost:8092/waitUntil-test-dom-mutations.html","waitUntil":{"domIdleTime":1000}}}

#. Check that the page shows **All mutations complete**.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-waituntil-domidle">
  <title>Wait for the page to stop changing</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-goto-waituntil-domidle","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/waitUntil-test-dom-mutations.html" scope="external" format="html">the DOM mutations page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/waitUntil-test-dom-mutations.html","waitUntil":{"domIdleTime":1000}}}'/></info></step>
      <step><cmd>Check that the page shows <b>All mutations complete</b>.</cmd></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-goto-waituntil-domidle","detectSteps":false} -->

# Wait for the page to stop changing

1. Go to [the DOM mutations page](http://localhost:8092/waitUntil-test-dom-mutations.html).
   <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-dom-mutations.html","waitUntil":{"domIdleTime":1000}}} -->
2. Check that the page shows **All mutations complete**.
   <!-- step {"find":"All mutations complete"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-goto-waituntil-domidle","detectSteps":false} */}

# Wait for the page to stop changing

1. Go to [the DOM mutations page](http://localhost:8092/waitUntil-test-dom-mutations.html).
   {/* step {"goTo":{"url":"http://localhost:8092/waitUntil-test-dom-mutations.html","waitUntil":{"domIdleTime":1000}}} */}
2. Check that the page shows **All mutations complete**.
   {/* step {"find":"All mutations complete"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Wait for the page to stop changing

// (test {"testId":"nav-goto-waituntil-domidle","detectSteps":false})

. Go to http://localhost:8092/waitUntil-test-dom-mutations.html[the DOM mutations page].
+
// (step {"goTo":{"url":"http://localhost:8092/waitUntil-test-dom-mutations.html","waitUntil":{"domIdleTime":1000}}})
. Check that the page shows *All mutations complete*.
+
// (step {"find":"All mutations complete"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for the page to stop changing</title></head>
<body>
<!-- test {"testId":"nav-goto-waituntil-domidle","detectSteps":false} -->
<h1>Wait for the page to stop changing</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/waitUntil-test-dom-mutations.html">the DOM mutations page</a>.
    <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-dom-mutations.html","waitUntil":{"domIdleTime":1000}}} --></li>
  <li>Check that the page shows <strong>All mutations complete</strong>.
    <!-- step {"find":"All mutations complete"} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Wait for the page to stop changing
==================================

.. test {"testId":"nav-goto-waituntil-domidle","detectSteps":false}

#. Go to `the DOM mutations page <http://localhost:8092/waitUntil-test-dom-mutations.html>`_.

   .. step {"goTo":{"url":"http://localhost:8092/waitUntil-test-dom-mutations.html","waitUntil":{"domIdleTime":1000}}}

#. Check that the page shows **All mutations complete**.

   .. step {"find":"All mutations complete"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-waituntil-domidle">
  <title>Wait for the page to stop changing</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-goto-waituntil-domidle","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/waitUntil-test-dom-mutations.html" scope="external" format="html">the DOM mutations page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/waitUntil-test-dom-mutations.html","waitUntil":{"domIdleTime":1000}}}'/></info></step>
      <step><cmd>Check that the page shows <b>All mutations complete</b>.</cmd>
        <info><data name="doc-detective" value='step {"find":"All mutations complete"}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-goto-waituntil-domidle",
      "steps": [
        {
          "goTo": {
            "url": "http://localhost:8092/waitUntil-test-dom-mutations.html",
            "waitUntil": {
              "domIdleTime": 1000
            }
          }
        },
        {
          "find": "All mutations complete"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-goto-waituntil-domidle
    steps:
      - goTo:
          url: http://localhost:8092/waitUntil-test-dom-mutations.html
          waitUntil:
            domIdleTime: 1000
      - find: All mutations complete
```

### `waitUntil.find`

**Varies:** `goTo.waitUntil.find` · **Value:** `{ "selector": ".dashboard-loaded" }` · **Effect:** the step waits until an element that matches the selector appears.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Wait for an element to appear

1. Go to [the late element page](http://localhost:8092/waitUntil-test-late-element.html).
2. Check that the page shows **Dashboard**.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Wait for an element to appear

1. Go to [the late element page](http://localhost:8092/waitUntil-test-late-element.html).
2. Check that the page shows **Dashboard**.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Wait for an element to appear

. Go to http://localhost:8092/waitUntil-test-late-element.html[the late element page].
. Check that the page shows *Dashboard*.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for an element to appear</title></head>
<body>
<h1>Wait for an element to appear</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/waitUntil-test-late-element.html">the late element page</a>.</li>
  <li>Check that the page shows <strong>Dashboard</strong>.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Wait for an element to appear
=============================

#. Go to `the late element page <http://localhost:8092/waitUntil-test-late-element.html>`_.
#. Check that the page shows **Dashboard**.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-waituntil-find">
  <title>Wait for an element to appear</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/waitUntil-test-late-element.html" scope="external" format="html">the late element page</xref>.</cmd></step>
      <step><cmd>Check that the page shows <b>Dashboard</b>.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-goto-waituntil-find","detectSteps":true} -->

# Wait for an element to appear

1. Go to [the late element page](http://localhost:8092/waitUntil-test-late-element.html).
   <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","waitUntil":{"find":{"selector":".dashboard-loaded"}}}} -->
2. Check that the page shows **Dashboard**.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-goto-waituntil-find","detectSteps":true} */}

# Wait for an element to appear

1. Go to [the late element page](http://localhost:8092/waitUntil-test-late-element.html).
   {/* step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","waitUntil":{"find":{"selector":".dashboard-loaded"}}}} */}
2. Check that the page shows **Dashboard**.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Wait for an element to appear

// (test {"testId":"nav-goto-waituntil-find","detectSteps":true})

. Go to http://localhost:8092/waitUntil-test-late-element.html[the late element page].
+
// (step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","waitUntil":{"find":{"selector":".dashboard-loaded"}}}})
. Check that the page shows *Dashboard*.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for an element to appear</title></head>
<body>
<!-- test {"testId":"nav-goto-waituntil-find","detectSteps":true} -->
<h1>Wait for an element to appear</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/waitUntil-test-late-element.html">the late element page</a>.
    <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","waitUntil":{"find":{"selector":".dashboard-loaded"}}}} --></li>
  <li>Check that the page shows <strong>Dashboard</strong>.</li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Wait for an element to appear
=============================

.. test {"testId":"nav-goto-waituntil-find","detectSteps":true}

#. Go to `the late element page <http://localhost:8092/waitUntil-test-late-element.html>`_.

   .. step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","waitUntil":{"find":{"selector":".dashboard-loaded"}}}}

#. Check that the page shows **Dashboard**.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-waituntil-find">
  <title>Wait for an element to appear</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-goto-waituntil-find","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/waitUntil-test-late-element.html" scope="external" format="html">the late element page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","waitUntil":{"find":{"selector":".dashboard-loaded"}}}}'/></info></step>
      <step><cmd>Check that the page shows <b>Dashboard</b>.</cmd></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-goto-waituntil-find","detectSteps":false} -->

# Wait for an element to appear

1. Go to [the late element page](http://localhost:8092/waitUntil-test-late-element.html).
   <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","waitUntil":{"find":{"selector":".dashboard-loaded"}}}} -->
2. Check that the page shows **Dashboard**.
   <!-- step {"find":"Dashboard"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-goto-waituntil-find","detectSteps":false} */}

# Wait for an element to appear

1. Go to [the late element page](http://localhost:8092/waitUntil-test-late-element.html).
   {/* step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","waitUntil":{"find":{"selector":".dashboard-loaded"}}}} */}
2. Check that the page shows **Dashboard**.
   {/* step {"find":"Dashboard"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Wait for an element to appear

// (test {"testId":"nav-goto-waituntil-find","detectSteps":false})

. Go to http://localhost:8092/waitUntil-test-late-element.html[the late element page].
+
// (step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","waitUntil":{"find":{"selector":".dashboard-loaded"}}}})
. Check that the page shows *Dashboard*.
+
// (step {"find":"Dashboard"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for an element to appear</title></head>
<body>
<!-- test {"testId":"nav-goto-waituntil-find","detectSteps":false} -->
<h1>Wait for an element to appear</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/waitUntil-test-late-element.html">the late element page</a>.
    <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","waitUntil":{"find":{"selector":".dashboard-loaded"}}}} --></li>
  <li>Check that the page shows <strong>Dashboard</strong>.
    <!-- step {"find":"Dashboard"} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Wait for an element to appear
=============================

.. test {"testId":"nav-goto-waituntil-find","detectSteps":false}

#. Go to `the late element page <http://localhost:8092/waitUntil-test-late-element.html>`_.

   .. step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","waitUntil":{"find":{"selector":".dashboard-loaded"}}}}

#. Check that the page shows **Dashboard**.

   .. step {"find":"Dashboard"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-waituntil-find">
  <title>Wait for an element to appear</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-goto-waituntil-find","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/waitUntil-test-late-element.html" scope="external" format="html">the late element page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","waitUntil":{"find":{"selector":".dashboard-loaded"}}}}'/></info></step>
      <step><cmd>Check that the page shows <b>Dashboard</b>.</cmd>
        <info><data name="doc-detective" value='step {"find":"Dashboard"}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-goto-waituntil-find",
      "steps": [
        {
          "goTo": {
            "url": "http://localhost:8092/waitUntil-test-late-element.html",
            "waitUntil": {
              "find": {
                "selector": ".dashboard-loaded"
              }
            }
          }
        },
        {
          "find": "Dashboard"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-goto-waituntil-find
    steps:
      - goTo:
          url: http://localhost:8092/waitUntil-test-late-element.html
          waitUntil:
            find:
              selector: .dashboard-loaded
      - find: Dashboard
```

### `waitUntil: { networkIdleTime, domIdleTime, find }`

**Varies:** `goTo.waitUntil` · **Value:** `networkIdleTime, domIdleTime, and find together, with timeout: 10000` · **Effect:** the step waits until every condition holds, and fails if they don't all hold within 10 seconds.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Wait for the network, the page, and an element

1. Go to [the late element page](http://localhost:8092/waitUntil-test-late-element.html).
2. Check that the page shows **System operational**.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Wait for the network, the page, and an element

1. Go to [the late element page](http://localhost:8092/waitUntil-test-late-element.html).
2. Check that the page shows **System operational**.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Wait for the network, the page, and an element

. Go to http://localhost:8092/waitUntil-test-late-element.html[the late element page].
. Check that the page shows *System operational*.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for the network, the page, and an element</title></head>
<body>
<h1>Wait for the network, the page, and an element</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/waitUntil-test-late-element.html">the late element page</a>.</li>
  <li>Check that the page shows <strong>System operational</strong>.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Wait for the network, the page, and an element
==============================================

#. Go to `the late element page <http://localhost:8092/waitUntil-test-late-element.html>`_.
#. Check that the page shows **System operational**.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-waituntil-combined">
  <title>Wait for the network, the page, and an element</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/waitUntil-test-late-element.html" scope="external" format="html">the late element page</xref>.</cmd></step>
      <step><cmd>Check that the page shows <b>System operational</b>.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-goto-waituntil-combined","detectSteps":true} -->

# Wait for the network, the page, and an element

1. Go to [the late element page](http://localhost:8092/waitUntil-test-late-element.html).
   <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","timeout":10000,"waitUntil":{"networkIdleTime":500,"domIdleTime":1000,"find":{"selector":".status","elementText":"/.*operational.*/"}}}} -->
2. Check that the page shows **System operational**.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-goto-waituntil-combined","detectSteps":true} */}

# Wait for the network, the page, and an element

1. Go to [the late element page](http://localhost:8092/waitUntil-test-late-element.html).
   {/* step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","timeout":10000,"waitUntil":{"networkIdleTime":500,"domIdleTime":1000,"find":{"selector":".status","elementText":"/.*operational.*\/"}}}} */}
2. Check that the page shows **System operational**.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Wait for the network, the page, and an element

// (test {"testId":"nav-goto-waituntil-combined","detectSteps":true})

. Go to http://localhost:8092/waitUntil-test-late-element.html[the late element page].
+
// (step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","timeout":10000,"waitUntil":{"networkIdleTime":500,"domIdleTime":1000,"find":{"selector":".status","elementText":"/.*operational.*/"}}}})
. Check that the page shows *System operational*.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for the network, the page, and an element</title></head>
<body>
<!-- test {"testId":"nav-goto-waituntil-combined","detectSteps":true} -->
<h1>Wait for the network, the page, and an element</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/waitUntil-test-late-element.html">the late element page</a>.
    <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","timeout":10000,"waitUntil":{"networkIdleTime":500,"domIdleTime":1000,"find":{"selector":".status","elementText":"/.*operational.*/"}}}} --></li>
  <li>Check that the page shows <strong>System operational</strong>.</li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Wait for the network, the page, and an element
==============================================

.. test {"testId":"nav-goto-waituntil-combined","detectSteps":true}

#. Go to `the late element page <http://localhost:8092/waitUntil-test-late-element.html>`_.

   .. step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","timeout":10000,"waitUntil":{"networkIdleTime":500,"domIdleTime":1000,"find":{"selector":".status","elementText":"/.*operational.*/"}}}}

#. Check that the page shows **System operational**.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-waituntil-combined">
  <title>Wait for the network, the page, and an element</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-goto-waituntil-combined","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/waitUntil-test-late-element.html" scope="external" format="html">the late element page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","timeout":10000,"waitUntil":{"networkIdleTime":500,"domIdleTime":1000,"find":{"selector":".status","elementText":"/.*operational.*/"}}}}'/></info></step>
      <step><cmd>Check that the page shows <b>System operational</b>.</cmd></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-goto-waituntil-combined","detectSteps":false} -->

# Wait for the network, the page, and an element

1. Go to [the late element page](http://localhost:8092/waitUntil-test-late-element.html).
   <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","timeout":10000,"waitUntil":{"networkIdleTime":500,"domIdleTime":1000,"find":{"selector":".status","elementText":"/.*operational.*/"}}}} -->
2. Check that the page shows **System operational**.
   <!-- step {"find":"System operational"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-goto-waituntil-combined","detectSteps":false} */}

# Wait for the network, the page, and an element

1. Go to [the late element page](http://localhost:8092/waitUntil-test-late-element.html).
   {/* step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","timeout":10000,"waitUntil":{"networkIdleTime":500,"domIdleTime":1000,"find":{"selector":".status","elementText":"/.*operational.*\/"}}}} */}
2. Check that the page shows **System operational**.
   {/* step {"find":"System operational"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Wait for the network, the page, and an element

// (test {"testId":"nav-goto-waituntil-combined","detectSteps":false})

. Go to http://localhost:8092/waitUntil-test-late-element.html[the late element page].
+
// (step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","timeout":10000,"waitUntil":{"networkIdleTime":500,"domIdleTime":1000,"find":{"selector":".status","elementText":"/.*operational.*/"}}}})
. Check that the page shows *System operational*.
+
// (step {"find":"System operational"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Wait for the network, the page, and an element</title></head>
<body>
<!-- test {"testId":"nav-goto-waituntil-combined","detectSteps":false} -->
<h1>Wait for the network, the page, and an element</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/waitUntil-test-late-element.html">the late element page</a>.
    <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","timeout":10000,"waitUntil":{"networkIdleTime":500,"domIdleTime":1000,"find":{"selector":".status","elementText":"/.*operational.*/"}}}} --></li>
  <li>Check that the page shows <strong>System operational</strong>.
    <!-- step {"find":"System operational"} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Wait for the network, the page, and an element
==============================================

.. test {"testId":"nav-goto-waituntil-combined","detectSteps":false}

#. Go to `the late element page <http://localhost:8092/waitUntil-test-late-element.html>`_.

   .. step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","timeout":10000,"waitUntil":{"networkIdleTime":500,"domIdleTime":1000,"find":{"selector":".status","elementText":"/.*operational.*/"}}}}

#. Check that the page shows **System operational**.

   .. step {"find":"System operational"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-waituntil-combined">
  <title>Wait for the network, the page, and an element</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-goto-waituntil-combined","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/waitUntil-test-late-element.html" scope="external" format="html">the late element page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/waitUntil-test-late-element.html","timeout":10000,"waitUntil":{"networkIdleTime":500,"domIdleTime":1000,"find":{"selector":".status","elementText":"/.*operational.*/"}}}}'/></info></step>
      <step><cmd>Check that the page shows <b>System operational</b>.</cmd>
        <info><data name="doc-detective" value='step {"find":"System operational"}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-goto-waituntil-combined",
      "steps": [
        {
          "goTo": {
            "url": "http://localhost:8092/waitUntil-test-late-element.html",
            "timeout": 10000,
            "waitUntil": {
              "networkIdleTime": 500,
              "domIdleTime": 1000,
              "find": {
                "selector": ".status",
                "elementText": "/.*operational.*/"
              }
            }
          }
        },
        {
          "find": "System operational"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-goto-waituntil-combined
    steps:
      - goTo:
          url: http://localhost:8092/waitUntil-test-late-element.html
          timeout: 10000
          waitUntil:
            networkIdleTime: 500
            domIdleTime: 1000
            find:
              selector: .status
              elementText: /.*operational.*/
      - find: System operational
```

### `timeout: 60000`

**Varies:** `goTo.timeout` · **Value:** `60000` · **Effect:** the step allows the page up to 60 seconds to load.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Give a slow page more time to load

1. Go to [the static page](http://localhost:8092/waitUntil-test-static.html).
2. Check that the page shows **Static Page**.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Give a slow page more time to load

1. Go to [the static page](http://localhost:8092/waitUntil-test-static.html).
2. Check that the page shows **Static Page**.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Give a slow page more time to load

. Go to http://localhost:8092/waitUntil-test-static.html[the static page].
. Check that the page shows *Static Page*.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Give a slow page more time to load</title></head>
<body>
<h1>Give a slow page more time to load</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/waitUntil-test-static.html">the static page</a>.</li>
  <li>Check that the page shows <strong>Static Page</strong>.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Give a slow page more time to load
==================================

#. Go to `the static page <http://localhost:8092/waitUntil-test-static.html>`_.
#. Check that the page shows **Static Page**.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-timeout">
  <title>Give a slow page more time to load</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/waitUntil-test-static.html" scope="external" format="html">the static page</xref>.</cmd></step>
      <step><cmd>Check that the page shows <b>Static Page</b>.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-goto-timeout","detectSteps":true} -->

# Give a slow page more time to load

1. Go to [the static page](http://localhost:8092/waitUntil-test-static.html).
   <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-static.html","timeout":60000}} -->
2. Check that the page shows **Static Page**.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-goto-timeout","detectSteps":true} */}

# Give a slow page more time to load

1. Go to [the static page](http://localhost:8092/waitUntil-test-static.html).
   {/* step {"goTo":{"url":"http://localhost:8092/waitUntil-test-static.html","timeout":60000}} */}
2. Check that the page shows **Static Page**.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Give a slow page more time to load

// (test {"testId":"nav-goto-timeout","detectSteps":true})

. Go to http://localhost:8092/waitUntil-test-static.html[the static page].
+
// (step {"goTo":{"url":"http://localhost:8092/waitUntil-test-static.html","timeout":60000}})
. Check that the page shows *Static Page*.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Give a slow page more time to load</title></head>
<body>
<!-- test {"testId":"nav-goto-timeout","detectSteps":true} -->
<h1>Give a slow page more time to load</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/waitUntil-test-static.html">the static page</a>.
    <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-static.html","timeout":60000}} --></li>
  <li>Check that the page shows <strong>Static Page</strong>.</li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Give a slow page more time to load
==================================

.. test {"testId":"nav-goto-timeout","detectSteps":true}

#. Go to `the static page <http://localhost:8092/waitUntil-test-static.html>`_.

   .. step {"goTo":{"url":"http://localhost:8092/waitUntil-test-static.html","timeout":60000}}

#. Check that the page shows **Static Page**.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-timeout">
  <title>Give a slow page more time to load</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-goto-timeout","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/waitUntil-test-static.html" scope="external" format="html">the static page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/waitUntil-test-static.html","timeout":60000}}'/></info></step>
      <step><cmd>Check that the page shows <b>Static Page</b>.</cmd></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-goto-timeout","detectSteps":false} -->

# Give a slow page more time to load

1. Go to [the static page](http://localhost:8092/waitUntil-test-static.html).
   <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-static.html","timeout":60000}} -->
2. Check that the page shows **Static Page**.
   <!-- step {"find":"Static Page"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-goto-timeout","detectSteps":false} */}

# Give a slow page more time to load

1. Go to [the static page](http://localhost:8092/waitUntil-test-static.html).
   {/* step {"goTo":{"url":"http://localhost:8092/waitUntil-test-static.html","timeout":60000}} */}
2. Check that the page shows **Static Page**.
   {/* step {"find":"Static Page"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Give a slow page more time to load

// (test {"testId":"nav-goto-timeout","detectSteps":false})

. Go to http://localhost:8092/waitUntil-test-static.html[the static page].
+
// (step {"goTo":{"url":"http://localhost:8092/waitUntil-test-static.html","timeout":60000}})
. Check that the page shows *Static Page*.
+
// (step {"find":"Static Page"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Give a slow page more time to load</title></head>
<body>
<!-- test {"testId":"nav-goto-timeout","detectSteps":false} -->
<h1>Give a slow page more time to load</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/waitUntil-test-static.html">the static page</a>.
    <!-- step {"goTo":{"url":"http://localhost:8092/waitUntil-test-static.html","timeout":60000}} --></li>
  <li>Check that the page shows <strong>Static Page</strong>.
    <!-- step {"find":"Static Page"} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Give a slow page more time to load
==================================

.. test {"testId":"nav-goto-timeout","detectSteps":false}

#. Go to `the static page <http://localhost:8092/waitUntil-test-static.html>`_.

   .. step {"goTo":{"url":"http://localhost:8092/waitUntil-test-static.html","timeout":60000}}

#. Check that the page shows **Static Page**.

   .. step {"find":"Static Page"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-timeout">
  <title>Give a slow page more time to load</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-goto-timeout","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/waitUntil-test-static.html" scope="external" format="html">the static page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/waitUntil-test-static.html","timeout":60000}}'/></info></step>
      <step><cmd>Check that the page shows <b>Static Page</b>.</cmd>
        <info><data name="doc-detective" value='step {"find":"Static Page"}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-goto-timeout",
      "steps": [
        {
          "goTo": {
            "url": "http://localhost:8092/waitUntil-test-static.html",
            "timeout": 60000
          }
        },
        {
          "find": "Static Page"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-goto-timeout
    steps:
      - goTo:
          url: http://localhost:8092/waitUntil-test-static.html
          timeout: 60000
      - find: Static Page
```

### `origin + url`

**Varies:** `goTo.origin` · **Value:** `"http://localhost:8092" with url "/enhanced-elements.html"` · **Effect:** the step joins `origin` and the relative `url` into the address it opens.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Open a page by its path

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Check that the page shows **Submit by ID**.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Open a page by its path

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Check that the page shows **Submit by ID**.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Open a page by its path

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
. Check that the page shows *Submit by ID*.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Open a page by its path</title></head>
<body>
<h1>Open a page by its path</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.</li>
  <li>Check that the page shows <strong>Submit by ID</strong>.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Open a page by its path
=======================

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.
#. Check that the page shows **Submit by ID**.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-origin">
  <title>Open a page by its path</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd></step>
      <step><cmd>Check that the page shows <b>Submit by ID</b>.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-goto-origin","detectSteps":true} -->

# Open a page by its path

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":{"url":"/enhanced-elements.html","origin":"http://localhost:8092"}} -->
2. Check that the page shows **Submit by ID**.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-goto-origin","detectSteps":true} */}

# Open a page by its path

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":{"url":"/enhanced-elements.html","origin":"http://localhost:8092"}} */}
2. Check that the page shows **Submit by ID**.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Open a page by its path

// (test {"testId":"nav-goto-origin","detectSteps":true})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":{"url":"/enhanced-elements.html","origin":"http://localhost:8092"}})
. Check that the page shows *Submit by ID*.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Open a page by its path</title></head>
<body>
<!-- test {"testId":"nav-goto-origin","detectSteps":true} -->
<h1>Open a page by its path</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":{"url":"/enhanced-elements.html","origin":"http://localhost:8092"}} --></li>
  <li>Check that the page shows <strong>Submit by ID</strong>.</li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Open a page by its path
=======================

.. test {"testId":"nav-goto-origin","detectSteps":true}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":{"url":"/enhanced-elements.html","origin":"http://localhost:8092"}}

#. Check that the page shows **Submit by ID**.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-origin">
  <title>Open a page by its path</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-goto-origin","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"/enhanced-elements.html","origin":"http://localhost:8092"}}'/></info></step>
      <step><cmd>Check that the page shows <b>Submit by ID</b>.</cmd></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-goto-origin","detectSteps":false} -->

# Open a page by its path

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":{"url":"/enhanced-elements.html","origin":"http://localhost:8092"}} -->
2. Check that the page shows **Submit by ID**.
   <!-- step {"find":"Submit by ID"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-goto-origin","detectSteps":false} */}

# Open a page by its path

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":{"url":"/enhanced-elements.html","origin":"http://localhost:8092"}} */}
2. Check that the page shows **Submit by ID**.
   {/* step {"find":"Submit by ID"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Open a page by its path

// (test {"testId":"nav-goto-origin","detectSteps":false})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":{"url":"/enhanced-elements.html","origin":"http://localhost:8092"}})
. Check that the page shows *Submit by ID*.
+
// (step {"find":"Submit by ID"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Open a page by its path</title></head>
<body>
<!-- test {"testId":"nav-goto-origin","detectSteps":false} -->
<h1>Open a page by its path</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":{"url":"/enhanced-elements.html","origin":"http://localhost:8092"}} --></li>
  <li>Check that the page shows <strong>Submit by ID</strong>.
    <!-- step {"find":"Submit by ID"} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Open a page by its path
=======================

.. test {"testId":"nav-goto-origin","detectSteps":false}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":{"url":"/enhanced-elements.html","origin":"http://localhost:8092"}}

#. Check that the page shows **Submit by ID**.

   .. step {"find":"Submit by ID"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-origin">
  <title>Open a page by its path</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-goto-origin","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"/enhanced-elements.html","origin":"http://localhost:8092"}}'/></info></step>
      <step><cmd>Check that the page shows <b>Submit by ID</b>.</cmd>
        <info><data name="doc-detective" value='step {"find":"Submit by ID"}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-goto-origin",
      "steps": [
        {
          "goTo": {
            "url": "/enhanced-elements.html",
            "origin": "http://localhost:8092"
          }
        },
        {
          "find": "Submit by ID"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-goto-origin
    steps:
      - goTo:
          url: /enhanced-elements.html
          origin: http://localhost:8092
      - find: Submit by ID
```

### `newTab: true`

**Varies:** `goTo.newTab` · **Value:** `true` · **Effect:** the step opens the page in a new tab and makes it the active tab.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Open a page in a new tab

1. Go to [the multi-tab page](http://localhost:8092/multi-tab.html).
2. Open [the child page](http://localhost:8092/multi-tab-child.html?page=docs) in a new tab.
3. Check that the new tab shows **PAGE docs**.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Open a page in a new tab

1. Go to [the multi-tab page](http://localhost:8092/multi-tab.html).
2. Open [the child page](http://localhost:8092/multi-tab-child.html?page=docs) in a new tab.
3. Check that the new tab shows **PAGE docs**.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Open a page in a new tab

. Go to http://localhost:8092/multi-tab.html[the multi-tab page].
. Open http://localhost:8092/multi-tab-child.html?page=docs[the child page] in a new tab.
. Check that the new tab shows *PAGE docs*.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Open a page in a new tab</title></head>
<body>
<h1>Open a page in a new tab</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/multi-tab.html">the multi-tab page</a>.</li>
  <li>Open <a href="http://localhost:8092/multi-tab-child.html?page=docs">the child page</a> in a new tab.</li>
  <li>Check that the new tab shows <strong>PAGE docs</strong>.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Open a page in a new tab
========================

#. Go to `the multi-tab page <http://localhost:8092/multi-tab.html>`_.
#. Open `the child page <http://localhost:8092/multi-tab-child.html?page=docs>`_ in a new tab.
#. Check that the new tab shows **PAGE docs**.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-newtab">
  <title>Open a page in a new tab</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/multi-tab.html" scope="external" format="html">the multi-tab page</xref>.</cmd></step>
      <step><cmd>Open <xref href="http://localhost:8092/multi-tab-child.html?page=docs" scope="external" format="html">the child page</xref> in a new tab.</cmd></step>
      <step><cmd>Check that the new tab shows <b>PAGE docs</b>.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-goto-newtab","detectSteps":true} -->

# Open a page in a new tab

1. Go to [the multi-tab page](http://localhost:8092/multi-tab.html).
   <!-- step {"goTo":"http://localhost:8092/multi-tab.html"} -->
2. Open [the child page](http://localhost:8092/multi-tab-child.html?page=docs) in a new tab.
   <!-- step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=docs","newTab":true}} -->
3. Check that the new tab shows **PAGE docs**.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-goto-newtab","detectSteps":true} */}

# Open a page in a new tab

1. Go to [the multi-tab page](http://localhost:8092/multi-tab.html).
   {/* step {"goTo":"http://localhost:8092/multi-tab.html"} */}
2. Open [the child page](http://localhost:8092/multi-tab-child.html?page=docs) in a new tab.
   {/* step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=docs","newTab":true}} */}
3. Check that the new tab shows **PAGE docs**.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Open a page in a new tab

// (test {"testId":"nav-goto-newtab","detectSteps":true})

. Go to http://localhost:8092/multi-tab.html[the multi-tab page].
+
// (step {"goTo":"http://localhost:8092/multi-tab.html"})
. Open http://localhost:8092/multi-tab-child.html?page=docs[the child page] in a new tab.
+
// (step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=docs","newTab":true}})
. Check that the new tab shows *PAGE docs*.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Open a page in a new tab</title></head>
<body>
<!-- test {"testId":"nav-goto-newtab","detectSteps":true} -->
<h1>Open a page in a new tab</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/multi-tab.html">the multi-tab page</a>.
    <!-- step {"goTo":"http://localhost:8092/multi-tab.html"} --></li>
  <li>Open <a href="http://localhost:8092/multi-tab-child.html?page=docs">the child page</a> in a new tab.
    <!-- step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=docs","newTab":true}} --></li>
  <li>Check that the new tab shows <strong>PAGE docs</strong>.</li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Open a page in a new tab
========================

.. test {"testId":"nav-goto-newtab","detectSteps":true}

#. Go to `the multi-tab page <http://localhost:8092/multi-tab.html>`_.

   .. step {"goTo":"http://localhost:8092/multi-tab.html"}

#. Open `the child page <http://localhost:8092/multi-tab-child.html?page=docs>`_ in a new tab.

   .. step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=docs","newTab":true}}

#. Check that the new tab shows **PAGE docs**.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-newtab">
  <title>Open a page in a new tab</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-goto-newtab","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/multi-tab.html" scope="external" format="html">the multi-tab page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/multi-tab.html"}'/></info></step>
      <step><cmd>Open <xref href="http://localhost:8092/multi-tab-child.html?page=docs" scope="external" format="html">the child page</xref> in a new tab.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=docs","newTab":true}}'/></info></step>
      <step><cmd>Check that the new tab shows <b>PAGE docs</b>.</cmd></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-goto-newtab","detectSteps":false} -->

# Open a page in a new tab

1. Go to [the multi-tab page](http://localhost:8092/multi-tab.html).
   <!-- step {"goTo":"http://localhost:8092/multi-tab.html"} -->
2. Open [the child page](http://localhost:8092/multi-tab-child.html?page=docs) in a new tab.
   <!-- step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=docs","newTab":true}} -->
3. Check that the new tab shows **PAGE docs**.
   <!-- step {"find":"PAGE docs"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-goto-newtab","detectSteps":false} */}

# Open a page in a new tab

1. Go to [the multi-tab page](http://localhost:8092/multi-tab.html).
   {/* step {"goTo":"http://localhost:8092/multi-tab.html"} */}
2. Open [the child page](http://localhost:8092/multi-tab-child.html?page=docs) in a new tab.
   {/* step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=docs","newTab":true}} */}
3. Check that the new tab shows **PAGE docs**.
   {/* step {"find":"PAGE docs"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Open a page in a new tab

// (test {"testId":"nav-goto-newtab","detectSteps":false})

. Go to http://localhost:8092/multi-tab.html[the multi-tab page].
+
// (step {"goTo":"http://localhost:8092/multi-tab.html"})
. Open http://localhost:8092/multi-tab-child.html?page=docs[the child page] in a new tab.
+
// (step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=docs","newTab":true}})
. Check that the new tab shows *PAGE docs*.
+
// (step {"find":"PAGE docs"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Open a page in a new tab</title></head>
<body>
<!-- test {"testId":"nav-goto-newtab","detectSteps":false} -->
<h1>Open a page in a new tab</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/multi-tab.html">the multi-tab page</a>.
    <!-- step {"goTo":"http://localhost:8092/multi-tab.html"} --></li>
  <li>Open <a href="http://localhost:8092/multi-tab-child.html?page=docs">the child page</a> in a new tab.
    <!-- step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=docs","newTab":true}} --></li>
  <li>Check that the new tab shows <strong>PAGE docs</strong>.
    <!-- step {"find":"PAGE docs"} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Open a page in a new tab
========================

.. test {"testId":"nav-goto-newtab","detectSteps":false}

#. Go to `the multi-tab page <http://localhost:8092/multi-tab.html>`_.

   .. step {"goTo":"http://localhost:8092/multi-tab.html"}

#. Open `the child page <http://localhost:8092/multi-tab-child.html?page=docs>`_ in a new tab.

   .. step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=docs","newTab":true}}

#. Check that the new tab shows **PAGE docs**.

   .. step {"find":"PAGE docs"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-newtab">
  <title>Open a page in a new tab</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-goto-newtab","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/multi-tab.html" scope="external" format="html">the multi-tab page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/multi-tab.html"}'/></info></step>
      <step><cmd>Open <xref href="http://localhost:8092/multi-tab-child.html?page=docs" scope="external" format="html">the child page</xref> in a new tab.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=docs","newTab":true}}'/></info></step>
      <step><cmd>Check that the new tab shows <b>PAGE docs</b>.</cmd>
        <info><data name="doc-detective" value='step {"find":"PAGE docs"}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-goto-newtab",
      "steps": [
        {
          "goTo": "http://localhost:8092/multi-tab.html"
        },
        {
          "goTo": {
            "url": "http://localhost:8092/multi-tab-child.html?page=docs",
            "newTab": true
          }
        },
        {
          "find": "PAGE docs"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-goto-newtab
    steps:
      - goTo: http://localhost:8092/multi-tab.html
      - goTo:
          url: http://localhost:8092/multi-tab-child.html?page=docs
          newTab: true
      - find: PAGE docs
```

### `newWindow: true`

**Varies:** `goTo.newWindow` · **Value:** `true` · **Effect:** the step opens the page in a new window and makes it the active window.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Open a page in a new window

1. Go to [the multi-tab page](http://localhost:8092/multi-tab.html).
2. Open [the child page](http://localhost:8092/multi-tab-child.html?page=w1) in a new window.
3. Check that the new window shows **PAGE w1**.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Open a page in a new window

1. Go to [the multi-tab page](http://localhost:8092/multi-tab.html).
2. Open [the child page](http://localhost:8092/multi-tab-child.html?page=w1) in a new window.
3. Check that the new window shows **PAGE w1**.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Open a page in a new window

. Go to http://localhost:8092/multi-tab.html[the multi-tab page].
. Open http://localhost:8092/multi-tab-child.html?page=w1[the child page] in a new window.
. Check that the new window shows *PAGE w1*.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Open a page in a new window</title></head>
<body>
<h1>Open a page in a new window</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/multi-tab.html">the multi-tab page</a>.</li>
  <li>Open <a href="http://localhost:8092/multi-tab-child.html?page=w1">the child page</a> in a new window.</li>
  <li>Check that the new window shows <strong>PAGE w1</strong>.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Open a page in a new window
===========================

#. Go to `the multi-tab page <http://localhost:8092/multi-tab.html>`_.
#. Open `the child page <http://localhost:8092/multi-tab-child.html?page=w1>`_ in a new window.
#. Check that the new window shows **PAGE w1**.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-newwindow">
  <title>Open a page in a new window</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/multi-tab.html" scope="external" format="html">the multi-tab page</xref>.</cmd></step>
      <step><cmd>Open <xref href="http://localhost:8092/multi-tab-child.html?page=w1" scope="external" format="html">the child page</xref> in a new window.</cmd></step>
      <step><cmd>Check that the new window shows <b>PAGE w1</b>.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-goto-newwindow","detectSteps":true} -->

# Open a page in a new window

1. Go to [the multi-tab page](http://localhost:8092/multi-tab.html).
   <!-- step {"goTo":"http://localhost:8092/multi-tab.html"} -->
2. Open [the child page](http://localhost:8092/multi-tab-child.html?page=w1) in a new window.
   <!-- step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=w1","newWindow":true}} -->
3. Check that the new window shows **PAGE w1**.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-goto-newwindow","detectSteps":true} */}

# Open a page in a new window

1. Go to [the multi-tab page](http://localhost:8092/multi-tab.html).
   {/* step {"goTo":"http://localhost:8092/multi-tab.html"} */}
2. Open [the child page](http://localhost:8092/multi-tab-child.html?page=w1) in a new window.
   {/* step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=w1","newWindow":true}} */}
3. Check that the new window shows **PAGE w1**.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Open a page in a new window

// (test {"testId":"nav-goto-newwindow","detectSteps":true})

. Go to http://localhost:8092/multi-tab.html[the multi-tab page].
+
// (step {"goTo":"http://localhost:8092/multi-tab.html"})
. Open http://localhost:8092/multi-tab-child.html?page=w1[the child page] in a new window.
+
// (step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=w1","newWindow":true}})
. Check that the new window shows *PAGE w1*.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Open a page in a new window</title></head>
<body>
<!-- test {"testId":"nav-goto-newwindow","detectSteps":true} -->
<h1>Open a page in a new window</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/multi-tab.html">the multi-tab page</a>.
    <!-- step {"goTo":"http://localhost:8092/multi-tab.html"} --></li>
  <li>Open <a href="http://localhost:8092/multi-tab-child.html?page=w1">the child page</a> in a new window.
    <!-- step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=w1","newWindow":true}} --></li>
  <li>Check that the new window shows <strong>PAGE w1</strong>.</li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Open a page in a new window
===========================

.. test {"testId":"nav-goto-newwindow","detectSteps":true}

#. Go to `the multi-tab page <http://localhost:8092/multi-tab.html>`_.

   .. step {"goTo":"http://localhost:8092/multi-tab.html"}

#. Open `the child page <http://localhost:8092/multi-tab-child.html?page=w1>`_ in a new window.

   .. step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=w1","newWindow":true}}

#. Check that the new window shows **PAGE w1**.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-newwindow">
  <title>Open a page in a new window</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-goto-newwindow","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/multi-tab.html" scope="external" format="html">the multi-tab page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/multi-tab.html"}'/></info></step>
      <step><cmd>Open <xref href="http://localhost:8092/multi-tab-child.html?page=w1" scope="external" format="html">the child page</xref> in a new window.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=w1","newWindow":true}}'/></info></step>
      <step><cmd>Check that the new window shows <b>PAGE w1</b>.</cmd></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-goto-newwindow","detectSteps":false} -->

# Open a page in a new window

1. Go to [the multi-tab page](http://localhost:8092/multi-tab.html).
   <!-- step {"goTo":"http://localhost:8092/multi-tab.html"} -->
2. Open [the child page](http://localhost:8092/multi-tab-child.html?page=w1) in a new window.
   <!-- step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=w1","newWindow":true}} -->
3. Check that the new window shows **PAGE w1**.
   <!-- step {"find":"PAGE w1"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-goto-newwindow","detectSteps":false} */}

# Open a page in a new window

1. Go to [the multi-tab page](http://localhost:8092/multi-tab.html).
   {/* step {"goTo":"http://localhost:8092/multi-tab.html"} */}
2. Open [the child page](http://localhost:8092/multi-tab-child.html?page=w1) in a new window.
   {/* step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=w1","newWindow":true}} */}
3. Check that the new window shows **PAGE w1**.
   {/* step {"find":"PAGE w1"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Open a page in a new window

// (test {"testId":"nav-goto-newwindow","detectSteps":false})

. Go to http://localhost:8092/multi-tab.html[the multi-tab page].
+
// (step {"goTo":"http://localhost:8092/multi-tab.html"})
. Open http://localhost:8092/multi-tab-child.html?page=w1[the child page] in a new window.
+
// (step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=w1","newWindow":true}})
. Check that the new window shows *PAGE w1*.
+
// (step {"find":"PAGE w1"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Open a page in a new window</title></head>
<body>
<!-- test {"testId":"nav-goto-newwindow","detectSteps":false} -->
<h1>Open a page in a new window</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/multi-tab.html">the multi-tab page</a>.
    <!-- step {"goTo":"http://localhost:8092/multi-tab.html"} --></li>
  <li>Open <a href="http://localhost:8092/multi-tab-child.html?page=w1">the child page</a> in a new window.
    <!-- step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=w1","newWindow":true}} --></li>
  <li>Check that the new window shows <strong>PAGE w1</strong>.
    <!-- step {"find":"PAGE w1"} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Open a page in a new window
===========================

.. test {"testId":"nav-goto-newwindow","detectSteps":false}

#. Go to `the multi-tab page <http://localhost:8092/multi-tab.html>`_.

   .. step {"goTo":"http://localhost:8092/multi-tab.html"}

#. Open `the child page <http://localhost:8092/multi-tab-child.html?page=w1>`_ in a new window.

   .. step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=w1","newWindow":true}}

#. Check that the new window shows **PAGE w1**.

   .. step {"find":"PAGE w1"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-goto-newwindow">
  <title>Open a page in a new window</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-goto-newwindow","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/multi-tab.html" scope="external" format="html">the multi-tab page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/multi-tab.html"}'/></info></step>
      <step><cmd>Open <xref href="http://localhost:8092/multi-tab-child.html?page=w1" scope="external" format="html">the child page</xref> in a new window.</cmd>
        <info><data name="doc-detective" value='step {"goTo":{"url":"http://localhost:8092/multi-tab-child.html?page=w1","newWindow":true}}'/></info></step>
      <step><cmd>Check that the new window shows <b>PAGE w1</b>.</cmd>
        <info><data name="doc-detective" value='step {"find":"PAGE w1"}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-goto-newwindow",
      "steps": [
        {
          "goTo": "http://localhost:8092/multi-tab.html"
        },
        {
          "goTo": {
            "url": "http://localhost:8092/multi-tab-child.html?page=w1",
            "newWindow": true
          }
        },
        {
          "find": "PAGE w1"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-goto-newwindow
    steps:
      - goTo: http://localhost:8092/multi-tab.html
      - goTo:
          url: http://localhost:8092/multi-tab-child.html?page=w1
          newWindow: true
      - find: PAGE w1
```

## `find` locator permutations

Each example finds one element with one locator field of [`find`](/docs/actions/find). For every field, see the [`find` schema](/reference/schemas/find).

### `selector`

**Varies:** `find.selector` · **Value:** `"#submit-button"` · **Effect:** the step finds the element that matches the CSS selector.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Find an element by its selector

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Submit by ID** button.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Find an element by its selector

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Submit by ID** button.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Find an element by its selector

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
. Find the *Submit by ID* button.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by its selector</title></head>
<body>
<h1>Find an element by its selector</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.</li>
  <li>Find the <strong>Submit by ID</strong> button.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Find an element by its selector
===============================

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.
#. Find the **Submit by ID** button.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-selector">
  <title>Find an element by its selector</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd></step>
      <step><cmd>Find the <b>Submit by ID</b> button.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-find-selector","detectSteps":true} -->

# Find an element by its selector

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Submit by ID** button.
   <!-- step {"find":{"selector":"#submit-button"}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-find-selector","detectSteps":true} */}

# Find an element by its selector

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Submit by ID** button.
   {/* step {"find":{"selector":"#submit-button"}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Find an element by its selector

// (test {"testId":"nav-find-selector","detectSteps":true})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Submit by ID* button.
+
// (step {"find":{"selector":"#submit-button"}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by its selector</title></head>
<body>
<!-- test {"testId":"nav-find-selector","detectSteps":true} -->
<h1>Find an element by its selector</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Submit by ID</strong> button.
    <!-- step {"find":{"selector":"#submit-button"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Find an element by its selector
===============================

.. test {"testId":"nav-find-selector","detectSteps":true}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Submit by ID** button.

   .. step {"find":{"selector":"#submit-button"}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-selector">
  <title>Find an element by its selector</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-selector","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Submit by ID</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"selector":"#submit-button"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-find-selector","detectSteps":false} -->

# Find an element by its selector

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Submit by ID** button.
   <!-- step {"find":{"selector":"#submit-button"}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-find-selector","detectSteps":false} */}

# Find an element by its selector

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Submit by ID** button.
   {/* step {"find":{"selector":"#submit-button"}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Find an element by its selector

// (test {"testId":"nav-find-selector","detectSteps":false})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Submit by ID* button.
+
// (step {"find":{"selector":"#submit-button"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by its selector</title></head>
<body>
<!-- test {"testId":"nav-find-selector","detectSteps":false} -->
<h1>Find an element by its selector</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Submit by ID</strong> button.
    <!-- step {"find":{"selector":"#submit-button"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Find an element by its selector
===============================

.. test {"testId":"nav-find-selector","detectSteps":false}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Submit by ID** button.

   .. step {"find":{"selector":"#submit-button"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-selector">
  <title>Find an element by its selector</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-selector","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Submit by ID</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"selector":"#submit-button"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-find-selector",
      "steps": [
        {
          "goTo": "http://localhost:8092/enhanced-elements.html"
        },
        {
          "find": {
            "selector": "#submit-button"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-find-selector
    steps:
      - goTo: http://localhost:8092/enhanced-elements.html
      - find:
          selector: "#submit-button"
```

### `elementText: "Submit Order"`

**Varies:** `find.elementText` · **Value:** `"Submit Order"` · **Effect:** the step finds the element whose whole visible text is `Submit Order`.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Find an element by its text

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Submit Order** button.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Find an element by its text

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Submit Order** button.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Find an element by its text

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
. Find the *Submit Order* button.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by its text</title></head>
<body>
<h1>Find an element by its text</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.</li>
  <li>Find the <strong>Submit Order</strong> button.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Find an element by its text
===========================

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.
#. Find the **Submit Order** button.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementtext-string">
  <title>Find an element by its text</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd></step>
      <step><cmd>Find the <b>Submit Order</b> button.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-find-elementtext-string","detectSteps":true} -->

# Find an element by its text

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Submit Order** button.
   <!-- step {"find":{"elementText":"Submit Order"}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-find-elementtext-string","detectSteps":true} */}

# Find an element by its text

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Submit Order** button.
   {/* step {"find":{"elementText":"Submit Order"}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Find an element by its text

// (test {"testId":"nav-find-elementtext-string","detectSteps":true})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Submit Order* button.
+
// (step {"find":{"elementText":"Submit Order"}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by its text</title></head>
<body>
<!-- test {"testId":"nav-find-elementtext-string","detectSteps":true} -->
<h1>Find an element by its text</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Submit Order</strong> button.
    <!-- step {"find":{"elementText":"Submit Order"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Find an element by its text
===========================

.. test {"testId":"nav-find-elementtext-string","detectSteps":true}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Submit Order** button.

   .. step {"find":{"elementText":"Submit Order"}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementtext-string">
  <title>Find an element by its text</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementtext-string","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Submit Order</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementText":"Submit Order"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-find-elementtext-string","detectSteps":false} -->

# Find an element by its text

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Submit Order** button.
   <!-- step {"find":{"elementText":"Submit Order"}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-find-elementtext-string","detectSteps":false} */}

# Find an element by its text

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Submit Order** button.
   {/* step {"find":{"elementText":"Submit Order"}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Find an element by its text

// (test {"testId":"nav-find-elementtext-string","detectSteps":false})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Submit Order* button.
+
// (step {"find":{"elementText":"Submit Order"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by its text</title></head>
<body>
<!-- test {"testId":"nav-find-elementtext-string","detectSteps":false} -->
<h1>Find an element by its text</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Submit Order</strong> button.
    <!-- step {"find":{"elementText":"Submit Order"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Find an element by its text
===========================

.. test {"testId":"nav-find-elementtext-string","detectSteps":false}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Submit Order** button.

   .. step {"find":{"elementText":"Submit Order"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementtext-string">
  <title>Find an element by its text</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementtext-string","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Submit Order</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementText":"Submit Order"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-find-elementtext-string",
      "steps": [
        {
          "goTo": "http://localhost:8092/enhanced-elements.html"
        },
        {
          "find": {
            "elementText": "Submit Order"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-find-elementtext-string
    steps:
      - goTo: http://localhost:8092/enhanced-elements.html
      - find:
          elementText: Submit Order
```

### `elementText: "/^Submit Pri/"`

**Varies:** `find.elementText` · **Value:** `"/^Submit Pri/"` · **Effect:** the step finds the first element whose visible text matches the regular expression.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Find an element by a text pattern

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Submit Primary** button.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Find an element by a text pattern

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Submit Primary** button.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Find an element by a text pattern

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
. Find the *Submit Primary* button.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by a text pattern</title></head>
<body>
<h1>Find an element by a text pattern</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.</li>
  <li>Find the <strong>Submit Primary</strong> button.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Find an element by a text pattern
=================================

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.
#. Find the **Submit Primary** button.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementtext-regex">
  <title>Find an element by a text pattern</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd></step>
      <step><cmd>Find the <b>Submit Primary</b> button.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-find-elementtext-regex","detectSteps":true} -->

# Find an element by a text pattern

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Submit Primary** button.
   <!-- step {"find":{"elementText":"/^Submit Pri/"}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-find-elementtext-regex","detectSteps":true} */}

# Find an element by a text pattern

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Submit Primary** button.
   {/* step {"find":{"elementText":"/^Submit Pri/"}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Find an element by a text pattern

// (test {"testId":"nav-find-elementtext-regex","detectSteps":true})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Submit Primary* button.
+
// (step {"find":{"elementText":"/^Submit Pri/"}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by a text pattern</title></head>
<body>
<!-- test {"testId":"nav-find-elementtext-regex","detectSteps":true} -->
<h1>Find an element by a text pattern</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Submit Primary</strong> button.
    <!-- step {"find":{"elementText":"/^Submit Pri/"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Find an element by a text pattern
=================================

.. test {"testId":"nav-find-elementtext-regex","detectSteps":true}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Submit Primary** button.

   .. step {"find":{"elementText":"/^Submit Pri/"}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementtext-regex">
  <title>Find an element by a text pattern</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementtext-regex","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Submit Primary</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementText":"/^Submit Pri/"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-find-elementtext-regex","detectSteps":false} -->

# Find an element by a text pattern

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Submit Primary** button.
   <!-- step {"find":{"elementText":"/^Submit Pri/"}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-find-elementtext-regex","detectSteps":false} */}

# Find an element by a text pattern

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Submit Primary** button.
   {/* step {"find":{"elementText":"/^Submit Pri/"}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Find an element by a text pattern

// (test {"testId":"nav-find-elementtext-regex","detectSteps":false})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Submit Primary* button.
+
// (step {"find":{"elementText":"/^Submit Pri/"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by a text pattern</title></head>
<body>
<!-- test {"testId":"nav-find-elementtext-regex","detectSteps":false} -->
<h1>Find an element by a text pattern</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Submit Primary</strong> button.
    <!-- step {"find":{"elementText":"/^Submit Pri/"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Find an element by a text pattern
=================================

.. test {"testId":"nav-find-elementtext-regex","detectSteps":false}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Submit Primary** button.

   .. step {"find":{"elementText":"/^Submit Pri/"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementtext-regex">
  <title>Find an element by a text pattern</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementtext-regex","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Submit Primary</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementText":"/^Submit Pri/"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-find-elementtext-regex",
      "steps": [
        {
          "goTo": "http://localhost:8092/enhanced-elements.html"
        },
        {
          "find": {
            "elementText": "/^Submit Pri/"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-find-elementtext-regex
    steps:
      - goTo: http://localhost:8092/enhanced-elements.html
      - find:
          elementText: /^Submit Pri/
```

### `elementId`

**Varies:** `find.elementId` · **Value:** `"submit-button"` · **Effect:** the step finds the element with that `id` attribute.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Find an element by its ID

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Submit by ID** button.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Find an element by its ID

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Submit by ID** button.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Find an element by its ID

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
. Find the *Submit by ID* button.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by its ID</title></head>
<body>
<h1>Find an element by its ID</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.</li>
  <li>Find the <strong>Submit by ID</strong> button.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Find an element by its ID
=========================

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.
#. Find the **Submit by ID** button.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementid">
  <title>Find an element by its ID</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd></step>
      <step><cmd>Find the <b>Submit by ID</b> button.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-find-elementid","detectSteps":true} -->

# Find an element by its ID

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Submit by ID** button.
   <!-- step {"find":{"elementId":"submit-button"}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-find-elementid","detectSteps":true} */}

# Find an element by its ID

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Submit by ID** button.
   {/* step {"find":{"elementId":"submit-button"}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Find an element by its ID

// (test {"testId":"nav-find-elementid","detectSteps":true})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Submit by ID* button.
+
// (step {"find":{"elementId":"submit-button"}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by its ID</title></head>
<body>
<!-- test {"testId":"nav-find-elementid","detectSteps":true} -->
<h1>Find an element by its ID</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Submit by ID</strong> button.
    <!-- step {"find":{"elementId":"submit-button"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Find an element by its ID
=========================

.. test {"testId":"nav-find-elementid","detectSteps":true}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Submit by ID** button.

   .. step {"find":{"elementId":"submit-button"}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementid">
  <title>Find an element by its ID</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementid","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Submit by ID</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementId":"submit-button"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-find-elementid","detectSteps":false} -->

# Find an element by its ID

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Submit by ID** button.
   <!-- step {"find":{"elementId":"submit-button"}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-find-elementid","detectSteps":false} */}

# Find an element by its ID

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Submit by ID** button.
   {/* step {"find":{"elementId":"submit-button"}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Find an element by its ID

// (test {"testId":"nav-find-elementid","detectSteps":false})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Submit by ID* button.
+
// (step {"find":{"elementId":"submit-button"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by its ID</title></head>
<body>
<!-- test {"testId":"nav-find-elementid","detectSteps":false} -->
<h1>Find an element by its ID</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Submit by ID</strong> button.
    <!-- step {"find":{"elementId":"submit-button"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Find an element by its ID
=========================

.. test {"testId":"nav-find-elementid","detectSteps":false}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Submit by ID** button.

   .. step {"find":{"elementId":"submit-button"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementid">
  <title>Find an element by its ID</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementid","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Submit by ID</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementId":"submit-button"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-find-elementid",
      "steps": [
        {
          "goTo": "http://localhost:8092/enhanced-elements.html"
        },
        {
          "find": {
            "elementId": "submit-button"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-find-elementid
    steps:
      - goTo: http://localhost:8092/enhanced-elements.html
      - find:
          elementId: submit-button
```

### `elementTestId`

**Varies:** `find.elementTestId` · **Value:** `"login-form-submit"` · **Effect:** the step finds the element with that `data-testid` attribute.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Find an element by its test ID

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Login Submit** button.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Find an element by its test ID

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Login Submit** button.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Find an element by its test ID

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
. Find the *Login Submit* button.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by its test ID</title></head>
<body>
<h1>Find an element by its test ID</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.</li>
  <li>Find the <strong>Login Submit</strong> button.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Find an element by its test ID
==============================

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.
#. Find the **Login Submit** button.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementtestid">
  <title>Find an element by its test ID</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd></step>
      <step><cmd>Find the <b>Login Submit</b> button.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-find-elementtestid","detectSteps":true} -->

# Find an element by its test ID

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Login Submit** button.
   <!-- step {"find":{"elementTestId":"login-form-submit"}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-find-elementtestid","detectSteps":true} */}

# Find an element by its test ID

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Login Submit** button.
   {/* step {"find":{"elementTestId":"login-form-submit"}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Find an element by its test ID

// (test {"testId":"nav-find-elementtestid","detectSteps":true})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Login Submit* button.
+
// (step {"find":{"elementTestId":"login-form-submit"}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by its test ID</title></head>
<body>
<!-- test {"testId":"nav-find-elementtestid","detectSteps":true} -->
<h1>Find an element by its test ID</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Login Submit</strong> button.
    <!-- step {"find":{"elementTestId":"login-form-submit"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Find an element by its test ID
==============================

.. test {"testId":"nav-find-elementtestid","detectSteps":true}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Login Submit** button.

   .. step {"find":{"elementTestId":"login-form-submit"}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementtestid">
  <title>Find an element by its test ID</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementtestid","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Login Submit</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementTestId":"login-form-submit"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-find-elementtestid","detectSteps":false} -->

# Find an element by its test ID

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Login Submit** button.
   <!-- step {"find":{"elementTestId":"login-form-submit"}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-find-elementtestid","detectSteps":false} */}

# Find an element by its test ID

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Login Submit** button.
   {/* step {"find":{"elementTestId":"login-form-submit"}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Find an element by its test ID

// (test {"testId":"nav-find-elementtestid","detectSteps":false})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Login Submit* button.
+
// (step {"find":{"elementTestId":"login-form-submit"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by its test ID</title></head>
<body>
<!-- test {"testId":"nav-find-elementtestid","detectSteps":false} -->
<h1>Find an element by its test ID</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Login Submit</strong> button.
    <!-- step {"find":{"elementTestId":"login-form-submit"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Find an element by its test ID
==============================

.. test {"testId":"nav-find-elementtestid","detectSteps":false}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Login Submit** button.

   .. step {"find":{"elementTestId":"login-form-submit"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementtestid">
  <title>Find an element by its test ID</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementtestid","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Login Submit</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementTestId":"login-form-submit"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-find-elementtestid",
      "steps": [
        {
          "goTo": "http://localhost:8092/enhanced-elements.html"
        },
        {
          "find": {
            "elementTestId": "login-form-submit"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-find-elementtestid
    steps:
      - goTo: http://localhost:8092/enhanced-elements.html
      - find:
          elementTestId: login-form-submit
```

### `elementAria`

**Varies:** `find.elementAria` · **Value:** `"Save document button"` · **Effect:** the step finds the element with that accessible name.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Find an element by its accessible name

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Save** button.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Find an element by its accessible name

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Save** button.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Find an element by its accessible name

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
. Find the *Save* button.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by its accessible name</title></head>
<body>
<h1>Find an element by its accessible name</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.</li>
  <li>Find the <strong>Save</strong> button.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Find an element by its accessible name
======================================

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.
#. Find the **Save** button.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementaria">
  <title>Find an element by its accessible name</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd></step>
      <step><cmd>Find the <b>Save</b> button.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-find-elementaria","detectSteps":true} -->

# Find an element by its accessible name

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Save** button.
   <!-- step {"find":{"elementAria":"Save document button"}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-find-elementaria","detectSteps":true} */}

# Find an element by its accessible name

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Save** button.
   {/* step {"find":{"elementAria":"Save document button"}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Find an element by its accessible name

// (test {"testId":"nav-find-elementaria","detectSteps":true})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Save* button.
+
// (step {"find":{"elementAria":"Save document button"}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by its accessible name</title></head>
<body>
<!-- test {"testId":"nav-find-elementaria","detectSteps":true} -->
<h1>Find an element by its accessible name</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Save</strong> button.
    <!-- step {"find":{"elementAria":"Save document button"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Find an element by its accessible name
======================================

.. test {"testId":"nav-find-elementaria","detectSteps":true}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Save** button.

   .. step {"find":{"elementAria":"Save document button"}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementaria">
  <title>Find an element by its accessible name</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementaria","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Save</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementAria":"Save document button"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-find-elementaria","detectSteps":false} -->

# Find an element by its accessible name

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Save** button.
   <!-- step {"find":{"elementAria":"Save document button"}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-find-elementaria","detectSteps":false} */}

# Find an element by its accessible name

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Save** button.
   {/* step {"find":{"elementAria":"Save document button"}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Find an element by its accessible name

// (test {"testId":"nav-find-elementaria","detectSteps":false})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Save* button.
+
// (step {"find":{"elementAria":"Save document button"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by its accessible name</title></head>
<body>
<!-- test {"testId":"nav-find-elementaria","detectSteps":false} -->
<h1>Find an element by its accessible name</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Save</strong> button.
    <!-- step {"find":{"elementAria":"Save document button"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Find an element by its accessible name
======================================

.. test {"testId":"nav-find-elementaria","detectSteps":false}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Save** button.

   .. step {"find":{"elementAria":"Save document button"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementaria">
  <title>Find an element by its accessible name</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementaria","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Save</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementAria":"Save document button"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-find-elementaria",
      "steps": [
        {
          "goTo": "http://localhost:8092/enhanced-elements.html"
        },
        {
          "find": {
            "elementAria": "Save document button"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-find-elementaria
    steps:
      - goTo: http://localhost:8092/enhanced-elements.html
      - find:
          elementAria: Save document button
```

### `elementClass: "btn-large"`

**Varies:** `find.elementClass` · **Value:** `"btn-large"` · **Effect:** the step finds the first element that has the class.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Find an element by one class

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Login Submit** button.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Find an element by one class

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Login Submit** button.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Find an element by one class

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
. Find the *Login Submit* button.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by one class</title></head>
<body>
<h1>Find an element by one class</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.</li>
  <li>Find the <strong>Login Submit</strong> button.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Find an element by one class
============================

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.
#. Find the **Login Submit** button.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementclass-string">
  <title>Find an element by one class</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd></step>
      <step><cmd>Find the <b>Login Submit</b> button.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-find-elementclass-string","detectSteps":true} -->

# Find an element by one class

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Login Submit** button.
   <!-- step {"find":{"elementClass":"btn-large"}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-find-elementclass-string","detectSteps":true} */}

# Find an element by one class

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Login Submit** button.
   {/* step {"find":{"elementClass":"btn-large"}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Find an element by one class

// (test {"testId":"nav-find-elementclass-string","detectSteps":true})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Login Submit* button.
+
// (step {"find":{"elementClass":"btn-large"}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by one class</title></head>
<body>
<!-- test {"testId":"nav-find-elementclass-string","detectSteps":true} -->
<h1>Find an element by one class</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Login Submit</strong> button.
    <!-- step {"find":{"elementClass":"btn-large"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Find an element by one class
============================

.. test {"testId":"nav-find-elementclass-string","detectSteps":true}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Login Submit** button.

   .. step {"find":{"elementClass":"btn-large"}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementclass-string">
  <title>Find an element by one class</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementclass-string","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Login Submit</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementClass":"btn-large"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-find-elementclass-string","detectSteps":false} -->

# Find an element by one class

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Login Submit** button.
   <!-- step {"find":{"elementClass":"btn-large"}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-find-elementclass-string","detectSteps":false} */}

# Find an element by one class

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Login Submit** button.
   {/* step {"find":{"elementClass":"btn-large"}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Find an element by one class

// (test {"testId":"nav-find-elementclass-string","detectSteps":false})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Login Submit* button.
+
// (step {"find":{"elementClass":"btn-large"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by one class</title></head>
<body>
<!-- test {"testId":"nav-find-elementclass-string","detectSteps":false} -->
<h1>Find an element by one class</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Login Submit</strong> button.
    <!-- step {"find":{"elementClass":"btn-large"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Find an element by one class
============================

.. test {"testId":"nav-find-elementclass-string","detectSteps":false}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Login Submit** button.

   .. step {"find":{"elementClass":"btn-large"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementclass-string">
  <title>Find an element by one class</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementclass-string","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Login Submit</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementClass":"btn-large"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-find-elementclass-string",
      "steps": [
        {
          "goTo": "http://localhost:8092/enhanced-elements.html"
        },
        {
          "find": {
            "elementClass": "btn-large"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-find-elementclass-string
    steps:
      - goTo: http://localhost:8092/enhanced-elements.html
      - find:
          elementClass: btn-large
```

### `elementClass: [ … ]`

**Varies:** `find.elementClass` · **Value:** `["btn", "btn-secondary", "btn-large"]` · **Effect:** the step finds the first element that has every class in the list.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Find an element by several classes

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Large Secondary** button.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Find an element by several classes

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Large Secondary** button.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Find an element by several classes

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
. Find the *Large Secondary* button.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by several classes</title></head>
<body>
<h1>Find an element by several classes</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.</li>
  <li>Find the <strong>Large Secondary</strong> button.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Find an element by several classes
==================================

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.
#. Find the **Large Secondary** button.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementclass-array">
  <title>Find an element by several classes</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd></step>
      <step><cmd>Find the <b>Large Secondary</b> button.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-find-elementclass-array","detectSteps":true} -->

# Find an element by several classes

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Large Secondary** button.
   <!-- step {"find":{"elementClass":["btn","btn-secondary","btn-large"]}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-find-elementclass-array","detectSteps":true} */}

# Find an element by several classes

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Large Secondary** button.
   {/* step {"find":{"elementClass":["btn","btn-secondary","btn-large"]}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Find an element by several classes

// (test {"testId":"nav-find-elementclass-array","detectSteps":true})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Large Secondary* button.
+
// (step {"find":{"elementClass":["btn","btn-secondary","btn-large"]}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by several classes</title></head>
<body>
<!-- test {"testId":"nav-find-elementclass-array","detectSteps":true} -->
<h1>Find an element by several classes</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Large Secondary</strong> button.
    <!-- step {"find":{"elementClass":["btn","btn-secondary","btn-large"]}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Find an element by several classes
==================================

.. test {"testId":"nav-find-elementclass-array","detectSteps":true}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Large Secondary** button.

   .. step {"find":{"elementClass":["btn","btn-secondary","btn-large"]}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementclass-array">
  <title>Find an element by several classes</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementclass-array","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Large Secondary</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementClass":["btn","btn-secondary","btn-large"]}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-find-elementclass-array","detectSteps":false} -->

# Find an element by several classes

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Large Secondary** button.
   <!-- step {"find":{"elementClass":["btn","btn-secondary","btn-large"]}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-find-elementclass-array","detectSteps":false} */}

# Find an element by several classes

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Large Secondary** button.
   {/* step {"find":{"elementClass":["btn","btn-secondary","btn-large"]}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Find an element by several classes

// (test {"testId":"nav-find-elementclass-array","detectSteps":false})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Large Secondary* button.
+
// (step {"find":{"elementClass":["btn","btn-secondary","btn-large"]}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by several classes</title></head>
<body>
<!-- test {"testId":"nav-find-elementclass-array","detectSteps":false} -->
<h1>Find an element by several classes</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Large Secondary</strong> button.
    <!-- step {"find":{"elementClass":["btn","btn-secondary","btn-large"]}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Find an element by several classes
==================================

.. test {"testId":"nav-find-elementclass-array","detectSteps":false}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Large Secondary** button.

   .. step {"find":{"elementClass":["btn","btn-secondary","btn-large"]}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementclass-array">
  <title>Find an element by several classes</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementclass-array","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Large Secondary</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementClass":["btn","btn-secondary","btn-large"]}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-find-elementclass-array",
      "steps": [
        {
          "goTo": "http://localhost:8092/enhanced-elements.html"
        },
        {
          "find": {
            "elementClass": [
              "btn",
              "btn-secondary",
              "btn-large"
            ]
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-find-elementclass-array
    steps:
      - goTo: http://localhost:8092/enhanced-elements.html
      - find:
          elementClass:
            - btn
            - btn-secondary
            - btn-large
```

### `elementAttribute: { "data-count": "5" }`

**Varies:** `find.elementAttribute` · **Value:** `{ "data-count": "5" }` · **Effect:** the step finds the element whose attribute has that value.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Find an element by an attribute value

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Count: 5** button.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Find an element by an attribute value

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Count: 5** button.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Find an element by an attribute value

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
. Find the *Count: 5* button.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by an attribute value</title></head>
<body>
<h1>Find an element by an attribute value</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.</li>
  <li>Find the <strong>Count: 5</strong> button.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Find an element by an attribute value
=====================================

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.
#. Find the **Count: 5** button.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementattribute-string">
  <title>Find an element by an attribute value</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd></step>
      <step><cmd>Find the <b>Count: 5</b> button.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-find-elementattribute-string","detectSteps":true} -->

# Find an element by an attribute value

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Count: 5** button.
   <!-- step {"find":{"elementAttribute":{"data-count":"5"}}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-find-elementattribute-string","detectSteps":true} */}

# Find an element by an attribute value

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Count: 5** button.
   {/* step {"find":{"elementAttribute":{"data-count":"5"}}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Find an element by an attribute value

// (test {"testId":"nav-find-elementattribute-string","detectSteps":true})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Count: 5* button.
+
// (step {"find":{"elementAttribute":{"data-count":"5"}}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by an attribute value</title></head>
<body>
<!-- test {"testId":"nav-find-elementattribute-string","detectSteps":true} -->
<h1>Find an element by an attribute value</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Count: 5</strong> button.
    <!-- step {"find":{"elementAttribute":{"data-count":"5"}}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Find an element by an attribute value
=====================================

.. test {"testId":"nav-find-elementattribute-string","detectSteps":true}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Count: 5** button.

   .. step {"find":{"elementAttribute":{"data-count":"5"}}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementattribute-string">
  <title>Find an element by an attribute value</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementattribute-string","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Count: 5</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementAttribute":{"data-count":"5"}}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-find-elementattribute-string","detectSteps":false} -->

# Find an element by an attribute value

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Count: 5** button.
   <!-- step {"find":{"elementAttribute":{"data-count":"5"}}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-find-elementattribute-string","detectSteps":false} */}

# Find an element by an attribute value

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Count: 5** button.
   {/* step {"find":{"elementAttribute":{"data-count":"5"}}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Find an element by an attribute value

// (test {"testId":"nav-find-elementattribute-string","detectSteps":false})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Count: 5* button.
+
// (step {"find":{"elementAttribute":{"data-count":"5"}}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by an attribute value</title></head>
<body>
<!-- test {"testId":"nav-find-elementattribute-string","detectSteps":false} -->
<h1>Find an element by an attribute value</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Count: 5</strong> button.
    <!-- step {"find":{"elementAttribute":{"data-count":"5"}}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Find an element by an attribute value
=====================================

.. test {"testId":"nav-find-elementattribute-string","detectSteps":false}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Count: 5** button.

   .. step {"find":{"elementAttribute":{"data-count":"5"}}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementattribute-string">
  <title>Find an element by an attribute value</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementattribute-string","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Count: 5</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementAttribute":{"data-count":"5"}}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-find-elementattribute-string",
      "steps": [
        {
          "goTo": "http://localhost:8092/enhanced-elements.html"
        },
        {
          "find": {
            "elementAttribute": {
              "data-count": "5"
            }
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-find-elementattribute-string
    steps:
      - goTo: http://localhost:8092/enhanced-elements.html
      - find:
          elementAttribute:
            data-count: "5"
```

### `elementAttribute: { "disabled": true }`

**Varies:** `find.elementAttribute` · **Value:** `{ "disabled": true }` · **Effect:** the step finds the first element that has the attribute, whatever its value.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Find an element by an attribute's presence

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Disabled Button** button.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Find an element by an attribute's presence

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
2. Find the **Disabled Button** button.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Find an element by an attribute's presence

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
. Find the *Disabled Button* button.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by an attribute's presence</title></head>
<body>
<h1>Find an element by an attribute's presence</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.</li>
  <li>Find the <strong>Disabled Button</strong> button.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Find an element by an attribute's presence
==========================================

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.
#. Find the **Disabled Button** button.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementattribute-boolean">
  <title>Find an element by an attribute's presence</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd></step>
      <step><cmd>Find the <b>Disabled Button</b> button.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-find-elementattribute-boolean","detectSteps":true} -->

# Find an element by an attribute's presence

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Disabled Button** button.
   <!-- step {"find":{"elementAttribute":{"disabled":true}}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-find-elementattribute-boolean","detectSteps":true} */}

# Find an element by an attribute's presence

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Disabled Button** button.
   {/* step {"find":{"elementAttribute":{"disabled":true}}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Find an element by an attribute's presence

// (test {"testId":"nav-find-elementattribute-boolean","detectSteps":true})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Disabled Button* button.
+
// (step {"find":{"elementAttribute":{"disabled":true}}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by an attribute's presence</title></head>
<body>
<!-- test {"testId":"nav-find-elementattribute-boolean","detectSteps":true} -->
<h1>Find an element by an attribute's presence</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Disabled Button</strong> button.
    <!-- step {"find":{"elementAttribute":{"disabled":true}}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Find an element by an attribute's presence
==========================================

.. test {"testId":"nav-find-elementattribute-boolean","detectSteps":true}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Disabled Button** button.

   .. step {"find":{"elementAttribute":{"disabled":true}}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementattribute-boolean">
  <title>Find an element by an attribute's presence</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementattribute-boolean","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Disabled Button</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementAttribute":{"disabled":true}}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-find-elementattribute-boolean","detectSteps":false} -->

# Find an element by an attribute's presence

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} -->
2. Find the **Disabled Button** button.
   <!-- step {"find":{"elementAttribute":{"disabled":true}}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-find-elementattribute-boolean","detectSteps":false} */}

# Find an element by an attribute's presence

1. Go to [the element test page](http://localhost:8092/enhanced-elements.html).
   {/* step {"goTo":"http://localhost:8092/enhanced-elements.html"} */}
2. Find the **Disabled Button** button.
   {/* step {"find":{"elementAttribute":{"disabled":true}}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Find an element by an attribute's presence

// (test {"testId":"nav-find-elementattribute-boolean","detectSteps":false})

. Go to http://localhost:8092/enhanced-elements.html[the element test page].
+
// (step {"goTo":"http://localhost:8092/enhanced-elements.html"})
. Find the *Disabled Button* button.
+
// (step {"find":{"elementAttribute":{"disabled":true}}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by an attribute's presence</title></head>
<body>
<!-- test {"testId":"nav-find-elementattribute-boolean","detectSteps":false} -->
<h1>Find an element by an attribute's presence</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/enhanced-elements.html">the element test page</a>.
    <!-- step {"goTo":"http://localhost:8092/enhanced-elements.html"} --></li>
  <li>Find the <strong>Disabled Button</strong> button.
    <!-- step {"find":{"elementAttribute":{"disabled":true}}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Find an element by an attribute's presence
==========================================

.. test {"testId":"nav-find-elementattribute-boolean","detectSteps":false}

#. Go to `the element test page <http://localhost:8092/enhanced-elements.html>`_.

   .. step {"goTo":"http://localhost:8092/enhanced-elements.html"}

#. Find the **Disabled Button** button.

   .. step {"find":{"elementAttribute":{"disabled":true}}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementattribute-boolean">
  <title>Find an element by an attribute's presence</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementattribute-boolean","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/enhanced-elements.html" scope="external" format="html">the element test page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/enhanced-elements.html"}'/></info></step>
      <step><cmd>Find the <b>Disabled Button</b> button.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementAttribute":{"disabled":true}}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-find-elementattribute-boolean",
      "steps": [
        {
          "goTo": "http://localhost:8092/enhanced-elements.html"
        },
        {
          "find": {
            "elementAttribute": {
              "disabled": true
            }
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-find-elementattribute-boolean
    steps:
      - goTo: http://localhost:8092/enhanced-elements.html
      - find:
          elementAttribute:
            disabled: true
```

### `elementImage: "save.svg"`

**Varies:** `find.elementImage` · **Value:** `"save.svg"` · **Effect:** the step finds the spot on the page that looks like the picture in the file.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Find an element by an image file

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
2. Find the save icon in the toolbar.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Find an element by an image file

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
2. Find the save icon in the toolbar.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Find an element by an image file

. Go to http://localhost:8092/find-image.html[the toolbar page].
. Find the save icon in the toolbar.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by an image file</title></head>
<body>
<h1>Find an element by an image file</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/find-image.html">the toolbar page</a>.</li>
  <li>Find the save icon in the toolbar.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Find an element by an image file
================================

#. Go to `the toolbar page <http://localhost:8092/find-image.html>`_.
#. Find the save icon in the toolbar.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementimage-path">
  <title>Find an element by an image file</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/find-image.html" scope="external" format="html">the toolbar page</xref>.</cmd></step>
      <step><cmd>Find the save icon in the toolbar.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-find-elementimage-path","detectSteps":true} -->

# Find an element by an image file

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   <!-- step {"goTo":"http://localhost:8092/find-image.html"} -->
2. Find the save icon in the toolbar.
   <!-- step {"find":{"elementImage":"save.svg"}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-find-elementimage-path","detectSteps":true} */}

# Find an element by an image file

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   {/* step {"goTo":"http://localhost:8092/find-image.html"} */}
2. Find the save icon in the toolbar.
   {/* step {"find":{"elementImage":"save.svg"}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Find an element by an image file

// (test {"testId":"nav-find-elementimage-path","detectSteps":true})

. Go to http://localhost:8092/find-image.html[the toolbar page].
+
// (step {"goTo":"http://localhost:8092/find-image.html"})
. Find the save icon in the toolbar.
+
// (step {"find":{"elementImage":"save.svg"}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by an image file</title></head>
<body>
<!-- test {"testId":"nav-find-elementimage-path","detectSteps":true} -->
<h1>Find an element by an image file</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/find-image.html">the toolbar page</a>.
    <!-- step {"goTo":"http://localhost:8092/find-image.html"} --></li>
  <li>Find the save icon in the toolbar.
    <!-- step {"find":{"elementImage":"save.svg"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Find an element by an image file
================================

.. test {"testId":"nav-find-elementimage-path","detectSteps":true}

#. Go to `the toolbar page <http://localhost:8092/find-image.html>`_.

   .. step {"goTo":"http://localhost:8092/find-image.html"}

#. Find the save icon in the toolbar.

   .. step {"find":{"elementImage":"save.svg"}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementimage-path">
  <title>Find an element by an image file</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementimage-path","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/find-image.html" scope="external" format="html">the toolbar page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/find-image.html"}'/></info></step>
      <step><cmd>Find the save icon in the toolbar.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementImage":"save.svg"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-find-elementimage-path","detectSteps":false} -->

# Find an element by an image file

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   <!-- step {"goTo":"http://localhost:8092/find-image.html"} -->
2. Find the save icon in the toolbar.
   <!-- step {"find":{"elementImage":"save.svg"}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-find-elementimage-path","detectSteps":false} */}

# Find an element by an image file

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   {/* step {"goTo":"http://localhost:8092/find-image.html"} */}
2. Find the save icon in the toolbar.
   {/* step {"find":{"elementImage":"save.svg"}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Find an element by an image file

// (test {"testId":"nav-find-elementimage-path","detectSteps":false})

. Go to http://localhost:8092/find-image.html[the toolbar page].
+
// (step {"goTo":"http://localhost:8092/find-image.html"})
. Find the save icon in the toolbar.
+
// (step {"find":{"elementImage":"save.svg"}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by an image file</title></head>
<body>
<!-- test {"testId":"nav-find-elementimage-path","detectSteps":false} -->
<h1>Find an element by an image file</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/find-image.html">the toolbar page</a>.
    <!-- step {"goTo":"http://localhost:8092/find-image.html"} --></li>
  <li>Find the save icon in the toolbar.
    <!-- step {"find":{"elementImage":"save.svg"}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Find an element by an image file
================================

.. test {"testId":"nav-find-elementimage-path","detectSteps":false}

#. Go to `the toolbar page <http://localhost:8092/find-image.html>`_.

   .. step {"goTo":"http://localhost:8092/find-image.html"}

#. Find the save icon in the toolbar.

   .. step {"find":{"elementImage":"save.svg"}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementimage-path">
  <title>Find an element by an image file</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementimage-path","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/find-image.html" scope="external" format="html">the toolbar page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/find-image.html"}'/></info></step>
      <step><cmd>Find the save icon in the toolbar.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementImage":"save.svg"}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-find-elementimage-path",
      "steps": [
        {
          "goTo": "http://localhost:8092/find-image.html"
        },
        {
          "find": {
            "elementImage": "save.svg"
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-find-elementimage-path
    steps:
      - goTo: http://localhost:8092/find-image.html
      - find:
          elementImage: save.svg
```

### `elementImage: { path, threshold }`

**Varies:** `find.elementImage` · **Value:** `{ "path": "save.svg", "threshold": 0.95 }` · **Effect:** the step finds the picture and counts only a match that scores 0.95 or higher.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Find an element by an image with a threshold

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
2. Find the save icon in the toolbar.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Find an element by an image with a threshold

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
2. Find the save icon in the toolbar.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Find an element by an image with a threshold

. Go to http://localhost:8092/find-image.html[the toolbar page].
. Find the save icon in the toolbar.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by an image with a threshold</title></head>
<body>
<h1>Find an element by an image with a threshold</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/find-image.html">the toolbar page</a>.</li>
  <li>Find the save icon in the toolbar.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Find an element by an image with a threshold
============================================

#. Go to `the toolbar page <http://localhost:8092/find-image.html>`_.
#. Find the save icon in the toolbar.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementimage-object">
  <title>Find an element by an image with a threshold</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/find-image.html" scope="external" format="html">the toolbar page</xref>.</cmd></step>
      <step><cmd>Find the save icon in the toolbar.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-find-elementimage-object","detectSteps":true} -->

# Find an element by an image with a threshold

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   <!-- step {"goTo":"http://localhost:8092/find-image.html"} -->
2. Find the save icon in the toolbar.
   <!-- step {"find":{"elementImage":{"path":"save.svg","threshold":0.95}}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-find-elementimage-object","detectSteps":true} */}

# Find an element by an image with a threshold

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   {/* step {"goTo":"http://localhost:8092/find-image.html"} */}
2. Find the save icon in the toolbar.
   {/* step {"find":{"elementImage":{"path":"save.svg","threshold":0.95}}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Find an element by an image with a threshold

// (test {"testId":"nav-find-elementimage-object","detectSteps":true})

. Go to http://localhost:8092/find-image.html[the toolbar page].
+
// (step {"goTo":"http://localhost:8092/find-image.html"})
. Find the save icon in the toolbar.
+
// (step {"find":{"elementImage":{"path":"save.svg","threshold":0.95}}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by an image with a threshold</title></head>
<body>
<!-- test {"testId":"nav-find-elementimage-object","detectSteps":true} -->
<h1>Find an element by an image with a threshold</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/find-image.html">the toolbar page</a>.
    <!-- step {"goTo":"http://localhost:8092/find-image.html"} --></li>
  <li>Find the save icon in the toolbar.
    <!-- step {"find":{"elementImage":{"path":"save.svg","threshold":0.95}}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Find an element by an image with a threshold
============================================

.. test {"testId":"nav-find-elementimage-object","detectSteps":true}

#. Go to `the toolbar page <http://localhost:8092/find-image.html>`_.

   .. step {"goTo":"http://localhost:8092/find-image.html"}

#. Find the save icon in the toolbar.

   .. step {"find":{"elementImage":{"path":"save.svg","threshold":0.95}}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementimage-object">
  <title>Find an element by an image with a threshold</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementimage-object","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/find-image.html" scope="external" format="html">the toolbar page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/find-image.html"}'/></info></step>
      <step><cmd>Find the save icon in the toolbar.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementImage":{"path":"save.svg","threshold":0.95}}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-find-elementimage-object","detectSteps":false} -->

# Find an element by an image with a threshold

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   <!-- step {"goTo":"http://localhost:8092/find-image.html"} -->
2. Find the save icon in the toolbar.
   <!-- step {"find":{"elementImage":{"path":"save.svg","threshold":0.95}}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-find-elementimage-object","detectSteps":false} */}

# Find an element by an image with a threshold

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   {/* step {"goTo":"http://localhost:8092/find-image.html"} */}
2. Find the save icon in the toolbar.
   {/* step {"find":{"elementImage":{"path":"save.svg","threshold":0.95}}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Find an element by an image with a threshold

// (test {"testId":"nav-find-elementimage-object","detectSteps":false})

. Go to http://localhost:8092/find-image.html[the toolbar page].
+
// (step {"goTo":"http://localhost:8092/find-image.html"})
. Find the save icon in the toolbar.
+
// (step {"find":{"elementImage":{"path":"save.svg","threshold":0.95}}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element by an image with a threshold</title></head>
<body>
<!-- test {"testId":"nav-find-elementimage-object","detectSteps":false} -->
<h1>Find an element by an image with a threshold</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/find-image.html">the toolbar page</a>.
    <!-- step {"goTo":"http://localhost:8092/find-image.html"} --></li>
  <li>Find the save icon in the toolbar.
    <!-- step {"find":{"elementImage":{"path":"save.svg","threshold":0.95}}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Find an element by an image with a threshold
============================================

.. test {"testId":"nav-find-elementimage-object","detectSteps":false}

#. Go to `the toolbar page <http://localhost:8092/find-image.html>`_.

   .. step {"goTo":"http://localhost:8092/find-image.html"}

#. Find the save icon in the toolbar.

   .. step {"find":{"elementImage":{"path":"save.svg","threshold":0.95}}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-elementimage-object">
  <title>Find an element by an image with a threshold</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-elementimage-object","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/find-image.html" scope="external" format="html">the toolbar page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/find-image.html"}'/></info></step>
      <step><cmd>Find the save icon in the toolbar.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementImage":{"path":"save.svg","threshold":0.95}}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-find-elementimage-object",
      "steps": [
        {
          "goTo": "http://localhost:8092/find-image.html"
        },
        {
          "find": {
            "elementImage": {
              "path": "save.svg",
              "threshold": 0.95
            }
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-find-elementimage-object
    steps:
      - goTo: http://localhost:8092/find-image.html
      - find:
          elementImage:
            path: save.svg
            threshold: 0.95
```

## `find` action permutations

Each example adds one follow-up action or limit to a [`find`](/docs/actions/find) step.

### `click: true`

**Varies:** `find.click` · **Value:** `true` · **Effect:** the step left-clicks the element after it finds it.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Find an element and click it

1. Go to [the click counter page](http://localhost:8092/find-click.html).
2. Find **Count clicks** and click it.
3. Check that the button counted one left click.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Find an element and click it

1. Go to [the click counter page](http://localhost:8092/find-click.html).
2. Find **Count clicks** and click it.
3. Check that the button counted one left click.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Find an element and click it

. Go to http://localhost:8092/find-click.html[the click counter page].
. Find *Count clicks* and click it.
. Check that the button counted one left click.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element and click it</title></head>
<body>
<h1>Find an element and click it</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/find-click.html">the click counter page</a>.</li>
  <li>Find <strong>Count clicks</strong> and click it.</li>
  <li>Check that the button counted one left click.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Find an element and click it
============================

#. Go to `the click counter page <http://localhost:8092/find-click.html>`_.
#. Find **Count clicks** and click it.
#. Check that the button counted one left click.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-click">
  <title>Find an element and click it</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/find-click.html" scope="external" format="html">the click counter page</xref>.</cmd></step>
      <step><cmd>Find <b>Count clicks</b> and click it.</cmd></step>
      <step><cmd>Check that the button counted one left click.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-find-click","detectSteps":true} -->

# Find an element and click it

1. Go to [the click counter page](http://localhost:8092/find-click.html).
   <!-- step {"goTo":"http://localhost:8092/find-click.html"} -->
2. Find **Count clicks** and click it.
   <!-- step {"find":{"selector":"#counter","click":true}} -->
3. Check that the button counted one left click.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-find-click","detectSteps":true} */}

# Find an element and click it

1. Go to [the click counter page](http://localhost:8092/find-click.html).
   {/* step {"goTo":"http://localhost:8092/find-click.html"} */}
2. Find **Count clicks** and click it.
   {/* step {"find":{"selector":"#counter","click":true}} */}
3. Check that the button counted one left click.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Find an element and click it

// (test {"testId":"nav-find-click","detectSteps":true})

. Go to http://localhost:8092/find-click.html[the click counter page].
+
// (step {"goTo":"http://localhost:8092/find-click.html"})
. Find *Count clicks* and click it.
+
// (step {"find":{"selector":"#counter","click":true}})
. Check that the button counted one left click.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element and click it</title></head>
<body>
<!-- test {"testId":"nav-find-click","detectSteps":true} -->
<h1>Find an element and click it</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/find-click.html">the click counter page</a>.
    <!-- step {"goTo":"http://localhost:8092/find-click.html"} --></li>
  <li>Find <strong>Count clicks</strong> and click it.
    <!-- step {"find":{"selector":"#counter","click":true}} --></li>
  <li>Check that the button counted one left click.</li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Find an element and click it
============================

.. test {"testId":"nav-find-click","detectSteps":true}

#. Go to `the click counter page <http://localhost:8092/find-click.html>`_.

   .. step {"goTo":"http://localhost:8092/find-click.html"}

#. Find **Count clicks** and click it.

   .. step {"find":{"selector":"#counter","click":true}}

#. Check that the button counted one left click.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-click">
  <title>Find an element and click it</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-click","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/find-click.html" scope="external" format="html">the click counter page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/find-click.html"}'/></info></step>
      <step><cmd>Find <b>Count clicks</b> and click it.</cmd>
        <info><data name="doc-detective" value='step {"find":{"selector":"#counter","click":true}}'/></info></step>
      <step><cmd>Check that the button counted one left click.</cmd></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-find-click","detectSteps":false} -->

# Find an element and click it

1. Go to [the click counter page](http://localhost:8092/find-click.html).
   <!-- step {"goTo":"http://localhost:8092/find-click.html"} -->
2. Find **Count clicks** and click it.
   <!-- step {"find":{"selector":"#counter","click":true}} -->
3. Check that the button counted one left click.
   <!-- step {"find":{"selector":"#counter","elementAttribute":{"data-left":"1"}}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-find-click","detectSteps":false} */}

# Find an element and click it

1. Go to [the click counter page](http://localhost:8092/find-click.html).
   {/* step {"goTo":"http://localhost:8092/find-click.html"} */}
2. Find **Count clicks** and click it.
   {/* step {"find":{"selector":"#counter","click":true}} */}
3. Check that the button counted one left click.
   {/* step {"find":{"selector":"#counter","elementAttribute":{"data-left":"1"}}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Find an element and click it

// (test {"testId":"nav-find-click","detectSteps":false})

. Go to http://localhost:8092/find-click.html[the click counter page].
+
// (step {"goTo":"http://localhost:8092/find-click.html"})
. Find *Count clicks* and click it.
+
// (step {"find":{"selector":"#counter","click":true}})
. Check that the button counted one left click.
+
// (step {"find":{"selector":"#counter","elementAttribute":{"data-left":"1"}}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element and click it</title></head>
<body>
<!-- test {"testId":"nav-find-click","detectSteps":false} -->
<h1>Find an element and click it</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/find-click.html">the click counter page</a>.
    <!-- step {"goTo":"http://localhost:8092/find-click.html"} --></li>
  <li>Find <strong>Count clicks</strong> and click it.
    <!-- step {"find":{"selector":"#counter","click":true}} --></li>
  <li>Check that the button counted one left click.
    <!-- step {"find":{"selector":"#counter","elementAttribute":{"data-left":"1"}}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Find an element and click it
============================

.. test {"testId":"nav-find-click","detectSteps":false}

#. Go to `the click counter page <http://localhost:8092/find-click.html>`_.

   .. step {"goTo":"http://localhost:8092/find-click.html"}

#. Find **Count clicks** and click it.

   .. step {"find":{"selector":"#counter","click":true}}

#. Check that the button counted one left click.

   .. step {"find":{"selector":"#counter","elementAttribute":{"data-left":"1"}}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-click">
  <title>Find an element and click it</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-click","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/find-click.html" scope="external" format="html">the click counter page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/find-click.html"}'/></info></step>
      <step><cmd>Find <b>Count clicks</b> and click it.</cmd>
        <info><data name="doc-detective" value='step {"find":{"selector":"#counter","click":true}}'/></info></step>
      <step><cmd>Check that the button counted one left click.</cmd>
        <info><data name="doc-detective" value='step {"find":{"selector":"#counter","elementAttribute":{"data-left":"1"}}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-find-click",
      "steps": [
        {
          "goTo": "http://localhost:8092/find-click.html"
        },
        {
          "find": {
            "selector": "#counter",
            "click": true
          }
        },
        {
          "find": {
            "selector": "#counter",
            "elementAttribute": {
              "data-left": "1"
            }
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-find-click
    steps:
      - goTo: http://localhost:8092/find-click.html
      - find:
          selector: "#counter"
          click: true
      - find:
          selector: "#counter"
          elementAttribute:
            data-left: "1"
```

### `type: "Hello"`

**Varies:** `find.type` · **Value:** `"Hello"` · **Effect:** the step types the keys into the element after it finds and clicks it.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Find a field and type in it

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Find the **Type here:** field, click it, and type `Hello`.
3. Check that the page shows **Hello** below the field.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Find a field and type in it

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
2. Find the **Type here:** field, click it, and type `Hello`.
3. Check that the page shows **Hello** below the field.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Find a field and type in it

. Go to http://localhost:8092/type-echo.html[the type echo page].
. Find the *Type here:* field, click it, and type `Hello`.
. Check that the page shows *Hello* below the field.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find a field and type in it</title></head>
<body>
<h1>Find a field and type in it</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/type-echo.html">the type echo page</a>.</li>
  <li>Find the <strong>Type here:</strong> field, click it, and type <code>Hello</code>.</li>
  <li>Check that the page shows <strong>Hello</strong> below the field.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Find a field and type in it
===========================

#. Go to `the type echo page <http://localhost:8092/type-echo.html>`_.
#. Find the **Type here:** field, click it, and type ``Hello``.
#. Check that the page shows **Hello** below the field.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-type">
  <title>Find a field and type in it</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/type-echo.html" scope="external" format="html">the type echo page</xref>.</cmd></step>
      <step><cmd>Find the <b>Type here:</b> field, click it, and type <codeph>Hello</codeph>.</cmd></step>
      <step><cmd>Check that the page shows <b>Hello</b> below the field.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-find-type","detectSteps":true} -->

# Find a field and type in it

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
   <!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
2. Find the **Type here:** field, click it, and type `Hello`.
   <!-- step {"find":{"selector":"#type-input","click":true,"type":"Hello"}} -->
3. Check that the page shows **Hello** below the field.

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-find-type","detectSteps":true} */}

# Find a field and type in it

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
   {/* step {"goTo":"http://localhost:8092/type-echo.html"} */}
2. Find the **Type here:** field, click it, and type `Hello`.
   {/* step {"find":{"selector":"#type-input","click":true,"type":"Hello"}} */}
3. Check that the page shows **Hello** below the field.

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Find a field and type in it

// (test {"testId":"nav-find-type","detectSteps":true})

. Go to http://localhost:8092/type-echo.html[the type echo page].
+
// (step {"goTo":"http://localhost:8092/type-echo.html"})
. Find the *Type here:* field, click it, and type `Hello`.
+
// (step {"find":{"selector":"#type-input","click":true,"type":"Hello"}})
. Check that the page shows *Hello* below the field.

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find a field and type in it</title></head>
<body>
<!-- test {"testId":"nav-find-type","detectSteps":true} -->
<h1>Find a field and type in it</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/type-echo.html">the type echo page</a>.
    <!-- step {"goTo":"http://localhost:8092/type-echo.html"} --></li>
  <li>Find the <strong>Type here:</strong> field, click it, and type <code>Hello</code>.
    <!-- step {"find":{"selector":"#type-input","click":true,"type":"Hello"}} --></li>
  <li>Check that the page shows <strong>Hello</strong> below the field.</li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Find a field and type in it
===========================

.. test {"testId":"nav-find-type","detectSteps":true}

#. Go to `the type echo page <http://localhost:8092/type-echo.html>`_.

   .. step {"goTo":"http://localhost:8092/type-echo.html"}

#. Find the **Type here:** field, click it, and type ``Hello``.

   .. step {"find":{"selector":"#type-input","click":true,"type":"Hello"}}

#. Check that the page shows **Hello** below the field.

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-type">
  <title>Find a field and type in it</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-type","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/type-echo.html" scope="external" format="html">the type echo page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/></info></step>
      <step><cmd>Find the <b>Type here:</b> field, click it, and type <codeph>Hello</codeph>.</cmd>
        <info><data name="doc-detective" value='step {"find":{"selector":"#type-input","click":true,"type":"Hello"}}'/></info></step>
      <step><cmd>Check that the page shows <b>Hello</b> below the field.</cmd></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-find-type","detectSteps":false} -->

# Find a field and type in it

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
   <!-- step {"goTo":"http://localhost:8092/type-echo.html"} -->
2. Find the **Type here:** field, click it, and type `Hello`.
   <!-- step {"find":{"selector":"#type-input","click":true,"type":"Hello"}} -->
3. Check that the page shows **Hello** below the field.
   <!-- step {"find":"Hello"} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-find-type","detectSteps":false} */}

# Find a field and type in it

1. Go to [the type echo page](http://localhost:8092/type-echo.html).
   {/* step {"goTo":"http://localhost:8092/type-echo.html"} */}
2. Find the **Type here:** field, click it, and type `Hello`.
   {/* step {"find":{"selector":"#type-input","click":true,"type":"Hello"}} */}
3. Check that the page shows **Hello** below the field.
   {/* step {"find":"Hello"} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Find a field and type in it

// (test {"testId":"nav-find-type","detectSteps":false})

. Go to http://localhost:8092/type-echo.html[the type echo page].
+
// (step {"goTo":"http://localhost:8092/type-echo.html"})
. Find the *Type here:* field, click it, and type `Hello`.
+
// (step {"find":{"selector":"#type-input","click":true,"type":"Hello"}})
. Check that the page shows *Hello* below the field.
+
// (step {"find":"Hello"})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find a field and type in it</title></head>
<body>
<!-- test {"testId":"nav-find-type","detectSteps":false} -->
<h1>Find a field and type in it</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/type-echo.html">the type echo page</a>.
    <!-- step {"goTo":"http://localhost:8092/type-echo.html"} --></li>
  <li>Find the <strong>Type here:</strong> field, click it, and type <code>Hello</code>.
    <!-- step {"find":{"selector":"#type-input","click":true,"type":"Hello"}} --></li>
  <li>Check that the page shows <strong>Hello</strong> below the field.
    <!-- step {"find":"Hello"} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Find a field and type in it
===========================

.. test {"testId":"nav-find-type","detectSteps":false}

#. Go to `the type echo page <http://localhost:8092/type-echo.html>`_.

   .. step {"goTo":"http://localhost:8092/type-echo.html"}

#. Find the **Type here:** field, click it, and type ``Hello``.

   .. step {"find":{"selector":"#type-input","click":true,"type":"Hello"}}

#. Check that the page shows **Hello** below the field.

   .. step {"find":"Hello"}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-type">
  <title>Find a field and type in it</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-type","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/type-echo.html" scope="external" format="html">the type echo page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/type-echo.html"}'/></info></step>
      <step><cmd>Find the <b>Type here:</b> field, click it, and type <codeph>Hello</codeph>.</cmd>
        <info><data name="doc-detective" value='step {"find":{"selector":"#type-input","click":true,"type":"Hello"}}'/></info></step>
      <step><cmd>Check that the page shows <b>Hello</b> below the field.</cmd>
        <info><data name="doc-detective" value='step {"find":"Hello"}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-find-type",
      "steps": [
        {
          "goTo": "http://localhost:8092/type-echo.html"
        },
        {
          "find": {
            "selector": "#type-input",
            "click": true,
            "type": "Hello"
          }
        },
        {
          "find": "Hello"
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-find-type
    steps:
      - goTo: http://localhost:8092/type-echo.html
      - find:
          selector: "#type-input"
          click: true
          type: Hello
      - find: Hello
```

### `moveTo: true`

**Varies:** `find.moveTo` · **Value:** `true` · **Effect:** the step scrolls the element into view and moves the cursor to it.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Find an element and scroll to it

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
2. Scroll down to the icon at the bottom of the page.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Find an element and scroll to it

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
2. Scroll down to the icon at the bottom of the page.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Find an element and scroll to it

. Go to http://localhost:8092/find-image.html[the toolbar page].
. Scroll down to the icon at the bottom of the page.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element and scroll to it</title></head>
<body>
<h1>Find an element and scroll to it</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/find-image.html">the toolbar page</a>.</li>
  <li>Scroll down to the icon at the bottom of the page.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Find an element and scroll to it
================================

#. Go to `the toolbar page <http://localhost:8092/find-image.html>`_.
#. Scroll down to the icon at the bottom of the page.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-moveto">
  <title>Find an element and scroll to it</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/find-image.html" scope="external" format="html">the toolbar page</xref>.</cmd></step>
      <step><cmd>Scroll down to the icon at the bottom of the page.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-find-moveto","detectSteps":true} -->

# Find an element and scroll to it

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   <!-- step {"goTo":"http://localhost:8092/find-image.html"} -->
2. Scroll down to the icon at the bottom of the page.
   <!-- step {"find":{"selector":"#far","moveTo":true}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-find-moveto","detectSteps":true} */}

# Find an element and scroll to it

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   {/* step {"goTo":"http://localhost:8092/find-image.html"} */}
2. Scroll down to the icon at the bottom of the page.
   {/* step {"find":{"selector":"#far","moveTo":true}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Find an element and scroll to it

// (test {"testId":"nav-find-moveto","detectSteps":true})

. Go to http://localhost:8092/find-image.html[the toolbar page].
+
// (step {"goTo":"http://localhost:8092/find-image.html"})
. Scroll down to the icon at the bottom of the page.
+
// (step {"find":{"selector":"#far","moveTo":true}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element and scroll to it</title></head>
<body>
<!-- test {"testId":"nav-find-moveto","detectSteps":true} -->
<h1>Find an element and scroll to it</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/find-image.html">the toolbar page</a>.
    <!-- step {"goTo":"http://localhost:8092/find-image.html"} --></li>
  <li>Scroll down to the icon at the bottom of the page.
    <!-- step {"find":{"selector":"#far","moveTo":true}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Find an element and scroll to it
================================

.. test {"testId":"nav-find-moveto","detectSteps":true}

#. Go to `the toolbar page <http://localhost:8092/find-image.html>`_.

   .. step {"goTo":"http://localhost:8092/find-image.html"}

#. Scroll down to the icon at the bottom of the page.

   .. step {"find":{"selector":"#far","moveTo":true}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-moveto">
  <title>Find an element and scroll to it</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-moveto","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/find-image.html" scope="external" format="html">the toolbar page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/find-image.html"}'/></info></step>
      <step><cmd>Scroll down to the icon at the bottom of the page.</cmd>
        <info><data name="doc-detective" value='step {"find":{"selector":"#far","moveTo":true}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-find-moveto","detectSteps":false} -->

# Find an element and scroll to it

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   <!-- step {"goTo":"http://localhost:8092/find-image.html"} -->
2. Scroll down to the icon at the bottom of the page.
   <!-- step {"find":{"selector":"#far","moveTo":true}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-find-moveto","detectSteps":false} */}

# Find an element and scroll to it

1. Go to [the toolbar page](http://localhost:8092/find-image.html).
   {/* step {"goTo":"http://localhost:8092/find-image.html"} */}
2. Scroll down to the icon at the bottom of the page.
   {/* step {"find":{"selector":"#far","moveTo":true}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Find an element and scroll to it

// (test {"testId":"nav-find-moveto","detectSteps":false})

. Go to http://localhost:8092/find-image.html[the toolbar page].
+
// (step {"goTo":"http://localhost:8092/find-image.html"})
. Scroll down to the icon at the bottom of the page.
+
// (step {"find":{"selector":"#far","moveTo":true}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Find an element and scroll to it</title></head>
<body>
<!-- test {"testId":"nav-find-moveto","detectSteps":false} -->
<h1>Find an element and scroll to it</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/find-image.html">the toolbar page</a>.
    <!-- step {"goTo":"http://localhost:8092/find-image.html"} --></li>
  <li>Scroll down to the icon at the bottom of the page.
    <!-- step {"find":{"selector":"#far","moveTo":true}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Find an element and scroll to it
================================

.. test {"testId":"nav-find-moveto","detectSteps":false}

#. Go to `the toolbar page <http://localhost:8092/find-image.html>`_.

   .. step {"goTo":"http://localhost:8092/find-image.html"}

#. Scroll down to the icon at the bottom of the page.

   .. step {"find":{"selector":"#far","moveTo":true}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-moveto">
  <title>Find an element and scroll to it</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-moveto","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/find-image.html" scope="external" format="html">the toolbar page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/find-image.html"}'/></info></step>
      <step><cmd>Scroll down to the icon at the bottom of the page.</cmd>
        <info><data name="doc-detective" value='step {"find":{"selector":"#far","moveTo":true}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-find-moveto",
      "steps": [
        {
          "goTo": "http://localhost:8092/find-image.html"
        },
        {
          "find": {
            "selector": "#far",
            "moveTo": true
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-find-moveto
    steps:
      - goTo: http://localhost:8092/find-image.html
      - find:
          selector: "#far"
          moveTo: true
```

### `timeout: 10000`

**Varies:** `find.timeout` · **Value:** `10000` · **Effect:** the step keeps looking for the element for up to 10 seconds.

#### Prose

#### Markdown

**`prose.md`**

```markdown title="prose.md"
# Give a late element more time

1. Go to [the late element page](http://localhost:8092/waitUntil-test-late-element.html).
2. Wait for the status line to read **System operational**.
```

#### MDX

**`prose.mdx`**

```mdx title="prose.mdx"
# Give a late element more time

1. Go to [the late element page](http://localhost:8092/waitUntil-test-late-element.html).
2. Wait for the status line to read **System operational**.
```

#### AsciiDoc

**`prose.adoc`**

```asciidoc title="prose.adoc"
= Give a late element more time

. Go to http://localhost:8092/waitUntil-test-late-element.html[the late element page].
. Wait for the status line to read *System operational*.
```

#### HTML

**`prose.html`**

```html title="prose.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Give a late element more time</title></head>
<body>
<h1>Give a late element more time</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/waitUntil-test-late-element.html">the late element page</a>.</li>
  <li>Wait for the status line to read <strong>System operational</strong>.</li>
</ol>
</body>
</html>
```

#### reStructuredText

**`prose.rst`**

```rst title="prose.rst"
Give a late element more time
=============================

#. Go to `the late element page <http://localhost:8092/waitUntil-test-late-element.html>`_.
#. Wait for the status line to read **System operational**.
```

#### DITA

**`prose.dita`**

```xml title="prose.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-timeout">
  <title>Give a late element more time</title>
  <taskbody>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/waitUntil-test-late-element.html" scope="external" format="html">the late element page</xref>.</cmd></step>
      <step><cmd>Wait for the status line to read <b>System operational</b>.</cmd></step>
    </steps>
  </taskbody>
</task>
```

#### Detected

#### Markdown

**`detected.md`**

```markdown title="detected.md"
<!-- test {"testId":"nav-find-timeout","detectSteps":true} -->

# Give a late element more time

1. Go to [the late element page](http://localhost:8092/waitUntil-test-late-element.html).
   <!-- step {"goTo":"http://localhost:8092/waitUntil-test-late-element.html"} -->
2. Wait for the status line to read **System operational**.
   <!-- step {"find":{"elementText":"System operational","timeout":10000}} -->

<!-- test end -->
```

#### MDX

**`detected.mdx`**

```mdx title="detected.mdx"
{/* test {"testId":"nav-find-timeout","detectSteps":true} */}

# Give a late element more time

1. Go to [the late element page](http://localhost:8092/waitUntil-test-late-element.html).
   {/* step {"goTo":"http://localhost:8092/waitUntil-test-late-element.html"} */}
2. Wait for the status line to read **System operational**.
   {/* step {"find":{"elementText":"System operational","timeout":10000}} */}

{/* test end */}
```

#### AsciiDoc

**`detected.adoc`**

```asciidoc title="detected.adoc"
= Give a late element more time

// (test {"testId":"nav-find-timeout","detectSteps":true})

. Go to http://localhost:8092/waitUntil-test-late-element.html[the late element page].
+
// (step {"goTo":"http://localhost:8092/waitUntil-test-late-element.html"})
. Wait for the status line to read *System operational*.
+
// (step {"find":{"elementText":"System operational","timeout":10000}})

// (test end)
```

#### HTML

**`detected.html`**

```html title="detected.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Give a late element more time</title></head>
<body>
<!-- test {"testId":"nav-find-timeout","detectSteps":true} -->
<h1>Give a late element more time</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/waitUntil-test-late-element.html">the late element page</a>.
    <!-- step {"goTo":"http://localhost:8092/waitUntil-test-late-element.html"} --></li>
  <li>Wait for the status line to read <strong>System operational</strong>.
    <!-- step {"find":{"elementText":"System operational","timeout":10000}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`detected.rst`**

```rst title="detected.rst"
Give a late element more time
=============================

.. test {"testId":"nav-find-timeout","detectSteps":true}

#. Go to `the late element page <http://localhost:8092/waitUntil-test-late-element.html>`_.

   .. step {"goTo":"http://localhost:8092/waitUntil-test-late-element.html"}

#. Wait for the status line to read **System operational**.

   .. step {"find":{"elementText":"System operational","timeout":10000}}

.. test end
```

#### DITA

**`detected.dita`**

```xml title="detected.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-timeout">
  <title>Give a late element more time</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-timeout","detectSteps":true}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/waitUntil-test-late-element.html" scope="external" format="html">the late element page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/waitUntil-test-late-element.html"}'/></info></step>
      <step><cmd>Wait for the status line to read <b>System operational</b>.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementText":"System operational","timeout":10000}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Inline

#### Markdown

**`inline.md`**

```markdown title="inline.md"
<!-- test {"testId":"nav-find-timeout","detectSteps":false} -->

# Give a late element more time

1. Go to [the late element page](http://localhost:8092/waitUntil-test-late-element.html).
   <!-- step {"goTo":"http://localhost:8092/waitUntil-test-late-element.html"} -->
2. Wait for the status line to read **System operational**.
   <!-- step {"find":{"elementText":"System operational","timeout":10000}} -->

<!-- test end -->
```

#### MDX

**`inline.mdx`**

```mdx title="inline.mdx"
{/* test {"testId":"nav-find-timeout","detectSteps":false} */}

# Give a late element more time

1. Go to [the late element page](http://localhost:8092/waitUntil-test-late-element.html).
   {/* step {"goTo":"http://localhost:8092/waitUntil-test-late-element.html"} */}
2. Wait for the status line to read **System operational**.
   {/* step {"find":{"elementText":"System operational","timeout":10000}} */}

{/* test end */}
```

#### AsciiDoc

**`inline.adoc`**

```asciidoc title="inline.adoc"
= Give a late element more time

// (test {"testId":"nav-find-timeout","detectSteps":false})

. Go to http://localhost:8092/waitUntil-test-late-element.html[the late element page].
+
// (step {"goTo":"http://localhost:8092/waitUntil-test-late-element.html"})
. Wait for the status line to read *System operational*.
+
// (step {"find":{"elementText":"System operational","timeout":10000}})

// (test end)
```

#### HTML

**`inline.html`**

```html title="inline.html"
<!DOCTYPE html>
<html lang="en">
<head><title>Give a late element more time</title></head>
<body>
<!-- test {"testId":"nav-find-timeout","detectSteps":false} -->
<h1>Give a late element more time</h1>
<ol>
  <li>Go to <a href="http://localhost:8092/waitUntil-test-late-element.html">the late element page</a>.
    <!-- step {"goTo":"http://localhost:8092/waitUntil-test-late-element.html"} --></li>
  <li>Wait for the status line to read <strong>System operational</strong>.
    <!-- step {"find":{"elementText":"System operational","timeout":10000}} --></li>
</ol>
<!-- test end -->
</body>
</html>
```

#### reStructuredText

**`inline.rst`**

```rst title="inline.rst"
Give a late element more time
=============================

.. test {"testId":"nav-find-timeout","detectSteps":false}

#. Go to `the late element page <http://localhost:8092/waitUntil-test-late-element.html>`_.

   .. step {"goTo":"http://localhost:8092/waitUntil-test-late-element.html"}

#. Wait for the status line to read **System operational**.

   .. step {"find":{"elementText":"System operational","timeout":10000}}

.. test end
```

#### DITA

**`inline.dita`**

```xml title="inline.dita"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="nav-find-timeout">
  <title>Give a late element more time</title>
  <taskbody>
    <data name="doc-detective" value='test {"testId":"nav-find-timeout","detectSteps":false}'/>
    <steps>
      <step><cmd>Go to <xref href="http://localhost:8092/waitUntil-test-late-element.html" scope="external" format="html">the late element page</xref>.</cmd>
        <info><data name="doc-detective" value='step {"goTo":"http://localhost:8092/waitUntil-test-late-element.html"}'/></info></step>
      <step><cmd>Wait for the status line to read <b>System operational</b>.</cmd>
        <info><data name="doc-detective" value='step {"find":{"elementText":"System operational","timeout":10000}}'/></info></step>
    </steps>
    <data name="doc-detective" value="test end"/>
  </taskbody>
</task>
```

#### Standalone

#### JSON

**`standalone.spec.json`**

```json title="standalone.spec.json"
{
  "$schema": "https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json",
  "tests": [
    {
      "testId": "nav-find-timeout",
      "steps": [
        {
          "goTo": "http://localhost:8092/waitUntil-test-late-element.html"
        },
        {
          "find": {
            "elementText": "System operational",
            "timeout": 10000
          }
        }
      ]
    }
  ]
}
```

#### YAML

**`standalone.spec.yaml`**

```yaml title="standalone.spec.yaml"
# yaml-language-server: $schema=https://raw.githubusercontent.com/doc-detective/doc-detective/main/src/common/dist/schemas/spec_v3.schema.json
tests:
  - testId: nav-find-timeout
    steps:
      - goTo: http://localhost:8092/waitUntil-test-late-element.html
      - find:
          elementText: System operational
          timeout: 10000
```