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

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

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.

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.

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.

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

Thanks.

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.

{
    "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"
  }

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