I download ChromeDriver and by defaults the browser language is in English, I need to change it to Spanish, and I have been unable.
public WebDriver getDrive
For me, --lang didn't work. It seems to set the language of the first opened tab, all others chrome processes are started with --lang=en-US.
What did work is the following:
DesiredCapabilities jsCapabilities = DesiredCapabilities.chrome();
ChromeOptions options = new ChromeOptions();
Map prefs = new HashMap<>();
prefs.put("intl.accept_languages", language);
options.setExperimentalOption("prefs", prefs);
jsCapabilities.setCapability(ChromeOptions.CAPABILITY, options);