LoginSignup
3
2

More than 5 years have passed since last update.

nightwatchjsをphantomjsで動かすときにHTTPヘッダーを指定する方法

Posted at

phantomjsの場合は下のようにHTTPヘッダーを指定する。
複数指定するときは別のキーで登録する。
自分の場合はサーバーの環境によってブラウザの言語が日本語として認識されない問題を解決するためにAccept-Languageを指定した。

その他のcapabilitiesの設定はGhost DriverのREADMEを参照

"test_settings": {
    "default": {
      "desiredCapabilities": {
        "browserName": "phantomjs",
        "phantomjs.binary.path": "./bin/phantomjs",
        "phantomjs.page.customHeaders.Accept-Language": "ja",
        "phantomjs.page.customHeaders.X-TEST": "test",
      }
    }
  }
3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2