Unmatched Escape Characters {

Ask general questions here.
Kroh
Posts: 2
Joined: Tue Dec 04, 2018 11:00 pm

Unmatched Escape Characters {

Post by Kroh » Tue Dec 04, 2018 11:24 pm

I'm currently trying to extract randomly generated passwords from an outlook email. The issue I'm running into is grabbing the left bracket escape character. Is there any way of extracting the left bracket or does Ranorex just get upset when it encounters it?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 4047
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Unmatched Escape Characters {

Post by odklizec » Wed Dec 05, 2018 8:42 am

Hi,

Could you please describe in more details, what exactly do you want to achieve? You can do whatever you want with strings in Ranorex, either using code or regexes. The problems is, that without more details (maybe even Ranorex snapshot or example of text you want to process), it's pretty hard to suggest something reliable ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

ahoisl
Certified Professional
Certified Professional
Posts: 128
Joined: Fri Sep 07, 2007 8:16 am

Re: Unmatched Escape Characters {

Post by ahoisl » Wed Dec 05, 2018 9:48 pm

I guess you refer to the the exception "Unmatched escape character '{' found at..." that is thrown when you pass a key sequence to a Press method containing a '{' character. The curly brace '{' character is used in key sequences to signal an escape group that specifies repeated or special characters (see here for more info). Therefore, the '{' needs to be escaped by another '{', i.e. "{{", to output a single "{" in the UI.

My guess is that you want the '{' to be really typed into a text field by Ranorex and not use it to specify some special characters. You can simply escape a text in order to output it literally by calling the Keyboard.EscapeSequence method on the string.

Regards,
Alex
Ranorex Team

Kroh
Posts: 2
Joined: Tue Dec 04, 2018 11:00 pm

Re: Unmatched Escape Characters {

Post by Kroh » Wed Dec 05, 2018 11:27 pm

Alex,

That was exactly what I was having issues with, sorry for giving a less than informative description. That method solves the problem of inputting the key sequence into a textbox without Ranorex getting upset.

Thanks for the help!