Silk Mobile

Table of Contents (Homepage)

SetLanguagePropertiesFile

images/images/os-icons/os_ios_150x150.png

images/images/os-icons/os_android_150x150.png

images/images/os-icons/os_windows_150x150.png

Description

Sets the Language properties file to be used during the script.

Parameters

  • Properties File: Full path to the language properties file which will be referenced during the execution of the test.

Example

Scenario: We will run the same test on the amazon application on English and French languages.

The script will click on the "Shop by Department" button in the application's home page.

images/download/attachments/3310620/basicReflection.PNG

Without this feature, this is how the test should look like:

images/download/attachments/3310620/basicTest.PNG

In this case, when testing the application in the French language, we'll need to change the test for every element identified by it's text property.

images/download/attachments/3310620/frReflection2.PNG


Step 1: Use the automatic Language Properties Files feature to create files for the different languages (Using Language Properties Files).

For example, for the properties file in French, 'Shop by\nDepartment' is 'Choisir une\nBoutique'.

images/download/attachments/3310620/image2015-8-11%2018_1_29.png

images/download/attachments/3310620/image2015-8-11%2018_2_1.png

Both will be recognized by the same key rs_shop_by_department_text

Step 2: Add the "SetLanguagePropertiesFile" command to the test script and enter the full path of the language property file you have created.

Step 3: Change the value of the Element parameter to the key in the properties file.

whenever a parameter will contain the pattern ${key}, Silk Mobile will try to find the substring value for that key.

If no substitution key is found, the value will not be replaced.

images/download/attachments/3310620/entest.PNG

Step 4: Now, to test the french version, we only need to change the properties file to fr.properties

images/download/attachments/3310620/frTest.PNG

Now the test will work on French and English the same.

When switching between languages, only need to change the properties file.