# Synthetics Agent Options - Playwright Configuration

**URL:** https://discuss.elastic.co/t/synthetics-agent-options-playwright-configuration/340428
**Category:** Synthetics
**Created:** [August 9, 2023, 7:23am UTC](https://discuss.elastic.co/t/synthetics-agent-options-playwright-configuration/340428 "2023-08-09T07:23:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![aisyaharifin](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@aisyaharifin](https://discuss.elastic.co/u/aisyaharifin)
#### Post date: [August 9, 2023, 7:23am UTC](https://discuss.elastic.co/t/synthetics-agent-options-playwright-configuration/340428/1 "2023-08-09T07:23:41Z")

</div>

Hello Elastic,

I would like to set the timeout to 2 minutes = 120000 ms and do the word checking for Synthetic.

This is for a Single Page Browser Test, I would like to do checking if there is a word 'DOWN' appeared in the page, I would like to create an alert for that.

How do I configure this?

Basically there is 2 things I would like to make adjustment on which is to set the Timeout to 120000 ms and also check if there is a 'DOWN' word on the page, it will alert me.

How do I do this in Single Page Browser Test?

Thank you!

 ![Screenshot 2023-08-09 at 3.15.08 PM](https://us1.discourse-cdn.com/elastic/original/3X/0/d/0d89f4f412cdfaaae243a5824849007aac82e50c.png)

---

<div class="post-metadata">

### Author: ![jkambic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jkambic/32/53306_2.png) [@jkambic](https://discuss.elastic.co/u/jkambic)
#### Post date: [August 9, 2023, 2:40pm UTC](https://discuss.elastic.co/t/synthetics-agent-options-playwright-configuration/340428/2 "2023-08-09T14:40:31Z")

</div>

Hi there @aisyaharifin - since you are wanting some custom logic here, a "multistep" monitor is actually the appropriate choice. I'll include some example screenshots.

I am assuming you want the timeout to apply to the text assertion. You can do this like I have shown below, but there are many similar ways to achieve that. If you do want a custom timeout for the page nav, you can also specify a timeout for `page.goto`, examples are in the [Playwright docs](https://playwright.dev/docs/api/class-page#page-goto).

```javascript
  // change `goto` arg to match your website
  step('navigate to page', async () => page.goto('https://www.elastic.co/'));
  // if there is 1 element with text `DOWN`, this test should pass
  step('assert text', async () => {
    expect(await page.getByText('DOWN').isVisible({ timeout: 120_000 })).toBe(true);
  });

```

You can put your script right into the UI and test your monitor out before creating it with the `Run Test` button at the bottom of the page.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/b/5bedae45460439e45ccd2742cb59d7924d5723ec.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/5/15d3e83e0dbc154c18de2b42e3d2dbe5a41bb224.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/6/4624b5aab3db53a8101157b5918f2ea413e3d65e.png)

One last thing I would note, the `playwright options` field you are filling in is not for scripting. It takes a JSON blob that contains any specific playwright options you want to pass through Synthetics to Playwright. You probably don't need it to achieve what you're looking for here.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 6, 2023, 2:41pm UTC](https://discuss.elastic.co/t/synthetics-agent-options-playwright-configuration/340428/3 "2023-09-06T14:41:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
