It make no sense to have allergy testing for eczema since doctor can just look at it, right?

Wrong. Sometimes eczema doesn't respond well to treatment, is very severe, or very persistent. In those cases, knowing if the body is reacting to something that can be avoided (like dairy, for instance) is quite useful.