How to set the browser language of PhantomJS

前端 未结 2 580
名媛妹妹
名媛妹妹 2020-12-21 10:34

I\'m using DalekJS with PhantomJS to test a web application. I have important assertions which depend on the browser language. And these fail if the language is not English.

相关标签:
2条回答
  • 2020-12-21 11:14

    Let me answer my own question:

    The problem is solved when you use following code in your index.html:

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

    So the site will be displayed in english no matter which browser is used.

    0 讨论(0)
  • 2020-12-21 11:27

    This question has been further discussed here: https://groups.google.com/forum/#!topic/dalekjs/HHt6eoZRQc4

    0 讨论(0)
提交回复
热议问题