How to configure Accept-Language?

Asked by Florian Sesser on 2013-01-07

I'd like to set the "Accept-Language" header before starting my tests so I can test a bilingual website.

Actions.py:181 has "profile.set_preference('intl.accept_languages', 'en')" -- why explicitly set the language to en? w/o this, I reckon I could set the language via the environment?

Is there a way to reset this later, after FF has already spun up, or would you recommend doing this using the browsermob proxy?

I had no success with browsermob using
    # Have browsermob overwrite the Accept-Language header so we can test the page in DE.
    import requests
    requests.post(url="http://localhost:9090/proxy/headers", data={"Accept-Language": "de"})

Any clues?

Thank you all for your time!

Question information

Language:
English Edit question
Status:
Solved
For:
selenium-simple-test Edit question
Assignee:
No assignee Edit question
Solved by:
Leo Arias
Solved:
2013-02-07
Last query:
2013-02-07
Last reply:
2013-02-06
Best Leo Arias (elopio) said : #1

Sorry, I didn't comment on this. That's a feature request. Currently we can't pass the language as a parameter to SST, and we should.

I don't know if there's an alternate way of doing it, but it doesn't seem so hard to fix. I hope I get sometime this week to work on SST.

Florian Sesser (fs-8) said : #2

Thanks Leo Arias, that solved my question.