thinking that sth is sth else
in mistake for sth
Children may eat pills in mistake for sweets.
Definitions from the Oxford Advanced Learner's Dictionary, 9th edition