How to write hyphen minus in katalon

Hi @Russ_Thomas , @duyluong and @Brandon_Hein:

Using double quotes not solved the problem.

The code:

The result:
image

Hi!

How its possible to set text with unicode?¿

Thank you!

Then try to follow the information provided above – you are likely not providing a true hyphen/minus but something else, which, depending on the character set in use at the time, is an entirely different character. That’s an almost impossible thing for us to debug remotely.

Understand: No one else (that we’re aware of) is suffering from this issue. :confused:

Let’s see if we can debug the string at least. Put this in the browser console:

var s = "Pruebas - Test"; for(var i = 0; i < s.length; i++) console.log(s.charCodeAt(i));

But DO NOT COPY MY CODE above – it’s important you take a copy of YOUR “pruebas” string with the hyphen from from YOUR SYSTEM.

You should see this in the console:

Notice the sequence 32 45 32 that is space-hyphen-space. Perhaps yours says something different?

Sorry but i am not understanding you.

I have the problem testing a windows 10 application, in web i dont have this problem.

So i dont understand how to use the console with desktop application.

Thank you!

You can still use a browser console to test a string.

If I test the string you placed here, I’m getting this character: "’" U+2019: Right Single Quotation Mark (Unicode Character)

8217 decimal is 2019 hex.

If i test my string, i’m getting the hyperminus value 45.
image

But it writes the unicode : "’" U+2019: Right Single Quotation Mark (Unicode Character)

Is the AUT using the correct locale/codepage and keyboard settings?

My keyboard and system are in Spanish but katalon is in English.

It´s the only difference.

And what about the AUT (the app you’re testing)?

It´s in spanish too. Using es-ES language settings.

Perhaps that is the issue – but I am not certain.

@duyluong I think you have enough info now to setup a test bed for this scenario on Win10.

@pablo.alvarez duluong is about 8 -10 hours away from reading this so take a break and work on something else :wink:

2 Likes

See also the following thread where a Hyphen-minus like character confused us:

Please find my Groovy class StringUtil with a method escapeNonAsciiChar(String str), which prints any UNICODE characters in the str, which is NON-ASCII, in Hex-decimal representation. You should be able to mimic the StringUtil class in Katalon Studio and use the escapeNonAsciiChar method in your Test Case script to verify your string in doubt.

Hi!

I have created an example of your class and this is the result:

Using the hyper-minus “-” it doesnt print the unicode but when i use the " —" it prints the unicode.

But the em-dash is not valid for my windows app.

So now i am so confused.

Now it is clear to me.

You intended to type “-” (Hyphen-minus) but actually you typed " —" (EM-Dash) in the problem string. You mistyped. That’s all.

Please do not ask to us why YOU typed " —" (EM-Dash).

Sorry for my late but if i copy the hyper-minus “-” on katalon studio, still not working.

I dont know how to do to write the “-” on my desktop aplication.

Thank you!

I happened to find that Microsoft Word has a feature of “AutoFormat As You Type” > “Hyphens (–) with dash (—)”.

hyphens-dash

I was surprised, this option of Word is ON as default.

Your target Windows desktop application might be as evil as Word.

This is an increasingly common feature of text editing software – including this forum software, Discourse:

Description Typed Rendered
dash X-X X-X
en-dash X--X X–X
em-dash X---X X—X

@pablo.alvarez

You should keep the evils away from yourself.

You should write your test compromising with the target.

Once you understand that your target desktop application wants Dash, you can write a string data with Dash, not Hyphen, in your tests. Then your tests will pass.