添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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?

image1920×1050 130 KB

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()
Screenshot 2023-05-02 at 18.23.581208×814 71.7 KB
              

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

Hi @vigneshshanmugam ,

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

Screenshot 2023-05-03 at 11.17.291560×193 19.4 KB