How can I change the language on a web page using Selenium (Java)?

Is this their way to predefine the language for a web page? I want to load a google page in spanish, is it possible to set the webdriver property so that it loads a page in spanish.


source to share

1 answer

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();
ChromeDriver driver = new ChromeDriver(options);




All Articles