Forum Discussion
Hi,
I have to test a desktop application that runs in 11 different languages (French, Japanese etc).
I have referred the below link for Solution:
Tried solutions:
1. Tried Name Mapping Configuration Option : But maintaining it for 11 languages seems difficult.
2. Tried to map a unique property like Screen-left, Screen-top etc as mentioned in the above solution. When the application is moved from one position to another in the screen, these values are again varying. Hence script is failing.
The tested app does not have a unique ID as it is changing dynamically.
Could anyone suggest a solution for this issue? :(
Hi,
Basically, you have only two options:
a) It is possible to identify/find required UI elements of the tested application using properties that do not depend on the language (e.g. by the id property that keeps the same unique value for any language);
b) The only way to find/distinguish between different UI elements is to use language-dependent properties (e.g. Caption).
In case a) you are a lucky one as your test code does not depend on the language and you may use either NameMapping or .FindXXX() functionality (or their combination).
In case b) you can use NameMapping Configurations or stick to .FindXXX(). I agree that maintaining a lot of configurations for NameMapping can be expensive and not practical for large complex application.
To use .FindXXX() you will need to use language-specific values for the search properties. One of the possible approaches described here long ago (I don't have direct link, sorry) was to create a reference file in a form of a table. The first column of this table contains some unique identifier used in test code, all other columns contain localized text. You will have to create a helper function that will get an identifier and required language code and return localized text. This text will be used as a value for the .FindXXX() function.
A side benefit of this design is that:
a) It can be used for partially localized applications (e.g. if localized text is not found, base one (e.g. English) is returned);
b) It can be used to verify that all tested UI elements are localized (e.g. post warning if some localized text is not found).
Related Content
- 2 years ago
Recent Discussions
Working with Visual Test
Solved2 days agoBypassing TC engine
Solved2 days ago