I have two forms, first is Login Form and the second is Purchase Form as below:
<form id="login-form">
<div>
<label for="username">Username</label>
<input type="text" name="username" required="true">
</div>
<div>
<label for="password">Password</label>
<input type="password" name="password" required="true">
</div>
</form>
In K6, the script I use to submit the form is as below and there is not issue in getting response for login form
response.submitForm({
formSelector: '#login-form',
fields: { username: 'myusername', password: 'mypassword' }
})
But I have problem submitting Purchase Form.
<form id="purchase-form" @submit.prevent="submit-form">
<div>
<label for="product">Product Name</label>
<input type="text" name="productName" required="true">
</div>
<div>
<label for="price">Product Price</label>
<input type="text" name="productPrice" required="true">
</div>
<div>
<button type="button" @click="submit()" text="submit-button">Submit</button>
<button type="button" @click="cancel()">Cancel</button>
</div>
</form>
Here in K6, what is the script or K6 code I should apply to submit the form on the button @click?