I want to launch firefox browser in a given language in selenium automation. Can I do that? If so, please share some sample code implementation.
Thanks in advance.
Set the language code in fire fox profile preference before launch the the driver as shown below.
FirefoxProfile ffprofile = new FirefoxProfile();
//For japenese language
ffprofile.setPreference("intl.accept_languages","ja");
driver = new FirefoxDriver(ffprofile);
driver.get("https://www.google.com");
For language codes : https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With