Use IBM Rational Test Workbench 8.5.1 for localized testing

For a test that is recorded on a mobile device, the test script is generated in the default language of the application. Sometimes however, the language defined for the device running the test is different from the language of the test script. Learn how to localize strings in a test script and use IBM Rational Test Workbench to run a recorded test in the default language of the mobile device that is running the test.

Sanjay Singh, Automation lead , IBM

author photoSanjay Singh is the Automation Lead working on automation for the telecommunications industry. He has worked on business analytics and business intelligence technology. His areas of interest are computer security, system programming, and data mining.



Sachchidanand Singh, Business intelligence consultant, IBM

authorSachchidanand Singh is a Business intelligence technical consultant who works on enablement and implementation of the Cognos BI product suite. He has been involved in the analysis, design, maintenance, and testing of mainframe applications.



05 April 2014

Also available in Chinese Russian

Introduction

When you record a test on a mobile device, the test is always generated in the default language of the application. However, it is possible that the language defined for the device running the test is different from the default language of the application. This language difference between the mobile device and the application means that to replay the test on the mobile device, you need to convert the mobile strings in the test script into the localized strings of the application. With IBM® Rational® Test Workbench, you can run a recorded test in the default language of a mobile device by using different localized strings.

Note: The application must be localized to be able to take advantage of this feature of Rational Test Workbench.


Prerequisites

You need access to the following software, applications, and test:

  • Rational Test Workbench 8.5.1.1: Installed and configured with the Rational Test mobile client installed on a virtual machine or mobile device.
  • A mobile application that contains translation strings: To be able to convert the standard strings in the test script into localized strings, verify that the application under test contains translation strings.
  • A created and recorded test that is to be replaced by localized strings: You can convert all the mobile strings into localized strings in the tests at one time, or convert them one by one.
  • Android (versions 2.2 to 4.4): Download the latest SDK.

General process to convert strings in a test script

By using the Rational Test Workbench you can create test scripts by recording user actions on a mobile application. If the locale of the mobile application changes, however, the recorded scripts are of no use. In this situation, you need to change locales in the test scripts and then run the scripts on a mobile application that has a different locale.


Before you get started

Prepare to follow the steps in this article by performing the following tasks.

  • Back up the Rational Test Workbench environment using a proven method before you make any file changes.
  • Test your changes in a development environment before you roll them out to a production environment.
  • Determine whether your localized language is supported in Rational Test Workbench 8.5.1. Check the following list:
    • ar- Arabic
    • bg- Bulgarian
    • ca- Catalan
    • cs- Czech
    • da- Danish
    • de- German
    • el- Greek
    • es- Spanish
    • fa- Persian
    • fi- Finnish
    • fr- French
    • hu- Hungarian
    • nl- Dutch
    • pl- Polish
    • pt- Portuguese
    • ro- Romanian
    • ru- Russian
    • sk- Slovak
    • sl- Slovenian
    • sr- Serbian
    • sv- Swedish
    • th- Thai
    • tr- Turkish
    • uk- Ukrainian
    • vi- Vietnamese

Note: This list is not exhaustive. To see a detailed list of all of the available, supported locales, open a test and go to Test Element Details as shown in Figure 1. Click the drop-down arrow in the field next to Used local for localized strings to see the complete list.

Figure 1. List of supported locales
Drop-down list for locale for localized strings

Click to see larger image

Figure 1. List of supported locales

Drop-down list for locale for localized strings

Verify that the application has been localized

The following steps apply to Android and iOS applications under test. The phrase mobile strings means the graphic objects, such as the buttons or objects that are identified by text strings in the test script recording. You can convert all the mobile strings into localized strings in your tests at one time, or you can convert them one by one.

  1. In the mobile application node of the Test Navigator view, double-click your application file or click the display available mobile applications icon on the toolbar. In the Mobile Applications editor that opens, select an application from the list.
  2. In the right pane of the editor, click the Localized Strings tab. As shown in Figure 2, a table displays the translation keys that are found in the application for the mobile strings.
  3. Click the Locale column heading to see the languages handled by the application. You can apply filters to sort the data items in the table. By default, the filter applies to the key, but you can filter strings or locales. To do so, enter a value in the filter field and click one of the following icons:
    • Filter using key to filter the keys
    • Filter using key to filter the strings
    • Filter using locale to filter the locales
  4. Check that you find the appropriate translated strings in the target language of the mobile device that will be used to run the test.
