Running Your Certify Processes With Different Locale

In my journey of automating applications, I have always involved in developing and executing the Certify Processes in the same default locale as per the system used for testing. During an automation project for an E-commerce giant in Melbourne, Australia there was a scenario of changing the locale of the application and executing the script that was already developed.

When the AUT locale is changed the date, time, currency formats are also changed according to the destination locale and this becomes a problem when the data coming from Certify has the old locale and not the new locale of the AUT.

Example: When an application locale is changed from US (en-US) to India (en-IN) the currency symbol will change to Rupee symbol () with a different number format, but the script may fail during verification due to the different number format and currency symbol being USD ($).

By default, Certify will execute the Processes with the locale of the system used for testing. To tackle this problem Worksoft has cleverly included a technique (Set AUT Locale) to change the Execution locale and execute them so that the data types affected by the locale will automatically be changed to their respective locale.

Set AUT Locale Action

Certify Processes execute in the default locale of the system used for testing, the locale that it fetches from its system variable AUT Locale. During execution Certify reads its system variable “AUT Locale” and executes in the same locale,

When you want to execute the process in a different locale, the value of the Certify’s system variable needs to be changed to the locale you want to execute.

This can be achieved by the action “Set AUT Locale”.

You can find the “Set AUT Locale” under the System Application, Window type in Certify.

This will change the execution locale in the locale you prefer.

Date Formats and Number formats will be affected by the locale you choose,

Date Formats

Number Formats

Scenario

Consider an auto generating value that is generated in an Application Under Test with Locale “en-US”

The scenario needs a verification of this value along with the currency symbol ( $100,000.00 )

From the above execution, the verification is successful in the default Certify/System locale.

Problem

When the locale of the application is changed from “en-US” to “en-IN” it auto generates the value with the Rupee symbol

Now the same Certify Process will fail in the verification because of the new currency symbol and the number format.

Error Message: “Verify failed. The following comparison failed: $100,000.00 Is Equal To  ₹ 1,00,000.00 ”

The fix

Changing the locale before execution is the key to have a successful execution because changing all the affected data is cumbersome and not the recommended practice.

Place the step “Set AUT Locale” in the beginning of the execution or the required position to automatically convert the data to its respective locale format. This changes the value of the Certify’s System Variable “AUT Locale” and data changes according to the new locale value.

Note:

  • The locale code used here is “en-IN” for India, examples of other valid locales are de-DE, en-GB, en-US, es-MX, fr-FR, it-IT, nl-nl, pt-BR etc.
  • Here the “Cost” number data type variable has the format “Currency”, this generates the currency automatically with the value.

    Contribution by Avinash Kumar

WRITTEN BY:

LEAVE A COMMENT