How to change language in web page using Selenium(Java)?


How to change language in web page using Selenium(Java)?



Is their a way to pre-define a language for webpage? I want to load google page in Spanish, can we set property of webdriver in such a way that it load the page in Spanish.





What the URL you are using? I think you can just use this URL: google.es
– igreenfield
Apr 22 '15 at 5:32






Can i set the browser property to load pages in particular language..
– Nick
Apr 22 '15 at 6:05




1 Answer
1



Check this link:



For Firefox:


FirefoxProfile profile = new FirefoxProfile();
profile.setPreference( "intl.accept_languages", "es" );
WebDriver driver = new FirefoxDriver(profile);



For Chrome:


ChromeOptions options = new ChromeOptions();
options.AddArguments("--lang=es");
ChromeDriver driver = new ChromeDriver(options);





I thought there was nothing like that ... deleted my comment
– 0o'-Varun-'o0
Apr 22 '15 at 6:29






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

Export result set on Dbeaver to CSV

Opening a url is failing in Swift