Skip to content
CodeKruPro

Get Input Values

18/70

Get Input Values

locator.inputValue() returns the current value of <input>, <textarea>, or <select> elements. This differs from getAttribute('value') which returns the initial HTML attribute.

Task:

  1. Navigate to https://testkru.com/Elements/TextFields
  2. Read the pre-filled field value (ID: preFilledTextField) using inputValue()
  3. Find the last name field (ID: lastNameWithPlaceholder)
  4. Fill it with "Automation" and read back the value using inputValue()

Expected output:

Pre-filled: Codekru
After fill: Automation