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

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());
});
'''

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:

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

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