How to set PhantomJS browser language

I am using DalekJS with PhantomJS to test a web application. I have important statements that depend on the language of the browser. And they fail if the language is not English.

Any ideas how I can set pantomjs default browser language ??

Greetings izocan.

+2
browser testing phantomjs headless dalekjs
source share
2 answers
+2
source share

Let me answer my own question:

The problem is solved by using the following code in your index.html:

<script> localStorage.lang = 'en'; </script> 

Thus, the site will be displayed in English regardless of which browser is used.

+1
source share

All Articles