Search code examples
htmlformsscalahttpgatling

Gatling: Get information out of HTML form


I'm new to Gatling and have to design a performance test. I need to login with several users, who each have different possibilities to choose from. Each possibility has the option to choose it or not and looks somewhat like this in the HTML-Code (simplified)

<input type="radio" name="Name123" value="1" checked="checked" class="uebernehmen">

I need to give the Element under name in formParam in the script. In this case, that is Name123. Like I said, the possibilities are different for each user and each possibility has a different value under name. Is there any way to get that value from the first possibility in the form?

It might be important to say, that if not obvious already, this is just a part of a form and there are various of these, packed in more HTML. One of these elements inside the form would look like this.

<tr>
  <tbody class="tagcontent" id="ID"><tr id="ID" class="kurs" >
    <td>
      <input type="radio" name="Name123" value="1" class="uebernehmen">
    </td>
    <td>
      <input type="radio" name="Name123" value="2" class="abwaehlen">
    </td>
  </tbody>
</tr>

In addition there is following block at the beginning of the form, where I need to extract the value of PersonID and AccountID, is that possible too?

<input type="hidden" name="PersonID" value="IDP">
<input type="hidden" name="AccountID" value="IDA">

Thanks in advance!


Solution

  • Use a CSS selector check like demoed in the tutorial and in the Gatling Academy.