How do I use non-English keyboards with Eggplant Functional?
Users working in languages other than English may find that not all characters that they ask Eggplant Functional to type are reproduced on the SUT. Which characters are typed and which are not is dependent on the whether you are connected via Remote Desktop Protocol (RDP) or Virtual Network Computing (VNC) and the VNC server against which you are running. There are several approaches for dealing with this issue as follows:
You might find that it works best to combine the techniques described here. If you find a situation that is not handled by the approaches described here, contact Eggplant support, and we'll be glad to help you find the answer.
In version 16, Eggplant Functional added support using non-US English keyboards with RDP connections to SUTs. See Eggplant Functional Support for Non-US English Keyboards for more information.
RealVNC Server
The simplest approach for users of non-English keyboards is to connect via VNC using the RealVNC Server. RealVNC will automatically produce most characters that you will send using the TypeText command, including the unicode characters common to languages such as French, German, and Swedish. Characters that require modifier keys to type on their native keyboards (which unfortunately includes the "@" symbol in some languages) cannot be typed directly using this approach and will require a workaround as described in the Translate Function() below.
Translate() Function
If you are only able to use RDP connections, then you must currently use a workaround in order to type non-English (i.e., non-ASCII) characters. We've created a translate function() that replaces the characters that you want to type with the characters necessary to display them on the SUT. The example translate() function shown below is designed to work for German keyboards:
Translate function() example for German keyboards
function translate myString
put (Ä:>,Ö:":", Ü:"{", Y:"Z", Z:"Y") into utranslations
put keys(utranslations) into utransChars
put ("ß":"-", "?":"_","-":"/") into translations
put keys(translations) into transChars
repeat with each character of myString by reference
if it is in utransChars considering case then
put utranslations.(it) into it
else if it is in transChars considering case then
put translations.(it) into it
end if
end repeat
return myString
end translate
The function uses some advanced SenseTalk syntax. But if you're using German keyboard settings you can just plug it into your script and it should work. You would use this function by inserting it in your typeText commands like this:
typetext translate("welche Straße?")
If you put this call and the above function in a script and run it against your SUT, you should see this typed:
welche Straße?