らいふうっどの閑話休題

興味のあることをゆる~く書いていく

Protractor Setting for Internet Explorer 11

Overview / 概要

this blog explain to Protractor setting for Internet Explorer 11. この記事は、Internet Explorer 11 用の Protractor の設定を説明します。

JDK setting / JDK 設定
  1. JDK Download / JDK ダウンロード f:id:ic_lifewood:20190501030756p:plain
  2. JDK install
  3. setting for Windows Environment Variable. Windows 環境変数の設定
    1. control panel open. コントロールパネルを開きます
      f:id:ic_lifewood:20190501034336p:plain
    2. System and Security click. システムとセキュリティをクリックします
      f:id:ic_lifewood:20190501031525p:plain
    3. System click. システムをクリックします
      f:id:ic_lifewood:20190501033320p:plain
    4. Advanced system setting click. システムの詳細設定をクリックします
      f:id:ic_lifewood:20190501033415p:plain
    5. Environment variable click. 環境変数をクリックします
      f:id:ic_lifewood:20190501033437p:plain
    6. setting to System variables frame システムの環境変数枠の設定
      f:id:ic_lifewood:20190501033503p:plain
      click New button. 新規ボタンをクリックします
      f:id:ic_lifewood:20190501033523p:plain
      1. type to Variable name: JAVA_HOME
      2. type to Variable value: C:\Program Files\Java\jdk1.8.0_161
      3. click OK button. OK ボタンをクリックします
    7. editing to System variables frame システムの環境変数枠の編集
      f:id:ic_lifewood:20190501033543p:plain
      path click.path 行をクリックします
      1. click Edit button. 編集ボタンをクリックします
      2. click New button. 新規ボタンをクリックします
      3. input to cursor prompt. C:\Program Files\Java\jdk1.8.0_161\bin
      4. click OK button. OK ボタンをクリックします
    8. click OK button. OK ボタンをクリックします
    9. Environment variable Window close. 環境変数ウィンドウを閉じます
  4. For your reference / 参考文献
    JDK Installation for Microsoft Windows
Windows Registory setting / Windows レジストリ設定
  1. Start regedit.exe . regedit.exe 起動します
    f:id:ic_lifewood:20190501033611p:plain
  2. Registory key search to following this. 以下のレジストリのキーを検索します
    f:id:ic_lifewood:20190501033633p:plain
    1. For 32-bit Windows / Windwos 32 bit 版
      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE
    2. For 64-bit Windows / Windwos 64 bit 版
      HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE
  3. add Registory key. レジストリのキーを追加します
    f:id:ic_lifewood:20190501033713p:plain
    Value name: iexplorer.exe
    Value data: 0
  4. End regedit.exe .
    regedit.exe 終了します
  5. For your reference / 参考文献
    1. InternetExplorerDriver
    2. Protractor test in IE
Internet Explorer 11 Browser setting / Internet Explorer 11 ブラウザ設定
  1. Start Internet Explorer 11. Internet Explorer 11 を起動します
  2. tools click. ツール をクリックします
  3. Zoom rate changed to 100% 拡大率100% に変更します
    f:id:ic_lifewood:20190501033800p:plain
  4. tools click. ツール をクリックします
  5. internet options click. インターネットオプション をクリックします
    f:id:ic_lifewood:20190501033821p:plain
  6. In General tab 全般 タブ
    f:id:ic_lifewood:20190501033842p:plain
    1. checkbox turn on チェックボックスon にします
      1. Delete browsing history on exit 終了時に閲覧履歴を削除する
  7. In Security tab セキュリティ タブ
    1. Disable protected mode for all zones 全てのゾーンで保護無効にします。
      1. Internet / インターネット
        f:id:ic_lifewood:20190501033907p:plain
      2. Local internet / ローカルイントラネット
        f:id:ic_lifewood:20190501033928p:plain
      3. Trust sites / 信頼済みのサイト
        f:id:ic_lifewood:20190501033947p:plain
      4. Restricted sites / 制限付きサイト
        f:id:ic_lifewood:20190501034010p:plain
  8. In Privacy tab プライバシー タブ
    f:id:ic_lifewood:20190501034027p:plain
    1. checkbox turn off PopUp Blocker
      ポップアップブロックのチェックボックスoff にします
  9. In Advanced tab
    詳細設定 タブ
    1. checkbox turn off
      チェックボックスoff にします
      f:id:ic_lifewood:20190501034051p:plain
      f:id:ic_lifewood:20190501034114p:plain
      1. Check for publiser's certificate revoctation
        発行元の証明書失効を確認する
      2. Check for Server certificate revoctation*
        サーバーの証明書失効を確認する*
      3. Check for Signature on downloaded programs
        ダウンロードしたプログラムの署名を確認する
      4. Warn about certificate address mismatch*
        証明書のアドレスの不一致について警告する*
      5. Warn if POST submittal is redirected to a zone that does not permit posts
        POST送信がPOSTを許可しないゾーンにリダイレクトされた場合に警告する
    2. checkbox turn on
      チェックボックスon にします
      1. Empty Temporary Internet files folder when browser is closed.
        ブラウザが閉じたとき、[Temporary Internet Files] フォルダを空にする
  10. For your reference / 参考文献
    1. Protractor test in IE
