Forum Discussion
Are you using keyword tests or scripts?
In either case, this may help:
https://support.smartbear.com/viewarticle/81263/#Alert
If you are using keyword tests, we can help you put this in a code snippet.
I am using Keyword scripts and my application is desktop application.Thanks Marsha.
- AlexKaras10 years agoCommunity Hero
Hi,
> my application is desktop application.
Everything mentioned by Marsha is applicable to web applications.
For the desktop application you should examine the given dialog window in the Object Browser and try to find objects' identification parameters that are language independent and use them for NameMapping / object identification via FindChild().
For example, the system dialog window most probably will be of WndClass = '#32320' with the OK and Cancel buttons having IDs of btnOK and btnCancel accordingly (if I remember it correctly). In this cae your test code can reference them as
Sys.<process>.Window('#32320').Window('btnOK') that is language independent.
In the worst case when some given object cannot be stably and reliably identified without some language-dependent information, you may consider NameMapping configurations (https://support.smartbear.com/viewarticle/80669/).
- Raghukatta10 years agoContributor
Thanks for your replay Alex.
Below are the properties of buttons in different locals.
In German
Sys.Process("Ascend").Window("#32770", "Ascend", 1).Window("Button", "&Ja", 1)
In English
Sys.Process("Ascend").Window("#32770", "Ascend", 1).Window("Button", "&Ok", 1)
I am not moving towards conditional name mapping as there will be more countries added in future and every time I need to update Name mapping.Instead I am using data table to read the translations if required.But for clicking windows buttons using keyword scripts, I am not able to use the data table.
- Marsha_R10 years ago
Champion Level 3
Okay, if you look in Options->General->Project, there's a Default Language setting. What do you have set there?
- Raghukatta10 years agoContributor
We are using JavaScript as default language.
- Marsha_R10 years ago
Champion Level 3
If you look at the page I linked above, you'll see some examples for different kinds of alerts. The top ones happen to be in javascript so that will be easy to pick out.
To put them in a keyword test, you will choose Run Code Snippet and put the line of code you need in there
Hope this helps.