# Failed to use Synthetics Test

**URL:** https://discuss.elastic.co/t/failed-to-use-synthetics-test/332181
**Category:** Elastic Observability
**Created:** [May 2, 2023, 5:55am UTC](https://discuss.elastic.co/t/failed-to-use-synthetics-test/332181 "2023-05-02T05:55:18Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jeffpang](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jeffpang](https://discuss.elastic.co/u/jeffpang)
#### Post date: [May 2, 2023, 5:55am UTC](https://discuss.elastic.co/t/failed-to-use-synthetics-test/332181/1 "2023-05-02T05:55:18Z")

</div>

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?

```auto
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:

```auto
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)

```

---

<div class="post-metadata">

### Author: ![shahzad31](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shahzad31/32/51637_2.png) [@shahzad31](https://discuss.elastic.co/u/shahzad31)
#### Post date: [May 2, 2023, 8:03am UTC](https://discuss.elastic.co/t/failed-to-use-synthetics-test/332181/2 "2023-05-02T08:03:20Z")

</div>

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?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/1/a146f16373c62b104ade264066fd306735d304a3.jpeg)

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](https://www.elastic.co/guide/en/observability/master/synthetics-create-test.html#synthetics-playwright)

Best Regards

---

<div class="post-metadata">

### Author: ![jeffpang](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jeffpang](https://discuss.elastic.co/u/jeffpang)
#### Post date: [May 2, 2023, 10:23am UTC](https://discuss.elastic.co/t/failed-to-use-synthetics-test/332181/3 "2023-05-02T10:23:13Z")

</div>

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](https://www.elastic.co/guide/en/observability/current/synthetics-private-location.html#synthetics-private-location-connect)

**Script:**

```auto
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.58](https://us1.discourse-cdn.com/elastic/original/3X/1/c/1cf1b7c31cfba660724f0a794593fd6e5ab15c4b.jpeg)

---

<div class="post-metadata">

### Author: ![vigneshshanmugam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vigneshshanmugam/32/40324_2.png) [@vigneshshanmugam](https://discuss.elastic.co/u/vigneshshanmugam)
#### Post date: [May 2, 2023, 2:20pm UTC](https://discuss.elastic.co/t/failed-to-use-synthetics-test/332181/4 "2023-05-02T14:20:53Z")

</div>

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](https://www.elastic.co/guide/en/observability/current/synthetics-private-location.html#synthetics-private-location-scaling) about scaling.

Thanks,  
Vignesh

---

<div class="post-metadata">

### Author: ![jeffpang](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jeffpang](https://discuss.elastic.co/u/jeffpang)
#### Post date: [May 3, 2023, 3:17am UTC](https://discuss.elastic.co/t/failed-to-use-synthetics-test/332181/5 "2023-05-03T03:17:47Z")

</div>

Hi @vigneshshanmugam ,

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

 ![Screenshot 2023-05-03 at 11.17.29](https://us1.discourse-cdn.com/elastic/original/3X/3/0/309127a5c371cef29bceaf79e156e74847210825.png)
