# Synthetic monitoring for url redirect

**URL:** https://discuss.elastic.co/t/synthetic-monitoring-for-url-redirect/328615
**Category:** APM
**Tags:** docker, synthetics
**Created:** [March 27, 2023, 11:58am UTC](https://discuss.elastic.co/t/synthetic-monitoring-for-url-redirect/328615 "2023-03-27T11:58:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rahul\_sirugudi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_sirugudi/32/94019_2.png) [@rahul\_sirugudi](https://discuss.elastic.co/u/rahul_sirugudi)
#### Post date: [March 27, 2023, 11:58am UTC](https://discuss.elastic.co/t/synthetic-monitoring-for-url-redirect/328615/1 "2023-03-27T11:58:03Z")

</div>

I am trying to configure synthetic monitoring for my website, but for some reason it is not working.

This is my scenario.

step 1: hit the url for suppose say ([https://example.com](https://example.com))  
step 2: this [https://example.com](https://example.com) will be redirecting to [https://demo.example.com](https://demo.example.com) with user name.

I am able to achieve step 1 but not sure how to achieve step 2. Any help would be appreciated.

I am running this current set up in heartbeat.yml file and i am running this inside Docker.

```auto
heartbeat.monitors:
  - type: browser
    id: elastic-website
    name: Elastic website
    schedule: "@every 1m"
    source:
      inline:
        script: |-
          step('launch application', async () => {
          await page.goto('https://example.com');
           });

```

---

<div class="post-metadata">

### Author: ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)
#### Post date: [March 27, 2023, 1:32pm UTC](https://discuss.elastic.co/t/synthetic-monitoring-for-url-redirect/328615/2 "2023-03-27T13:32:53Z")

</div>

Hi @rahul_sirugudi,

I think using the Playwright method [`wait_for_url`](https://playwright.dev/python/docs/api/class-page#page-wait-for-url) is possibly what you need:

`await page.wait_for_url('https://demo.example.com')`

I would recommend checking the documentation to see if the `timeout` and/ or `wait_until` arguments should also be specified as well.

I've not given this a try so let me know if this solves your problem.

---

<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: [April 17, 2023, 9:33am UTC](https://discuss.elastic.co/t/synthetic-monitoring-for-url-redirect/328615/3 "2023-04-17T09:33:04Z")

</div>

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