How can withwin runner to make single scripts which supports multiple languages?

How can withwin runner to make single scripts which supports multiple languages?

Actually, We can have scripts that run for different locales.I have a set of scripts that run for Japanese as well as English Locales. Idea is to have objects recorded in GUI Map with a locale independent physical description. This can be achieved in two ways :

> After recording the object in the GUI Map, inspect the description and ensure that no language specific properties are used. For ex: html_name property for an object of class: 

> html_text_link could be based on the text. we can either remove these language dependent properties if it doesnt really affect our object recognition. If it does affect, We need to find another property for the object that is locale independent. This new property may be something thats already there or we need to create them. This leads to the next option

> Have developers assign a locale independent property like \'objname\' or something to all objects that we use in your automated scripts. Now, modify our GUI Map description for the particular object to look for this property instead of the standard locale dependent properties recorded by WR these default properties are in GUI Map Configuration. We could also use a GUI map for each locale. Prefix the GUI map name with the locale, jpn_UserWindow.gui and enu_UserWindow.gui and load the correct map based on the current machine locale. Specifically, we can use the get_lang() function to obtain the current language setting, then load the appropriate GUI map in our init script. Take a look at the sample scripts supplied with WinRunner for the flight application. I think those scripts are created for both English and Japanese locales.

          After taking care of different GUIs for different locales, the script also needs some modification. If we are scripting in English and then moving on to any other language, all the user inputs will be in English. Due to this the script will fail as it is expecting a Japanese input for a JPN language. Instead of using like that, assign all the user inputs to a variable and use the same wherever the script uses it. This variables has to be assigned (may be after the driver script) before we call the script which we want to run. We should have different variable scripts for different languages. Depending on the language you want to run, call the appropriate variable script file. This will help to run the same script with different locale. 


By:UMANG
Date:2029-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related TESTING Subjective Links

TESTING Subjective interview questions and answers for experienced and fresher