Unable to do setText as file path c:\test\test.txt, slash is getting replaced by #

While setting the text c:\test\test.txt is getting replaced as c:#test#test.txt, It should set as c:\test\test.txt.

Please help me.

Did you try double slashes? \\

Or try single forward slashes /

(Yes, in most circumstances Windows accepts forward slashes in paths)

I tried c:\test\test.txt and c:/test/test.txt but same issue

Try c:\\test\\test.txt

1 Like

This also tried but no luck.

i have same problem

@satish1607, @motablate
We tested on Notepad++ and could not reproduce the issue. Here is the capturing video:


import static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject

import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows

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

Windows.setText(findWindowsObject('Object Repository/Pane'), 'c:\\test\\test.txt')

SetText keyword is equivalent to entering the given text using the current keyboard mechanism

If your language keyboard settings (on the Windows machine) is not English. Please change it to English.
If you are using any input method editor software. Please turn it off.

1 Like

Thanks @duyluong :

Could you please check while saving the notepad file and when you provide the path along with file name to store the file , its not working its getting converted from // to #.

thanks it works with me when i change my keyboard language to english