EUCA-7289
This thing matches the DOM element by the text it contains, which has recently been escaped for XSS reasons. If the text contains special characters, like !<>? or the like, they get turned into HTML entities and don't match in the comparison anymore. Added bits in the comparison to turn them back into text to get a proper match.