How to automate the wifi login of a captive window?

Deliberately Restricted

Yes, this is a deliberate choice by Apple's engineers. Automator – and other applications – can not intercept keystrokes sent to password fields.

The restriction is enforced by macOS. The keystrokes sent to secure text fields do not appear in the read-only copy of events sent to other observing processes.

Browsers Using Native Controls

Within a web browser that uses native macOS controls, HTML password fields are represented by a NSSecureTextField.

NSSecureTextField deliberately restricts what can see or record its input. The field also limits copying and cutting of the contents.

Other Approaches

See How I created a Python Bot to automatically log into a Captive Portal or search for script wifi login form for other related projects and tools.