2013年10月8日火曜日

【Selenium】IEをSeleniumで起動してエラー

今日からまた新たなツール作りが始まりました。新たなツールとはIEの画面操作を自動的に実行するツールで、Excelに入力したデータをもとに登録・更新・削除するツールを作ることになりました。ツールは「Selenium」で作成することにして、Excelとの連携も必要なので、SeleniumをWrapperした「Selenium VBA」を使うことにしました。

早速、Selenium IDEで作成・変換したVBAのコードを実行すると、「Protected Mode must be set to the same value (enabled or disabled) for all zones.」というエラーが発生。

エラーについて調べると、IEのインターネットオプションのセキュリティ設定で全てのゾーンの保護モードを同じように設定しなければならないようで、SeleniumのWikiにもInternetExplorerDirverのページのRequired Configurationに記述がありました。記述のように変更して再度実行すると、IEがちゃんと起動しました。

【Required Configurationから抜粋】
On IE 7 or higher on Windows Vista or Windows 7, you must set the Protected Mode settings for each zone to be the same value. The value can be on or off, as long as it is the same for every zone. To set the Protected Mode settings, choose "Internet Options..." from the Tools menu, and click on the Security tab. For each zone, there will be a check box at the bottom of the tab labeled "Enable Protected Mode".


【参考URL】
http://code.google.com/p/selenium/wiki/InternetExplorerDriver#Required_Configuration
https://code.google.com/p/selenium/issues/detail?id=1795#c19

0 件のコメント:

コメントを投稿