Passing email in a form for subscription

Hello K6 Community,
Can someone help me with below use case or provide some leads?

  • open a site
  • pass email address in the form and hit Subscribe button
  • verify the subscription message appears
    The issue is, the cookie needs to be cleared for each iteration as the email subscription form is only visible to new users who have not already subscribed.
    Hence, am having issues verifying even the form is being loaded after visiting the page.
    Can someone please help how this can be done?
    Thanks

If you are familiar one of the programming languages, this documentation will help you.

  const res = http.get('http://YOUR_WEBSITE');

  sleep(1);

  const checkRes = check(res, {
    'status is 200': (r) => r.status === 200
  });

And also this post will help you about clean cookie before iterations

Hi @alex977,
in addition to what @berkaykirmizioglu already suggested, we’ve recently introduced two new methods for the CookieJar API:

Regarding the form, you can check the HTML API and the relative examples.

Let me know if it helps.