jeudi 8 octobre 2015

selenium change language browser chrome / firefox

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.

That's a pity because many of my content is changing regarding the language.

Here is my python code :

@classmethod
def setUpClass(cls):
    super(SeleniumTestCase, cls).setUpClass()
    options = Options()
    options.add_argument('--lang=en')
    cls.selenium = WebDriver(chrome_options=options)

So normally I change the language but nothing happen..

Thanks in advance !

Aucun commentaire:

Enregistrer un commentaire