テスト自動化にロボットフレームワークを使用することに興味があります。
を使用するテストスクリプトを作成しました
- Robot Framework v2.6.3(Python v2.6.1を搭載)
- ロボットv2.8用のSeleniumLibrary
- Selenium Server v2.3
私のオペレーティングシステムはMacOSX 10.6.8(Snow Leopard)です。
私のテストは、Chromeドライバーを使用してGoogleChromeで正常に実行されます。ただし、Chromeはページのスクリーンショットの撮影をサポートしていません。これは、私がなくてはならない機能です。
そこで、ページのスクリーンショットをサポートするFirefox v10.0.2でテストを実行しようとしましたが、これは機能しません。
テストを開始すると、Firefoxウィンドウがポップアップし、空白のページが表示されます。pybotを強制終了するまで何も起こりません。
ロボットがSeleniumサーバーを起動することと、コマンドラインから自分でSeleniumサーバーを起動することの両方を試しましたが、役に立ちませんでした。
また、サーバーが使用するクリーンなFirefoxプロファイルを設定しようとしましたが、どちらも役に立ちませんでした。
最近のSelenium2LibraryforRobot Framework(v0.5.2)も試しましたが、Chromeでは正常に動作しますが、Firefoxでは動作しません。
また、もっと単純な「Hello World」タイプのテストも試しました。基本的には、www.google.comを開くだけですが、Firefoxではまだうまくいきません。
これらすべての場合で、動作は同じです。
- 空のFirefoxウィンドウが開きます
- ロボットフレームワークはテストケースの名前を出力してから停止します
- Seleniumサーバーが「Firefoxを起動しています」と表示して停止します
Seleniumサーバーのログファイルには、次の無限のリストが表示されます。
21:06:33.285 DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - waiting for window 'null' local frame 'null' for 1800 more secs
21:06:33.286 DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - waiting for condition for 1000 more ms
21:06:34.288 DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - got condition? : false
21:06:34.300 DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - waiting for window 'null' local frame 'null' for 1799 more secs
21:06:34.300 DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - waiting for condition for 1000 more ms
21:06:35.300 DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - got condition? : false
21:06:35.300 DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - waiting for window 'null' local frame 'null' for 1798 more secs
21:06:35.301 DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - waiting for condition for 1000 more ms
21:06:36.301 DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - got condition? : false
...等々。
SeleniumLibary(http://code.google.com/p/robotframework-seleniumlibrary/wiki/Demo)のデモも実行してみましたが、同じ結果になりました。
問題がRobotフレームワークにあることを確認するために、Firefoxを使用するJavaSeleniumテストを作成しました。これは機能します。
同じ問題を経験している人はいますか?誰かがこれを修正する方法を知っていますか?どんな助けでも大歓迎です。
私のテストスクリプトは次のようになります。
*** Settings ***
Resource resource.txt
*** Test Cases ***
Hello World
Open browser to http://www.google.de/
resources.txt:
*** Settings ***
Library SeleniumLibrary
#Library Selenium2Library
*** Variables ***
${BROWSER} firefox
#${BROWSER} googlechrome
*** Keywords ***
Open browser to ${URL}
Open browser ${URL} ${BROWSER}
ありがとう、よろしく、パトリック