How to set preferred language in Selenium for Internet Explorer?

600 views Asked by At

I am executing tests through Chrome, FF and IE. I just added IE support however some pages change their language when I browse them through IE.

I am trying to force IE to prefer English, however I don't see any matching property in InternetExplorerOptions class, additionaly there is no InternetExplorerProfile class like for Firefox.

Question: How to force IE to prefer English by Selenium or other programmatical ways?

1

There are 1 answers

3
Zhi Lv On

As far as I know, Internet Explorer does not independently control its language selections. Although you can launch the Language settings app through IE 11's menus, the operating system itself controls the language.

So, I think we can't set the preferred language in selenium for IE browser. if we want to set the default Language in IE browser, we have to change it manually. Please refer to the following steps:

Open Internet Explorer, Click Tools ,Click Internet Options, Click Languages, under the General tab.

enter image description here

Then, click the Set Language Preferences. It will open the Windows setting window.

enter image description here

From within the Language Preference section, select the language you would like to have priority Click Move up repeatedly until the language is displayed at the top of the list. Then, Click OK and restart the IE browser.