# Playwright script is working while testing in synthetic recorder but its networking while configure it in the monitor

**URL:** https://discuss.elastic.co/t/playwright-script-is-working-while-testing-in-synthetic-recorder-but-its-networking-while-configure-it-in-the-monitor/349859
**Category:** Synthetics
**Created:** [December 22, 2023, 2:19pm UTC](https://discuss.elastic.co/t/playwright-script-is-working-while-testing-in-synthetic-recorder-but-its-networking-while-configure-it-in-the-monitor/349859 "2023-12-22T14:19:19Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![surya\_dadi\_dhamarake](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/surya_dadi_dhamarake/32/133245_2.png) [@surya\_dadi\_dhamarake](https://discuss.elastic.co/u/surya_dadi_dhamarake)
#### Post date: [December 22, 2023, 2:19pm UTC](https://discuss.elastic.co/t/playwright-script-is-working-while-testing-in-synthetic-recorder-but-its-networking-while-configure-it-in-the-monitor/349859/1 "2023-12-22T14:19:19Z")

</div>

Hi Team,

I have recorded an activity on a website using synthetic recorder and while I am testing the script that is formed in synthetic recorder itself is working fine but when I configure the same in synthetic multipage monitor, it is not working and getting timeout error.

Can anyone please tell me what is the difference between synthetic recorder testing and synthetic monitor app testing?

Thanks,  
Surya

---

<div class="post-metadata">

### Author: ![emilioalvap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emilioalvap/32/99310_2.png) [@emilioalvap](https://discuss.elastic.co/u/emilioalvap)
#### Post date: [December 26, 2023, 2:35pm UTC](https://discuss.elastic.co/t/playwright-script-is-working-while-testing-in-synthetic-recorder-but-its-networking-while-configure-it-in-the-monitor/349859/2 "2023-12-26T14:35:55Z")

</div>

Hi @surya_dadi_dhamarake,

Explaining the difference between the recorder and hosted public locations is a nuanced topic, there're many moving parts and not all might be involved.

It would help if you could share the timeout error you're getting. Usually a timeout caused by a network delay, different elements rendered from different regions, etc.

---

<div class="post-metadata">

### Author: ![surya\_dadi\_dhamarake](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/surya_dadi_dhamarake/32/133245_2.png) [@surya\_dadi\_dhamarake](https://discuss.elastic.co/u/surya_dadi_dhamarake)
#### Post date: [December 29, 2023, 2:56am UTC](https://discuss.elastic.co/t/playwright-script-is-working-while-testing-in-synthetic-recorder-but-its-networking-while-configure-it-in-the-monitor/349859/3 "2023-12-29T02:56:19Z")

</div>

Hi @emilioalvap ,

Thanks for the reply.

That issue is resolved when I just keep timeout before the step. But I just want to run it in different operating system or different browsers. I didn't find any proper documentation in elastic to configure that. Can you please let me know if we have any documentation to follow to configure device emulation in elastic synthetic browser monitors in the kibana.

We are using elastic cloud 8.10.2 version and we have installed elastic-agent-complete 8.10.2 version in our linux node.

---

<div class="post-metadata">

### Author: ![emilioalvap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emilioalvap/32/99310_2.png) [@emilioalvap](https://discuss.elastic.co/u/emilioalvap)
#### Post date: [December 29, 2023, 3:19pm UTC](https://discuss.elastic.co/t/playwright-script-is-working-while-testing-in-synthetic-recorder-but-its-networking-while-configure-it-in-the-monitor/349859/4 "2023-12-29T15:19:01Z")

</div>

Hi @surya_dadi_dhamarake,

Unfortunately, Elastic Synthetics does not support device emulation, yet. Only supported platforms are (1) private locations with Elastic's official docker images or (2) Elastic public hosted regions. All browser monitors run on [PW's chromium](https://playwright.dev/docs/browsers#chromium).

---

<div class="post-metadata">

### Author: ![surya\_dadi\_dhamarake](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/surya_dadi_dhamarake/32/133245_2.png) [@surya\_dadi\_dhamarake](https://discuss.elastic.co/u/surya_dadi_dhamarake)
#### Post date: [December 30, 2023, 7:30am UTC](https://discuss.elastic.co/t/playwright-script-is-working-while-testing-in-synthetic-recorder-but-its-networking-while-configure-it-in-the-monitor/349859/5 "2023-12-30T07:30:22Z")

</div>

Hi @emilioalvap ,

I have observed that it is using a default user agent which includes linux. I have changed the default user agent using playwright options to use user agent which has macOS in it. It worked for my scenario. Can you please tell me what does that user agent do in elastic synthetics?

I am also seeing some limited documentation related to device emulation in elastic synthetics. [Configure Synthetics projects | Elastic Observability [8.11] | Elastic](https://www.elastic.co/guide/en/observability/current/synthetics-configuration.html#synthetics-config-device-emulation)

Thanks.

---

<div class="post-metadata">

### Author: ![abdulz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdulz/32/97601_2.png) [@abdulz](https://discuss.elastic.co/u/abdulz)
#### Post date: [January 2, 2024, 11:13am UTC](https://discuss.elastic.co/t/playwright-script-is-working-while-testing-in-synthetic-recorder-but-its-networking-while-configure-it-in-the-monitor/349859/6 "2024-01-02T11:13:00Z")

</div>

Hi @surya_dadi_dhamarake,

It's possible to change the user agent string and other browser behavior properties using `playwrightOptions` for a monitor. But the actual test will always run on chromium as Synthetics doesn't yet support true device emulation or selecting a browser.

The fact that your script started working after you changed `"userAgent"` is most likely how the webpage or a third party script on the webpage reacts to the user agent string (or to other browser parameters e.g. `"screenSize"` , `"viewport"` or `"hasTouch"`).

For example for the following `playwrightOptions` configuration, the test will run on desktop chromium, the webpage will read the below user agent and screen size. Also the available viewport will be resized to reflect the configured dimensions.

```auto
{
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Mobile/15E148 Safari/604.1",
    "screen": {
      "width": 414,
      "height": 896
    },
    "viewport": {
      "width": 414,
      "height": 715
    },
    "deviceScaleFactor": 2,
    "isMobile": true,
    "hasTouch": true,
    "defaultBrowserType": "webkit"
  }

```

---

<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: [January 30, 2024, 11:14am UTC](https://discuss.elastic.co/t/playwright-script-is-working-while-testing-in-synthetic-recorder-but-its-networking-while-configure-it-in-the-monitor/349859/7 "2024-01-30T11:14:01Z")

</div>

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