The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:
Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Software Testing >> Automated Testing

Pages: 1
Tarun_K
Advanced Member


Reged: 01/21/07
Posts: 646
Loc: Bangalore, India
Test Automation for different locales
      #681433 - 08/07/11 11:23 PM

I posted this question in another forum and reporting it here to get different perspective.

I have begun with automation for a product which is in one language and soon to be ported in another. The only good thing is - Test Automation is just begun.

So there are two things which worry me - hard coded Strings (app title, alert messages etc) in Test Scripts and Test Data which should be keyed in depending on locale.

I was thinking of having a global variable which indicates the locale for which test is to be executed and then deciding on String/test data to be used in test method.

Now consider that I externalize the String I have in tests and then decide string of which language is to be used in my test method, so I could do something like -

Code:

public void myAweSomeMethodWorkingInAllLocales() {
if(locale is fr) {
testDataFile=privateLocation/frTestDataForThisLocale
testStringFile=privateLocation/frAPPStringForThisLocale
} else if (locale is in) {
testDataFile=privateLocation/inTestDataForThisLocale
testStringFile=privateLocation/inAPPStringForThisLocale
}
//Carry Out my Super tests here
}



--------------------
~ Tarun
Free Selenium Training


Post Extras: Print Post   Remind Me!   Notify Moderator  
jimhazen
Super Member


Reged: 01/31/02
Posts: 2003
Loc: Highlands Ranch, CO, USA
Re: Test Automation for different locales [Re: Tarun_K]
      #681502 - 08/08/11 07:39 AM

Tarun,

You're on the right track from what I can tell. One thing I suggest is look up (Google) information on Localization/Internationalization Programming methods or techniques.

You'll want to make your automation code behave like the application code to handle the different languages. Your idea of a Global variable (Constant) is a viable one. And then externalizing your needed strings to a file (CSV, XML, etc. you choose the format) is a good way to go.

In this instance you will have to mimic/mirror what development is doing. But as you've found out you really have to modularize and variablize your code to a certain level to accommodate the flexibility you need. Not an easy task to do and maintain. But if you do proper design up front you should be alright.

--------------------
Jim
-------------------------------------------
For all the general stuff to know about QA/Test go here http://www.softwareqatest.com/


Post Extras: Print Post   Remind Me!   Notify Moderator  
Joe StrazzereModerator
Moderator


Reged: 05/15/00
Posts: 12344
Loc: Massachusetts, USA
Re: Test Automation for different locales [Re: Tarun_K]
      #681518 - 08/08/11 09:40 AM

Quote:

I was thinking of having a global variable which indicates the locale for which test is to be executed and then deciding on String/test data to be used in test method



Years ago, I took a similar approach to testing under different locales. It worked well for me.

I used something like this during the internationalization portion of the project:
http://strazzere.blogspot.com/2010/04/pseudo-translation-of-strings-as-aid-to.html

I also externalized all the resources (strings), and had them translated for me by a professional translator.

--------------------
- Joe
Visit AllThingsQuality.com to learn more about quality, testing, and QA!

I speak only for me. I do not speak for my employer, nor for anyone else.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Tarun_K
Advanced Member


Reged: 01/21/07
Posts: 646
Loc: Bangalore, India
Re: Test Automation for different locales [Re: Joe Strazzere]
      #681602 - 08/09/11 04:33 AM

Thanks Jim, Joe for your responses...

--------------------
~ Tarun
Free Selenium Training


Post Extras: Print Post   Remind Me!   Notify Moderator  
Tarun_K
Advanced Member


Reged: 01/21/07
Posts: 646
Loc: Bangalore, India
Re: Test Automation for different locales [Re: Tarun_K]
      #681731 - 08/10/11 04:47 AM

Just wanted to share that I am using my environment variable to decide which test file is to be used depending on a locale.
locale is a global variable in context of test -

Code:

testData = fileReader
.getFileDataAsMap("/com/product/" + locale
+ "/testdata/testdata.txt");



--------------------
~ Tarun
Free Selenium Training


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 8 anonymous users are browsing this forum.

Moderator:  Elfriede Dustin, AJ, Joe Strazzere 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 1950

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5