Set text does not display integers correctly

Whenever I type a String, the numbers do not display correctly. Here is an example and the result I obtained."
Windows.startApplicationWithTitle(‘C:\Program Files (x86)\Notepad++\notepad++.exe’, ‘’)
Windows.setText(findWindowsObject(‘Object Repository/NotePad/Pane’),“1234ABCD” )
this String “1234ABCD” is displayed like this in notepad: &é"'ABCD

Hi,

It seems like typical symptoms of a mismatch between the keyboard input language and the application’s language. Please Check Keyboard Input Language same as language in Notepad ("Settings" > "Preferences" > "New Document" and select the language that matches your keyboard input language) and Check Katalon Studio Language Settings ("Window" > "Katalon Studio Preferences" > "Katalon" > "Language").

In Notepad++, check the encoding settings to ensure it matches your keyboard input language. Go to “Encoding” > “Character Sets” and select the correct encoding that corresponds to your keyboard language.

you can also try to change selection method from Xpath to Attributes or vice versa.

try to change keyboard input language setting

Thanks for your reply, I’ve solved the problem.
I check the keyboard language and it’s not English. I use the keyboard shortcut ALT+SHIFT to change the language.


import java.awt.im.InputContext
import java.awt.Robot
import java.awt.event.KeyEvent

def robot = new Robot()


def inputContext = InputContext.getInstance()
def locale = inputContext.locale

if(locale.language!='en')
{
        //Press ALT+SHIFT simultaneously
	robot.keyPress(KeyEvent.VK_ALT)
	robot.keyPress(KeyEvent.VK_SHIFT)
	// Release ALT+SHIFT
	robot.keyRelease(KeyEvent.VK_SHIFT)
	robot.keyRelease(KeyEvent.VK_ALT)

}

Windows.startApplicationWithTitle('C:\\Program Files\\Notepad++\\notepad++.exe', '')

Windows.click(findWindowsObject('Object Repository/Notepad/Button'))

Windows.setText(findWindowsObject('Object Repository/Notepad/Pane'), '1234ABCD')
2 Likes