Form elements

On this page, you can exercise interacting with different types of form elements.

Each element has a different set of attributes, such as id, name or label, and different accessibility features such as aria attributes. Use your test automation tool to interact with the elements and assert that you receive success messages after completing each challenge.

Basic text input

In this challenge, you will need to locate an input element and insert a specific value into it.

The following input has several attributes that can be used to reference it in automated tests. Try writing "Hello" in the input and see the message that appears. Then, repeat the same in your test automation tool and verify that you get the same message.

Input without proper attributes

The following input has no id or name, so selecting it in an automated test can be more difficult. Fill in the text "undefined is not a function" in the input field to see a success message. Then, repeat the same in your test automation tool and verify that you get the same message.

Reading values from the page

Often, you need to read the value a dynamic value of an element and use it in your tests. Use your test automation tool to read the from the following span element and insert it into the input field. After inserting the value, assert that a success message appears.

The value will change each time you reload the page so make sure to read it from the page and not hardcode it.

The value to enter is

Radio buttons

Radio buttons are similar to checkboxes, but only one can be selected at a time. Use your test automation tool to toggle each of the following radio buttons at least once to pass this challenge:

Checkboxes

Similarly, there can be checkboxes that need to be selected in automated tests. Each of the following checkboxes have different attributes that can be used to reference them. Unlike previous examples, these buttons may not be very accessible.

Use your test automation tool to check each of the buttons one by one and assert the success message to pass this challenge:

I did not read the terms and conditions
I am not a robot
I am a robot
I sure want to subscribe to a newsletter
I have checked all of the boxes
Alerts and prompts

The following button will trigger the browser's prompt dialog, that will expect user input. Try it first manually, and then use your test automation tool to handle the dialog and pass this challenge. After handling the prompt, assert that the correct success message appears.

The question and the correct answer will stay the same, so you can hardcode the answer in your tests.