data driven test -- multiple language

Ask general questions here.
c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

data driven test -- multiple language

Post by c676228 » Wed May 06, 2015 7:26 pm

Hi folks,

I just want to know how Ranorex handles multiple languages from excel sheet to form fields.

If I have Chinese, Japanese, and German in excel cells, so I am thinking the key sequence is very different.
so I cannot do:
repo.language.element.PressKeys(varLanguage); //for all language
but I can do this:
repo.language.Element.SetAttributeValue("Value", "");
this should work, right?
Any comments or suggestions?

Thanks,
Betty

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: data driven test -- multiple language

Post by krstcs » Wed May 06, 2015 8:09 pm

Betty,

I would recommend putting each language in it's own data sheet and have the columns be exactly the same in each. Then you just have to change which page you are pointing at with the data connector. This can be done by changing the test data connector during the test so that it points at the correct page.


The other option is to use a database and specify the language such that the DB passes back the correct language, but that will require a rework of your tests most likely. In my opinion Excel should be left where it belongs: accounting. When working with test data, use a database to manage the data.
Shortcuts usually aren't...

c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

Re: data driven test -- multiple language

Post by c676228 » Thu May 07, 2015 12:08 am

Hi krstcs,

I understand why you prefer database instead of excel, actually I also prefer database.
For now we have a lot of excel sheets available, but no database. So I am just using it for now.

Actually my scenario is a bit different. All my data is in English except when comes to language options, it has several options with each option corresponding to its actual language, say instead of Chinese, it has Chinese characters in the dropdown list. So I have to use actual Chinese characters in data cell to make it select-able from dropdown list in the application. :( .
Not sure what is the best way.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: data driven test -- multiple language

Post by krstcs » Thu May 07, 2015 1:31 pm

Ah, ok, so you have one set of values in a drop-down that has different languages.

Are you having a problem with those characters being passed correctly from Excel to Ranorex?

One thing you could do is use the SetValue(var) method instead of PressKeys(var).

Another, if the issue is with Excel not passing UNICODE, would be to have the actual binary value of the characters stored in Excel and then convert to UNICODE in Ranorex usercode right before entering the value.
Shortcuts usually aren't...

c676228
Posts: 176
Joined: Mon Apr 06, 2015 5:40 am

Re: data driven test -- multiple language

Post by c676228 » Thu May 07, 2015 6:07 pm

Hi krstcs,

As for the SetValue, that was I thought too.

I will try the binary excel data if the first option doesn't work.

Thanks,
Betty