I want to automate localization functions of a web application. According to my application when the browser language changes, application language should change automatical
Set the language code in chrome options before launching the the driver as shown below.
System.setProperty("webdriver.chrome.driver","<PATH>/chromedriver.exe");
ChromeOptions chromeoptions = new ChromeOptions();
// for japanese language
chromeoptions.addArguments("–lang= ja");
ChromeDriver driver = new ChromeDriver(chromeoptions);
driver.get("https://www.google.com");
For language codes : https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes