# Clarification of Elastic Synthetic Monitoring Submit button up and down monitors actual scenarios

**URL:** <https://discuss.elastic.co/t/clarification-of-elastic-synthetic-monitoring-submit-button-up-and-down-monitors-actual-scenarios/273417>\
**Category:** Synthetics\
**Created:** [May 19, 2021, 2:28pm UTC](https://discuss.elastic.co/t/clarification-of-elastic-synthetic-monitoring-submit-button-up-and-down-monitors-actual-scenarios/273417 "2021-05-19T14:28:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sadik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sadik/32/95771_2.png) [@sadik](https://discuss.elastic.co/u/sadik)\
**Post date:** [May 19, 2021, 2:28pm UTC](https://discuss.elastic.co/t/clarification-of-elastic-synthetic-monitoring-submit-button-up-and-down-monitors-actual-scenarios/273417/1 "2021-05-19T14:28:24Z")

</div>

Hi Team,  
Please view the below of our questions/queries:

What are we trying to do?  
We are trying to validate if the page is working or not based on action of submit button in the heartbeat.yml file inline script.  
what are we expecting the output?  
IF submit succeeds, app shows up monitors in the kibana dashboard  
IF submit fails or redirects to an error page, app shows down monitors in the kibana dashboard  
What are we actually seeing?  
app shows up monitors even when submit redirects to error

Please confirm what is the actual scenario is considering as per the elastic documentation in both the scenarios of up and down monitors.

below is the sample inline script we are trying for this testing:  
'''  
step('submit form', async () =\> {  
await (await page.$('form')).evaluate(form =\> form.submit());  
});  
'''

---

<div class="post-metadata">

**Author:** ![PaulB-Elastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paulb-elastic/32/78691_2.png) [@PaulB-Elastic](https://discuss.elastic.co/u/PaulB-Elastic)\
**Post date:** [May 26, 2021, 8:33am UTC](https://discuss.elastic.co/t/clarification-of-elastic-synthetic-monitoring-submit-button-up-and-down-monitors-actual-scenarios/273417/2 "2021-05-26T08:33:08Z")

</div>

Hi @sadik, you might be better off asserting that you end up on the page you're trying to get to, rather than validating that the form itself was submitted.

For example, you could look for some content that exists on the page when the form submission is successful (making sure you specify content does not exist on the error page, so that the step fails unless it ends up on the correct page).

Something like this:

```auto
const content = await page.$('h1');
deepStrictEqual(await content.textContent(), 'Content that exists on the successful page');

```

---

<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:** [June 19, 2021, 8:33am UTC](https://discuss.elastic.co/t/clarification-of-elastic-synthetic-monitoring-submit-button-up-and-down-monitors-actual-scenarios/273417/3 "2021-06-19T08:33:43Z")

</div>

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