I am currently using Watir with Firefox and it seems that when I try to set a field with the following text:
@#$QWER7890uiop
The command I am using is the following:
text_field(:name, “password”).value=(“!@#$QWER7890uiop)
I’ve also tried this:
text_field(:name, “password”).set “!@#$QWER7890uiop)
Only the first 2 characters get entered. Is there something I can do to by pass this feature?
You need to escape the string using single quotes
'.Many characters are substituted inside double quotes.
#{}where anything the braces is interpreted as a ruby expression.#$somethingwhere$somethingis interpreted as a ruby global variable. That’s the problem with your quote above, beside not being terminated.%sis interpreted as an ERB template expression (it is interpolated).For instance:
puts "%s hours later" % 'Five'results in
"Five hours later".