Special key syntax error

Hello,

I was running a process earlier that was throwing the exception message:
image

I worked out that the string in a type into was throwing the error. The string contained square braces “[” and “]” around a number, like so: “William Coulson [0123]”. The type into picked it up as a special key, like Enter or Tab. I resolved this by running in debug and changing the value in the locals panel.

Is there any way of preventing this issue without replacing the data? I was thinking of setting SimulateType to true, but I am not sure how the bot would react. Does anybody know if setting SimulateType to true prevents the error message from coming up? Or have another solution?

Thanks in advance :smiley:

@william.coulson

Check as below

"William Coulson" + Chr(91) +"0123" + Chr(93)

Hope this may help you

Thanks

2 Likes

Hi @ksrinu070184,

Unfortunately the text is scraped off a form that the client sends us, and the data is pretty inconsistent, so the data may contain square braces, it may not. Ideally, I need to be able to prevent an error message coming up due to the square braces or any other special key symbol without replacing any of the data being written.

@william.coulson

I’m able to write without any problem, could you check the TypeInto Properties again?

Can you share your version and properties of the TypeInto?

Thanks

@william.coulson

Also, you can try with Set Text activity also

Hope this may help you

Thanks

Hi @ksrinu070184,

The type into has EmptyField, SimulateType, SendWindowsMessages all set to false. Activate is set to true. Did you try with SimulateType enabled?

@william.coulson

I don’t know about the application you are working, but I’m able to type into a google text field without any issue

Can you check in Google search text box? and let us know if you are facing the same issue

Thanks

Hi @ksrinu070184,

It works with SimulateType enabled, and doesn’t when it’s disabled. Also doesn’t work with SendWindowsMessages enabled or disabled and SimulateType disabled. Strange

Hi,

Can you try to escape the character as the following?

[[0123]

We can easily add [ character using regex etc.

Regards,

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.