Unable to type out text "${OutputFile}"

Ask general questions here.
jlowder
Posts: 55
Joined: Wed Dec 30, 2009 2:56 pm

Unable to type out text "${OutputFile}"

Post by jlowder » Mon Jan 25, 2010 3:19 pm

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

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

Post by Support Team » Mon Jan 25, 2010 6:13 pm

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
.
Image

jlowder
Posts: 55
Joined: Wed Dec 30, 2009 2:56 pm

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

Post by jlowder » Mon Jan 25, 2010 8:55 pm

Thank you, that did it.

Jason