Sending keyboard input in appropriate layout
I'm testing a dual-language application. How can I teach WinRunner to send keyboard input in correct layout?
For example, I have such string in my script:
edit_set ("ThunderRT6TextBox_1", "Test string");
During playback my keyboard is switched to Russian layout. In this case Russian letters are sent to the textbox.
Of course I can send Alt+Shift to switch between locales, but in fact I don't know what locale is active at the moment.
What can you recommend to solve this problem?
Re: Sending keyboard input in appropriate layout
If you are talking about sending different strings based on a setting, I suggest a lookup table for those strings involved, or use a data-driven approach for those fields.
Such a lookup table could look like:
mystrings["cust_name"] = "Mr Blobby";
edit_set("customer name", mystrings["cust_name"]);
When you load the lookup table you would choose which strings to put in based on your setting.
If this would change frequently during the tests, to save reloading the array you could put all the strings into it, and do something like:
mystrings["english", "cust_name"] = "Mr Blobby";
mystrings["russian", "cust_name"] = "Comrade Blobby";
edit_set("customer name", mystrings[language,"cust_name"]);
Also remember that type() can do more flexible things with keyboard strings than edit_set().
I hope this gives you some more ideas.
[This message has been edited by misha_v (edited 03-16-2003).]