Page 1 of 1

Unable to type out text "${OutputFile}"

Posted: Mon Jan 25, 2010 3:19 pm
by jlowder
Hello,

I have a Keyboard.Press(parserParams[X]); command that generates an error when trying to type out the text:

${OutputFile}

The error returned is:

Unexpected exception occured: System.ArgumentException: 'outputfile' is not a valid member of the System.Windows.Forms.Keys enumeration.
at Ranorex.Keyboard.HandleEscapeGroup(String characters, Int32& index)
at Ranorex.Keyboard.Parse(String sequence)
at Ranorex.Keyboard.Press(String sequence)
...

I'm guessing this has something to do with the way csharp variables are handled. I tried using the escape sequence in the text but that failed. How do I get Ranorex to type out this text?

Thanks,

Jason

Re: Unable to type out text "${OutputFile}"

Posted: Mon Jan 25, 2010 6:13 pm
by Support Team
The "{" is considered a special character by the Keyboard.Press(string) method (see the API documentation of that method). You need to escape that character by doubling it, i.e. write "{{" to get a "{" being typed. You can also use the Keyboard.EscapeSequence method to escape your string parameters, that method will double all the braces in the string.

Regards,
Alex
Ranorex Support Team

Re: Unable to type out text "${OutputFile}"

Posted: Mon Jan 25, 2010 8:55 pm
by jlowder
Thank you, that did it.

Jason