I\'m trying to test my website with selenium but I don\'t manage to change the language of the browser. I tried with firefox, changing the profile also but it\'s not working.
I have this java code please modify it in python
Using Firefox Browser :
FirefoxProfile profile = new FirefoxProfile();
//setting the locale french : ‘fr’
profile.setPreference(“intl.accept_languages”,”fr”);
driver = new FirefoxDriver(profile);
driver.get(“http://google.co.in);
Using Chrome Browser :
System.setProperty(“webdriver.chrome.driver”,”D:/DollarArchive/chromedriver.exe”);
ChromeOptions options = new ChromeOptions();
options.addArguments(“–lang= sl”);
ChromeDriver driver = new ChromeDriver(options);
driver.get(“http://google.co.in);
In python set something like below
For firefox
driver.set_preference(“intl.accept_languages”,”fr”)
For Chrome
options.add_argument(“–lang= sl”)
Hope it will help you :)