Skip to content
CodeKruPro

Check whether a text field is enabled

Automation taskEasyAsked in: Accenture, Capgemini

Interviewers ask when you would check the enabled state. A good example: a Submit button that must stay disabled until the form is valid. Here you compare an enabled and a disabled text field.

isEnabled() - Check Enabled State

isEnabled() - Check Enabled State

isEnabled() returns true if an element can accept user input. Disabled elements return false.

Task:

  1. Navigate to https://testkru.com/Elements/TextFields
  2. Check if firstName (enabled) is enabled
  3. Check if disabledField (disabled) is enabled

Expected output:

firstName enabled: true
disabledField enabled: false
Read full tutorial on Codekru