Selenium WebDriver Java Framework Course Limited Time Offer for $20

Selenium WebDriver Java Framework Course Limited Time Offer for $20

 

Print

Selenium RC Server Logging

Selenium RC Server Logging has two options: Server-Side Logs and Browser-Side Logs.

Server-Side Logs:

When launching Selenium server with the -log option, the server can record valuable debugging information reported by the Selenium Server to a text file.

For example: this command below will create a file named "selenium.log" under c:\SeleniumTestCase folder.

C:\selenium-java-2.39.0>java -jar selenium-server-standalone-2.39.0.jar -log c:\SeleniumTestCase\selenium.log

Content of the selenium.log file:

21:38:36.175 INFO [1] org.openqa.grid.selenium.GridLauncher - Launching a standalone server
21:38:36.379 INFO [1] org.openqa.selenium.server.SeleniumServer - Writing debug logs to c:\SeleniumTestCase\selenium.log
21:38:36.380 INFO [1] org.openqa.selenium.server.SeleniumServer - Java: Oracle Corporation 23.21-b01
21:38:36.380 INFO [1] org.openqa.selenium.server.SeleniumServer - OS: Windows 7 6.1 amd64
21:38:36.396 INFO [1] org.openqa.selenium.server.SeleniumServer - v2.39.0, with Core v2.39.0. Built from revision ff23eac
21:38:36.484 INFO [1] org.openqa.selenium.remote.server.DefaultDriverSessions - Default driver org.openqa.selenium.iphone.IPhoneDriver registration is skipped: registration capabilities Capabilities [{platform=MAC, browserName=iPhone, version=}] does not match with current platform: VISTA
21:38:36.491 INFO [1] org.openqa.selenium.remote.server.DefaultDriverSessions - Default driver org.openqa.selenium.iphone.IPhoneDriver registration is skipped: registration capabilities Capabilities [{platform=MAC, browserName=iPad, version=}] does not match with current platform: VISTA
21:38:36.544 INFO [1] org.openqa.selenium.server.SeleniumServer - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
21:38:36.545 INFO [1] org.openqa.jetty.http.HttpServer - Version Jetty/5.1.x
21:38:36.546 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
21:38:36.547 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/selenium-server,/selenium-server]
21:38:36.547 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/,/]
21:38:36.601 INFO [1] org.openqa.jetty.util.Container - Started org.openqa.jetty.jetty.servlet.ServletHandler@215bfaa5
21:38:36.601 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/wd,/wd]
21:38:36.606 INFO [1] org.openqa.jetty.http.SocketListener - Started SocketListener on 0.0.0.0:4444
21:38:36.606 INFO [1] org.openqa.jetty.util.Container - Started org.openqa.jetty.jetty.Server@6fae53e9

Another example: this example below creates a debug.log file with debug information and nnn.log file

C:\selenium-java-2.39.0>java -jar selenium-server-standalone-2.39.0.jar -debug -log c:\SeleniumTestCase\debug.log -DSelenium.LOGGER=nnn.log
Setting system property Selenium.LOGGER to nnn.log

Browser-Side Logs:

JavaScript on the browser side also logs important messages. To access browser-side logs, pass the -browserSideLog argument to the Selenium Server.

For example: this command below creates a log on the browser side under c:\SeleniumTestCase folder. If -log option is not defined, the server console will display all the debug information.

C:\selenium-java-2.39.0>java -jar selenium-server-standalone-2.39.0.jar -browserSideLog -log c:\SeleniumTestCase\browserside.log

 

Debug.log file content:

