EclipseでSeleniumServer起動

触り始めて色々気になったロジックとかがあって、
Eclipse上からSeleniumって動かせないのかなと試行錯誤して
ようやくできるようになったのでメモしておきます。

これでブレークポイントを付けてseleniumServer本体の
デバッグなどができるようになります。( ´∀`)bグッ!

SeleniumServer実行

/server/src/org/openqa/selenium/server/SeleniumServer.java
を実行します。
実行時の引数には
-htmlSuite *iexplore http://yahoo.co.jp/ C:/TestSuite.html C:/Result.html
を入れておきます。

こんなエラーがでたら vol.1

FireFox

resource /customProfileDirCUSTFFCHROME relative to org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher not found
・InternetExplorer
resource /core relative to org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher not found.
selenium-server-standaloneのjarファイルを解凍すると
中のに以下のフォルダがあるので/server/srcにぶち込みます。
・InternetExplorer → coreフォルダ
FireFox → customProfileDirCUSTFFCHROMEフォルダ

こんなエラーがでたら vol.2

16:03:37.524 WARN - Failed to start: SocketListener0@0.0.0.0:4444
Exception in thread "main" java.net.BindException: Selenium is already running on port 4444. Or some other service is.
at org.openqa.selenium.server.SeleniumServer.start(SeleniumServer.java:491)
at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:300)
at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:245)
すかさずコマンドプロンプトを立ち上げて
ポート番号に紐づくPIDを検索
C:\> netstat -a -o

プロトコル ローカル アドレス 外部アドレス 状態 PID
TCP 0.0.0.0:80 HASE5201-PC:0 LISTENING 2888
TCP 0.0.0.0:135 HASE5201-PC:0 LISTENING 908
TCP 0.0.0.0:443 HASE5201-PC:0 LISTENING 2888
TCP 0.0.0.0:445 HASE5201-PC:0 LISTENING 4
TCP 0.0.0.0:523 HASE5201-PC:0 LISTENING 1888
TCP 0.0.0.0:2425 HASE5201-PC:0 LISTENING 2904
TCP 0.0.0.0:3389 HASE5201-PC:0 LISTENING 1360
TCP 0.0.0.0:4444 HASE5201-PC:0 LISTENING 3868
UDP 0.0.0.0:443 *:* 2888
UDP 0.0.0.0:523 *:* 1888

そして華麗にタスクをkill
taskkill /F /PID 3868

まとめ

これで少しseleniumがどうやって動いているのか
探検できるようになりましたヽ(´ー`)ノ