[Ruby] Need help on passing spl characters (may be unicode characters) from keyword file

Hi All,

I need your help on the below scenario. Any help will be highly
appreciated. I am using cucumber with capybara and selenium.

In my scenario I want to verify some text displayed in the application.
The text to be verified is “Passwords can contain only letters [a–z],
numbers [0–9], periods [.], underscores [] or hyphens [-]." Please try
again. But when I ran the test it gave me an error.
I tried again by passing “Passwords can contain only letters [a”
In this scenario it ran successfully but after that when I append “-” to
it and passed “Passwords can contain only letters [a-” then it again
failed saying it cannot find the text specified.
When I saw the console window for the returned results it displayed the
text returned from the application as "Passwords can contain only
letters [a\u2013z], numbers [0\u20139], periods [.], underscores [
] or
hyphens [-]. Please try again.”
Please help me on how to pass this message from my keyword file. Please
let me know if some information is required from my side.

Thanks in Advance,
Namit

On 2012-09-01, at 9:24 AM, Namit j. [email protected] wrote:

In this scenario it ran successfully but after that when I append “-” to
it and passed “Passwords can contain only letters [a-” then it again
failed saying it cannot find the text specified.
When I saw the console window for the returned results it displayed the
text returned from the application as “Passwords can contain only
letters [a\u2013z], numbers [0\u20139], periods [.], underscores [_] or
hyphens [-]. Please try again.”

Well, I won’t be a lot of help, but the \u2013 is i) unicode, ii) an ‘en
dash’ rather than just a ‘dash’. So you’ve got a Unicode file containing
the messages. You also likely have an encoding problem somewhere. You
could change the message file to contain a dash and maybe avoid fixing
the encoding problem, or you could take a deep breath, and go after the
encoding problem

Cheers,
Bob

Thanks a lot Bob for your Quick Reply. I would investigate more about
encoding prob and let you know how it goes.

Thanks once again,
Namit