Forum Discussion

otori's avatar
otori
New Contributor
3 years ago

Multilanguage Keyword Tests

Hello,   Our Program under Test can be used with different languages. We would like to make our Keyword-Tests work independently of the selected languages.   For the object detection I read abou...
  • otori's avatar
    otori
    3 years ago

    Hello Marsha,

     

    sorry for my delayed reply.

    I already found this webpage before creating this forum thread and it was the base of my actions.

     

    First, it describes how 'Name Mapping' can be approached in a multi language program. This can also be done for my keyword tests.

    Second however, it is described how to use regular expressions for operations like 'ClickItem' (Where the value parameter is the caption of the Item).

    The example works for Script-Tests, but I could not figure out how to do this for KeywordTests. (See the attached image, where I can enter either a constant string, or a code expression, however I could not create a regex there.)

     

    My solution now is to create a ProjectSuite variable that stores the language. Then I use the following code expression to select the correct caption:

    "'german caption' if ProjectSuite.Variables.ProgLang == 'de' else ''english caption"