Failed to use Synthetics Test

Failed to use Synthetics Test with the below steps.
Steps are recorded with the recorder.
It is working if the URL is changed to www.google.com.hk.
May I know how to troubleshoot for this please?

step('Go to https://www.fwd.com.hk/online-insurance', async () => {
  await page.goto('https://www.fwd.com.hk/online-insurance/', { timeout:0});
  await expect(page).toHaveTitle(/FWD/);

Below are the errors:

page.goto: Navigation failed because page crashed!
=========================== logs ===========================
navigating to "https://www.fwd.com.hk/online-insurance", waiting until "load"
============================================================
    at Step.eval [as callback] (eval at loadInlineScript (/usr/share/elastic-agent/.node/node/lib/node_modules/@elastic/synthetics/src/loader.ts:85:20), <anonymous>:4:14)
    at Runner.runStep (/usr/share/elastic-agent/.node/node/lib/node_modules/@elastic/synthetics/src/core/runner.ts:211:18)
    at Runner.runSteps (/usr/share/elastic-agent/.node/node/lib/node_modules/@elastic/synthetics/src/core/runner.ts:261:16)
    at Runner.runJourney (/usr/share/elastic-agent/.node/node/lib/node_modules/@elastic/synthetics/src/core/runner.ts:351:27)
    at Runner.run (/usr/share/elastic-agent/.node/node/lib/node_modules/@elastic/synthetics/src/core/runner.ts:445:11)
    at Command.<anonymous> (/usr/share/elastic-agent/.node/node/lib/node_modules/@elastic/synthetics/src/cli.ts:133:23)

Helllo @jeffpang , Welcome to Elastic discuss forum.
I am glad you are using Elastic synthetics.

So with little modification i have been able to run the script you provided. Though i am unable to recreate Navigation failed because page crashed! error this seems most likely an issue with webpage itself. Would you be able to provide more info, when you see that error?

Regarding script even though we are using playwright, our assertions are bit different so title assertion will work like this

expect(await page.title()).toContain("FWD");

We are working to support all assertions. here is more about this difference Write a synthetic test | Observability Guide [master] | Elastic

Best Regards

Hi @shahzad31 ,

Thanks for your reply.
I found out that the same script is working when using location from Elastic Infra.
However, it fails when we choose a private location.
The private location we used is a container running in EKS.

Docs here

Script:

step('Go to https://www.fwd.com.hk/online-insurance', async () => {
  await page.goto('https://www.fwd.com.hk/online-insurance/', { timeout:0});
  await page.locator('.popup-close-button').click();
  await Promise.all([
    page.waitForNavigation(),
    page.locator('.sc-eCYdqJ a .sc-iAvgwm').first().click()
  ]);
});

Hi @jeffpang,

Could you tell us about the Memory and CPU used on the private location? The page crashing error is highly likely due to limited memory on the instance itself.

We usually recommend 2GiB memory for running browser monitors. Please read the private location docs about scaling.

Thanks,
Vignesh

1 Like

Hi @vigneshshanmugam ,

Thanks so much!
After increased the memory to 2G (of the pod), it runs successfully!

2 Likes