javaseleniumselenium-chromedriverarquillian-drone

Chromedriver set single accept language


I am using the ChromeDriver with java and the arquillian drone Framework to test the localization of our webpage. To test the behavior on unsupported locales set in the browser we set the chromes locale via the command line argument:

--lang=it

The resulting ACCEPT-LANGUAGE-header, however, looks like this:

it-IT,it;q=0.8,en-US;q=0.6,en;q=0.4

Is there a way to keep the chromeDriver from automatically allowing en_us and en?


Solution

  • If you use Python to lauch your chromedriver instance you may consider this gist :

    https://gist.github.com/BuhtigithuB/11df8cf8d03bb236985156de204fe7b4

    And my answer here :

    WebDriver: How to specify preferred languages for Chrome


    UPDATE

    Since you specify JAVA here a gist that suppose to work for JAVA :

    https://gist.github.com/c089/a5cbb834f9b54004de9b