Figure 2. Localized strings
List of keys and strings for locales

Convert the full set of mobilestrings into localized strings

To convert the full set of mobile strings in your test script into localized strings of the application, follow these steps:

  1. In the Test Navigator view, double-click your test file or right-click and click the Test editor to edit the test.
  2. In the test script, right-click on the root node and click Convert mobile strings into localized strings. As shown in Figure 3, the Localize mobile strings in test wizard opens.
Figure 3. Localized mobile strings in test
text: List of strings to be localized
  1. Click the Locale column heading in the table and select the correct locale for the translation of the strings. This must be the local string used on the device during the test recording.
    Note: For iOS devices, you can have device-specific locales in the list. For example, you might record a test on a device set to English locale (En). Check for other options. If you record a test on an iPhone, use the locale en_iPhone. If you record a test on an iPad, use the locale en_iPad.
  2. As a result, the table displays the translated strings available in the application. The rows containing translated strings are checked. If several keys are available for a string, you need to select a key.
  3. In the next cell, click Select key and choose the appropriate key in the list. Click Finish.

As shown in Figure 4, in the test script you can see that the localized strings are underlined. If you click on a localized string in the test script that corresponds to a graphic object identified by text, you can see in the right pane that the Text field contains multiple choices for the current string. The mobile strings have been converted to localized strings. They are underlined in the test script.

Figure 4. Localized test contents
List of steps in the test

Convert a single mobile string into a localized string

In the test script, select the Launch application node. In the right pane, click Used locale for localized strings and select a language the local string used to record the test script. If your test contains instances of other applications or several nodes, click the Apply selected locale to and select one of the choices: Apply locale to the same application node or Apply locale to all application nodes.

Select the node containing the mobile strings converted to localized strings and right-click the Text edit in the right pane, then choose Convert string to localized string. In the test script, you can see that the localized strings are underlined. If you click on a localized string in the test script that corresponds to a graphic object identified by text, you can see in the right pane that the Text field contains multiple choices for the current string.


Convert localized strings into standard strings

Convert the localized strings in your test into standard strings. If you want to have the localized strings or the localization keys as standard values in your test script, you need to convert the mobile strings into standard strings in the test script.

  1. In the test, click the mobile app element that represents the mobile app that contains a localized string. In the right pane, right-click the Text field. A list that contains multiple choices for the selected string is displayed, as shown in Figure 5. You can filter the list.
  2. Double-click the string of your choice in the list and click Convert into standard string using localized string as value to have the selected, localized string in the test or Convert into standard string using localization key as value to have the associated key in the test.
Figure 5. Localized strings settings
Settings options for the selected string
  1. Save and replay your test. You can run the test in different language environments.
  2. In the test report, you can see that the object names and the text are displayed in the new target language.

Summary

This article explains how you can run existing test scripts on mobile applications that are not in English but in some other locale. It describes how to localize test scripts by using Rational Test Workbench. This process saves you the effort of re-creating test scripts for different locales.

Resources

Learn

Get products and technologies

  • Download Rational Test Workbench, which includes Rational Integration Tester, from Passport Advantage.
  • Download a free trial version of Rational software.
  • Evaluate other IBM software in the way that suits you best: Download it for a trial, try it online, use it in a cloud environment, or spend a few hours in the SOA Sandbox learning how to implement service-oriented architecture efficiently.

Discuss

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Rational software on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational
ArticleID=967791
ArticleTitle=Use IBM Rational Test Workbench 8.5.1 for localized testing
publish-date=04052014