Is there a way to change targets that auto attack has chosen?

As an example I'm fighting the goblin king I want to attack the totem but, auto attack chooses the king. I can run down the hall until the line to target disappears but its hit or miss whether auto attack will choose the totem next time.

I've had the same issue with barrels in the swamp, grates in the catacombs, and a few other instances. Actually auto attack chooses targets poorly quite often what am I doing wrong?