was surprised to seeFollows a clause describing what someone saw and expresses surprise at seeing it. The の nominalizes the preceding clause, while を見て驚いた means “was surprised upon seeing.”
JA: 私は彼が一人で料理しているのを見て驚いた。
EN: I was surprised to see him cooking by himself.