How to list a form's components?

I don’t think you can see the name of a component programmatically, unless it has changed recently (here is a very old FR about it)

You can read other properties, including tag, you can also get the dom node and read the html attributes, but I don’t think you can get the Anvil name.