LoginSignup
0
2

More than 5 years have passed since last update.

Windows7(32bit)のIE11検証用Virtualboxイメージ作成メモ

Posted at

経緯

作っていたWEBアプリのIE11動作確認が必要になったため、Virtualbox+Selenium+IE11のWebdriverの環境構築を行ったメモ。

書いていたらこことほとんど一緒だったから、手抜き気味に:sleeping:

VMイメージ取得

昔でいうmodern.IEのページからイメージをダウンロード

image.png

日本語パック一式取得

①Windows7の32bit用言語パックをダウンロード

ここからから②IE11の日本語パック(IE11-Windows6.1-LanguagePack-x86-ja-jp.msu)をダウンロード

参考

インストール

以下の二つをインストール
①Windows7の32bit用言語パック
②IE11の日本語パック

タイムゾーンを変更
tzutil /s "Tokyo Standard Time"

地域と言語を設定
control intl.cpl
XMLファイルをインポートとして設定できるようだが、XMLファイルのエクスポート機能がなかったので手動で設定。
Powershellの6.0ならコマンドがあるのだが・・・
スクリーンショットが設定後だった・・・
image.png
image.png
image.png

NodeJSとSeleniumをとってくる

リモートデバッグが楽そうなのでNodesJSの「selenium-webdriver」を利用する。

Nodejsをインストール(v7.6以降。今回は8.1をインストール)

適当なフォルダでselenium-webdriverを準備
npm install selenium-webdriver

IEのドライバーをダウンロードして展開して同じフォルダに配置する。

Seleniumのサンプルを実行

2018/03/21時点で「selenium-webdriver」の公式ページに書いてあるサンプルに無駄な「;」があって実行できないので若干修正。
asyncはnodeの7.6以降で標準採用されているので、新しめのnodeを使いましょう。

node app.js

app.js
const {Builder, By, Key, until} = require('selenium-webdriver');

(async function example() {
  let driver = await new Builder().forBrowser('internet explorer').build();
  try {
    await driver.get('http://www.google.com/ncr');
    await driver.findElement(By.name('q')).sendKeys('webdriver', Key.RETURN);
    await driver.wait(until.titleIs('webdriver - Google Search'), 1000);
  } finally {
    await driver.quit();
  }
})();
0
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
0
2