起動
Selenium Serverは、Chrome、FirefoxなどのWebブラウザを操作するもので、起動するときに対象のブラウザ用ドライバーを指定する必要があります。 Chromeを制御する場合、オプション"-D"にchromeのwebdriverを指定してSelenium Serverを起動します。
java -D[ブラウザ用ドライバ指定] -jar selenium-server-standalone-3.6.0.jar
Google Chromeのリモート操作を行いたい場合は、ブラウザ用ドライバ指定を以下のようにします。
webdriver.chrome.driver=[chromedriver.exeのパス]
-
サンプル
サンプル Chrome用ドライバのパスが、"./chromedriver_win32/chromedriver.exe”の場合
java -Dwebdriver.chrome.driver=./chromedriver_win32/chromedriver.exe -jar selenium-server-standalone-3.6.0.jar
起動オプション
-
ヘルプ
"-h"オプションを指定して実行すると、ヘルプを表示します。
D:\work\devel\selenium>java -jar selenium-server-standalone-3.6.0.jar -h
Usage: <main class> [options]
Options:
--version, -version
Displays the version and exits.
Default: false
-browserTimeout
<Integer> in seconds : number of seconds a browser session is allowed to
hang while a WebDriver command is running (example: driver.get(url)). If the
timeout is reached while a WebDriver command is still processing, the session
will quit. Minimum value is 60. An unspecified, zero, or negative value means
wait indefinitely.
Default: 0
-debug
<Boolean> : enables LogLevel.FINE.
Default: false
-enablePassThrough
<Boolean>: Whether or not to use the experimental passthrough mode.
Defaults to true.
Default: true
-jettyThreads, -jettyMaxThreads
<Integer> : max number of threads for Jetty. An unspecified, zero, or
negative value means the Jetty default value (200) will be used.
-log
<String> filename : the filename to use for logging. If omitted, will log
to STDOUT
-port
<Integer> : the port number the server will use.
Default: 4444
-role
<String> options are [hub], [node], or [standalone].
Default: standalone
-timeout, -sessionTimeout
<Integer> in seconds : Specifies the timeout before the server
automatically kills a session that hasn't had any activity in the last X seconds. The
test slot will then be released for another test to use. This is typically
used to take care of client crashes. For grid hub/node roles, cleanUpCycle
must also be set.
Default: 1800