Internet Explorer Web Driver setting / Internet Explorer Web ドライバ設定
  1. Precondition / 前提 repository already cloned to `C:\work` リポジトリC:\work 配下にクローン済み
  2. move dirctory / ディレクトリ移動
            
              $ cd C:\work\\node_modules/protractor/bin/
            
          
  3. command excute. (IEDriver update) / コマンド実行 (IEDriver アップデート)
            
              $ ./webdriver-manager update --ie
            
          
  4. For your reference / 参考文献
    1. with protractor how to setup internet explorer configuration?
Protractor setting / Protractor 設定
  1. script add to package.json / package.json に script を追加
            
                example / 実装例
                "scenario": "ng e2e -c protractor.conf.js",
                "scenario:ie": "ng e2e -c protractor.ie.conf.js" <== for internet explorer
            
          
  2. create protractor.ie.conf.js. /protractor.ie.conf.js を作成 IEDriver just used an IEDriverServer3.9.0.exe. IEDriver は、 IEDriverServer3.9.0.exe を使用
            
              example / 実装例
              directConnect: false,
              capabilities: {
                'browserName': 'internet explorer',
                'platform': 'ANY',
                'version': '11'
              },
              localSeleniumStandaloneOpts: {
                jvmArgs: [
                  '-Dwebdriver.ie.driver=node_modules/protractor/node_modules/webdriver-manager/selenium/IEDriverServer3.9.0.exe'
                ]
              },
            
          
  3. For your reference / 参考文献
    1. Setting Up the Selenium Server
    2. Karma IE Testing of Polymer Elements with WebDriver
Internet Explorer 11 Click test trouble shooting / Internet Explorer 11 クリックテスト トラブル対応
If you encounter a problem of Internet Explorer 11 click test trouble, Please try the following
Internet Explorer 11 クリックテストトラブルに遭遇したら、以下のことを試して下さい。
  1. edit protractor.ie.conf.js. /protractor.ie.conf.js を編集
            
                example / 実装例
                directConnect: false,
                capabilities: {
                  'browserName': 'internet explorer',
                  'platform': 'ANY',
                  'version': '11',
                  'nativeEvents': false,     <== add parameter
                  'unexpectedAlertBehaviour': 'accept', <== add parameter
                  'ignoreProtectedModeSettings': true, <== add parameter
                  'disable-popup-blocking': true, <== add parameter
                  'enablePersistentHover': true <== add parameter
                },
                localSeleniumStandaloneOpts: {
                    jvmArgs: [
                      '-Dwebdriver.ie.driver=node_modules/protractor/node_modules/webdriver-manager/selenium/IEDriverServer3.9.0.exe'
                    ]
                },
            
          
  2. sample code / サンプルコード
          
            example / 実装例
            import { browser } from 'protractor';
            
            // branch proccessing for each browser
            export class PageOperationHelper {
              private browserNmae: string = null;       
              private BROWSER_NAME_IE = 'internet explorer';
            
              constructor() {
                // when instance created, get browserName.         
                browser.getCapabilities().then((cap) => {
                  this.browserNmae = cap.get('browserName');
                });
              }
              // for click events
              async click(targetSelector) {
                await browser.waitForAngular();         
                if (this.browserNmae === this.BROWSER_NAME_IE) {
                  // for internet explorer 11 code
                  await browser.executeScript('arguments[0].click();', targetSelector.getWebElement());
                } else {
                  // for chrome code
                  await targetSelector.click();
                }
              }
            }
          
        
  3. For your reference / 参考文献
    1. IE11 click trouble #3