Approach for multilingual testing using selenium webdriver java

500 views
Skip to first unread message

Gaurav Sharma

unread,
Jan 10, 2017, 6:44:06 PM1/10/17
to webdriver
Hi,

I want to assert the chinese character and click on link text(i.e.  报告)

Can someone let me know the approach for multilingual testing using selenium webdriver java?

Thanks,
Gaurav Sharma

David

unread,
Jan 11, 2017, 12:16:26 PM1/11/17
to webdriver
That would be new to me, but I'd assume you want to make sure your test language of choice can handle other languages and/or unicode? Hopefully, copy & paste of those text will work but not sure. In terms of handling the web element like clicking text, you're safer if you go by find by ID/name/XPath/CSS rather than the other language text in case of multilanguage support issues.

If copy & paste text and the characters show up funny in your test script/code, then it might not be supported or just a display problem.

darrell grainger

unread,
Jan 11, 2017, 12:56:45 PM1/11/17
to webdriver
I guess the question is are you testing that the link text is a specific Chinese character? Or are you testing the link and it happens to be using a Chinese character? If you need to click the link and it doesn't matter that it is a Chinese character than you want to have some attribute on the link that never change when the language changes. For example <a href="some link here" qa-data='never changing attribute'>报告</a> then I find the link using the CSS "a[qa-data='never changing attribute']". The link text can change but the qa-data will always be the same.

Now if you  want to test that the link has the text 报告 then I would use a YAML file to change what you are looking for at run time. You write the test so it uses a variable for the text you are looking for. At run time you read in a YAML file with the actual text. This is probably how the developers write the website to use different language as well. You want to mimic this logic.
Reply all
Reply to author
Forward
0 new messages