Synthetic monitoring for url redirect

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)
step 2: this https://example.com will be redirecting to 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.

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');
           });

Hi @rahul_sirugudi,

I think using the Playwright method 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.

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