Post request with unique form keys

Hello, I am a new user of k6, and for this reason, I have problems registering users. How to handle unique post requests? I want to create a test case where users try to create new accounts. When I recorded the web script with this function, I saw, that each form has unique form data (formData.boundary and form_key). Is it possible to handle this type of request?

Hi @Mada,
welcome to the community forum :tada:

Is it possible to handle this type of request?

Can you provide more context about what you’re trying to resolve? I think in the meanwhile you could read the Data Parameterization page from the documentation.

If they are not fake data, then you should also try to mask your data before posting in the forum.

I would like to make end-to-end testing where each user makes the same 3 activities on the site:

  1. Opening the homepage.
  2. User clicks on the button where he can create an account.
  3. Filling the form where a user must type data (firstName, lastName, etc…) and send the form.

I see, that each form on this site generates a unique form_key (in DOM structure) and add this information to the post request. Is it possible to take this key from the DOM structure and add it to the request which will be sent by k6?

Hi @Mada,
if you need to interact with an HTML page then the k6/html module and its Selection API is what you need. You can also find more information in the HTML Forms example.

Let me know if it helps.