Well, in Canada (and I'd assume elsewhere, but I've not checked) our ballots include party affiliation, so it's pretty easy to tell the candidates apart if you're paying any attention at all.
Partly this is because of the way primaries work here (they are open and there is no “official” party-backed candidate).
Anyway, there is nothing stopping a candidate from claiming they prefer a party that they don’t actually hope to represent.