In Firefox in the console I can type:
$("a:contains('tekst')")
and I see
object { length: 1, ... }
When I do the same in firefox
launched by behat
with sellenium
i obtain:
SyntaxError: An invalid or illegal string was specified
Is console in firefox
under sellenium
controle works different?
What versions of Firefox and Selenium Server are you using? There are some combinations known to produce errors.