i18n testing using selenium

694 views
Skip to first unread message

Sasi kumar

unread,
Jul 29, 2011, 1:41:52 AM7/29/11
to Selenium Users
Have any one used selenium for testing i18n !

Does Selenium provide any kind of I18N/L10N support? Is it possible
to verify text based on message keys from a resource file? What
about checking numbers and dates that might have a different format
because of L10N?

Tarun Bhadauria

unread,
Jul 29, 2011, 3:13:41 AM7/29/11
to seleniu...@googlegroups.com
This could be done with Language you are using with Selenium.

Manoj K

unread,
Jul 29, 2011, 3:54:26 AM7/29/11
to seleniu...@googlegroups.com
@Sasikumar

This can be done for L10n/l18n. I have implemented it in my project, for the same localization/Internationalization check. 
It is possible to do all kind of validations as same normal web pages you do. After all its  XPath/CSS matters.
Even for dates you can do it. Date format method will help you to get Changed to the required format needed. 

Sasi kumar

unread,
Jul 29, 2011, 4:17:55 AM7/29/11
to Selenium Users
how you are verifying text etc

Manoj K

unread,
Jul 29, 2011, 4:28:31 AM7/29/11
to seleniu...@googlegroups.com
@sasikumar
this can be done simply by using the verifyElementPresent or by using isTextPresent

A sample code just did for you

                 selenium.open("/espanol/");
verifyTrue(selenium.isTextPresent("Siete prioridades para EPA"));
selenium.type("searchbox", "what is spanish");
selenium.click("image");
selenium.waitForPageToLoad("30000");
boolean eg = selenium.isTextPresent("EPA en español | US EPA");
System.out.println(eg);

If this is not what you expected.  pls let me know what you need in detail

Sasi kumar

unread,
Jul 29, 2011, 4:30:43 AM7/29/11
to Selenium Users
ok i got that .i want to write code for English and use it for all
other language.say have in property file the equivalent in all
languages .

Krishnan Mahadevan

unread,
Jul 29, 2011, 4:37:07 AM7/29/11
to seleniu...@googlegroups.com
Then you should probably extend manoj's logic, but instead of putting in the hard coded values, have a logic that fetches the corresponding language text, based on a key and then use it.

String language="en";

selenium.open(DataFetcher(language).fetchURL());
verifyTrue(DataFetcher(language).fetchTextToCheck(someKey));
selenium.type("searchbox", DataFetcher(language).getTextToType(someKey));

selenium.click("image");
selenium.waitForPageToLoad("30000");
boolean eg = selenium.isTextPresent(DataFetcher(language).getTextToCheck(someKey));
System.out.println(eg);

You can think through on the logic to be incorporated for the DataFetcher class, which takes in the language as an arguement and basically fetches a row of data for every language and then uses some key to fetch the actual text.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"




--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


Noi

unread,
Jul 3, 2012, 1:59:35 AM7/3/12
to seleniu...@googlegroups.com
Can you elaborate by giving a small example of it.

Karthik M S

unread,
Jul 15, 2020, 1:48:20 AM7/15/20
to Selenium Users
Hi Guys,

Can anyone help me to automate Internationalization with C# Selenium?

Thanks,
Karthik

Ankit Mundra

unread,
Jul 15, 2020, 2:02:44 AM7/15/20
to Selenium Users
Just in case if you are using Java. then you can use PropertyResourceBundle. which can help with the Locale management for the languages.
Write your code in English. And verify the messages in whatever locale you would like to.
Reply all
Reply to author
Forward
0 new messages