21:49:54.446 INFO [1] org.openqa.grid.selenium.GridLauncher - Launching a standalone server
21:49:54.659 INFO [1] org.openqa.selenium.server.SeleniumServer - Writing debug logs to c:\SeleniumTestCase\debug.log
21:49:54.659 INFO [1] org.openqa.selenium.server.SeleniumServer - Java: Oracle Corporation 23.21-b01
21:49:54.659 INFO [1] org.openqa.selenium.server.SeleniumServer - OS: Windows 7 6.1 amd64
21:49:54.674 INFO [1] org.openqa.selenium.server.SeleniumServer - v2.39.0, with Core v2.39.0. Built from revision ff23eac
21:49:54.674 INFO [1] org.openqa.selenium.server.SeleniumServer - Selenium server running in debug mode.
21:49:54.689 DEBUG [1] org.openqa.jetty.util.Container - add component: SocketListener0@0.0.0.0:4444
21:49:54.702 DEBUG [1] org.openqa.jetty.util.Container - add component: org.openqa.jetty.http.ResourceCache@630ed791
21:49:54.706 DEBUG [1] org.openqa.jetty.util.Container - add component: org.openqa.selenium.server.ProxyHandler in HttpContext[/,/]
21:49:54.706 DEBUG [1] org.openqa.jetty.util.Container - add component: HttpContext[/,/]
21:49:54.708 DEBUG [1] org.openqa.jetty.http.HttpServer - Added HttpContext[/,/] for host *
21:49:54.708 DEBUG [1] org.openqa.jetty.util.Container - add component: org.openqa.jetty.http.ResourceCache@72039954
21:49:54.710 DEBUG [1] org.openqa.jetty.http.HttpContext - added SC{BASIC,null,user,CONFIDENTIAL} at /org/openqa/selenium/tests/html/basicAuth/*
21:49:54.719 DEBUG [1] org.openqa.jetty.util.Container - add component: org.openqa.jetty.http.handler.SecurityHandler in HttpContext[/selenium-server,/selenium-server]
21:49:54.722 DEBUG [1] org.openqa.jetty.util.Container - add component: org.openqa.selenium.server.StaticContentHandler in HttpContext[/selenium-server,/selenium-server]
21:49:54.723 DEBUG [1] org.openqa.jetty.util.Container - add component: org.openqa.selenium.server.SessionExtensionJsHandler in HttpContext[/selenium-server,/selenium-server]
21:49:54.724 DEBUG [1] org.openqa.jetty.util.Container - add component: org.openqa.selenium.server.htmlrunner.SingleTestSuiteResourceHandler in HttpContext[/selenium-server,/selenium-server]
21:49:54.725 DEBUG [1] org.openqa.jetty.util.Container - add component: org.openqa.selenium.server.htmlrunner.SeleniumHTMLRunnerResultsHandler@31b939d3
21:49:54.725 DEBUG [1] org.openqa.jetty.util.Container - add component: HttpContext[/selenium-server,/selenium-server]
21:49:54.726 DEBUG [1] org.openqa.jetty.http.HttpServer - Added HttpContext[/selenium-server,/selenium-server] for host *
21:49:54.745 INFO [1] org.openqa.selenium.remote.server.DefaultDriverSessions - Default driver org.openqa.selenium.iphone.IPhoneDriver registration is skipped: registration capabilities Capabilities [{platform=MAC, browserName=iPad, version=}] does not match with current platform: VISTA
21:49:54.765 INFO [1] org.openqa.selenium.remote.server.DefaultDriverSessions - Default driver org.openqa.selenium.iphone.IPhoneDriver registration is skipped: registration capabilities Capabilities [{platform=MAC, browserName=iPhone, version=}] does not match with current platform: VISTA
21:49:54.784 DEBUG [1] org.openqa.jetty.util.Container - add component: org.openqa.jetty.http.ResourceCache@2855e552
21:49:54.800 DEBUG [1] org.openqa.jetty.util.Container - add component: org.openqa.selenium.server.SeleniumDriverResourceHandler in HttpContext[/selenium-server,/selenium-server]
21:49:54.800 DEBUG [1] org.openqa.jetty.util.Container - add component: HttpContext[/selenium-server/driver,/selenium-server/driver]
21:49:54.800 DEBUG [1] org.openqa.jetty.http.HttpServer - Added HttpContext[/selenium-server/driver,/selenium-server/driver] for host *
21:49:54.800 DEBUG [1] org.openqa.jetty.util.Container - add component: org.openqa.jetty.http.ResourceCache@63d8aaba
21:49:54.816 DEBUG [1] org.openqa.jetty.util.Container - add component: WebDriver remote server
21:49:54.821 DEBUG [1] org.openqa.jetty.util.Container - add component: org.openqa.jetty.jetty.servlet.HashSessionManager@6a25dcb2
21:49:54.821 DEBUG [1] org.openqa.jetty.util.Container - add component: org.openqa.jetty.jetty.servlet.ServletHandler@5bbc608f
21:49:54.822 INFO [1] org.openqa.selenium.server.SeleniumServer - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
21:49:54.822 DEBUG [1] org.openqa.jetty.util.Container - add component: HttpContext[/wd,/wd]
21:49:54.822 DEBUG [1] org.openqa.jetty.http.HttpServer - Added HttpContext[/wd,/wd] for host *
21:49:54.822 DEBUG [1] org.openqa.jetty.util.Container - Starting org.openqa.jetty.jetty.Server@6fae53e9
21:49:54.824 INFO [1] org.openqa.jetty.http.HttpServer - Version Jetty/5.1.x
21:49:54.824 DEBUG [1] org.openqa.jetty.http.HttpServer - LISTENERS: [SocketListener0@0.0.0.0:4444]
21:49:54.824 DEBUG [1] org.openqa.jetty.http.HttpServer - HANDLER: {null={/selenium-server/driver/*=[HttpContext[/selenium-server/driver,/selenium-server/driver]], /selenium-server/*=[HttpContext[/selenium-server,/selenium-server]], /=[HttpContext[/,/]], /wd/*=[HttpContext[/wd,/wd]]}}
21:49:54.825 DEBUG [1] org.openqa.jetty.util.Container - Starting HttpContext[/selenium-server/driver,/selenium-server/driver]
21:49:54.825 DEBUG [1] org.openqa.jetty.http.HttpContext - Init classloader from null, sun.misc.Launcher$AppClassLoader@56a96eba for HttpContext[/selenium-server/driver,/selenium-server/driver]
21:49:54.825 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
21:49:54.825 DEBUG [1] org.openqa.jetty.util.Container - Starting HttpContext[/selenium-server,/selenium-server]
21:49:54.825 DEBUG [1] org.openqa.jetty.http.HttpContext - Init classloader from null, sun.misc.Launcher$AppClassLoader@56a96eba for HttpContext[/selenium-server,/selenium-server]
21:49:54.826 DEBUG [1] org.openqa.jetty.http.handler.AbstractHttpHandler - Started org.openqa.jetty.http.handler.SecurityHandler in HttpContext[/selenium-server,/selenium-server]
21:49:54.826 DEBUG [1] org.openqa.jetty.http.handler.AbstractHttpHandler - Started org.openqa.selenium.server.StaticContentHandler in HttpContext[/selenium-server,/selenium-server]
21:49:54.827 DEBUG [1] org.openqa.jetty.http.handler.AbstractHttpHandler - Started org.openqa.selenium.server.SessionExtensionJsHandler in HttpContext[/selenium-server,/selenium-server]
21:49:54.827 DEBUG [1] org.openqa.jetty.http.handler.AbstractHttpHandler - Started org.openqa.selenium.server.htmlrunner.SingleTestSuiteResourceHandler in HttpContext[/selenium-server,/selenium-server]
21:49:54.827 DEBUG [1] org.openqa.jetty.http.handler.AbstractHttpHandler - Started org.openqa.selenium.server.SeleniumDriverResourceHandler in HttpContext[/selenium-server,/selenium-server]
21:49:54.827 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/selenium-server,/selenium-server]
21:49:54.827 DEBUG [1] org.openqa.jetty.util.Container - Starting HttpContext[/,/]
21:49:54.827 DEBUG [1] org.openqa.jetty.http.HttpContext - Init classloader from null, sun.misc.Launcher$AppClassLoader@56a96eba for HttpContext[/,/]
21:49:54.827 DEBUG [1] org.openqa.jetty.http.handler.AbstractHttpHandler - Started org.openqa.selenium.server.ProxyHandler in HttpContext[/,/]
21:49:54.827 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/,/]
21:49:54.827 DEBUG [1] org.openqa.jetty.util.Container - Starting HttpContext[/wd,/wd]
21:49:54.827 DEBUG [1] org.openqa.jetty.http.HttpContext - Init classloader from null, sun.misc.Launcher$AppClassLoader@56a96eba for HttpContext[/wd,/wd]
21:49:54.828 DEBUG [1] org.openqa.jetty.util.Container - Starting org.openqa.jetty.jetty.servlet.ServletHandler@5bbc608f
21:49:54.828 DEBUG [1] org.openqa.jetty.jetty.servlet.AbstractSessionManager - New random session seed
21:49:54.873 DEBUG [12] org.openqa.jetty.jetty.servlet.AbstractSessionManager - Session scavenger period = 30s
21:49:54.874 DEBUG [1] org.openqa.jetty.jetty.servlet.Holder - Started holder of class org.openqa.selenium.remote.server.DriverServlet
21:49:54.875 INFO [1] org.openqa.jetty.util.Container - Started org.openqa.jetty.jetty.servlet.ServletHandler@5bbc608f
21:49:54.875 INFO [1] org.openqa.jetty.util.Container - Started HttpContext[/wd,/wd]
21:49:54.879 INFO [1] org.openqa.jetty.http.SocketListener - Started SocketListener on 0.0.0.0:4444
21:49:54.880 INFO [1] org.openqa.jetty.util.Container - Started org.openqa.jetty.jetty.Server@6fae53e9
21:53:36.088 INFO [16] org.openqa.selenium.server.SeleniumServer - Shutting down...