|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.unitedinternet.portal.selenium.utils.logging.LoggingCommandProcessor
public class LoggingCommandProcessor
Logs processed selenium commands (processed via remote-control) with an arbitrary LoggingResultsFormatter. The formatter is responsible for writing logging events. A List of Selenium-Commands can be excluded from logging. Default is "getHtmlSource". Calls to selenium from within com.thoughtworks.selenium.Wait will be filtered and logged only once. Wait should not be the last command in execution (except in error, eg. timeout situation), as there is no way up to now to know that the last Wait is not a timed-out one. TODO selenium calls inside Wait are only logged once (filtered else) make this configurable TODO make name of a "Wait" class configurable TODO (feature) count time taken inside a Wait and logg that, too TODO (feature) add more metrics. currently verification errors can not be reliable counted
Constructor Summary | |
---|---|
LoggingCommandProcessor(com.thoughtworks.selenium.CommandProcessor commandProcessor,
LoggingResultsFormatter myFormatter)
Constructor. |
|
LoggingCommandProcessor(java.lang.String serverHost,
int serverPort,
java.lang.String browserStartCommand,
java.lang.String browserUrl,
LoggingResultsFormatter myFormatter)
Will create an HttpCommandProcessor for you. |
Method Summary | |
---|---|
java.lang.String |
doCommand(java.lang.String commandName,
java.lang.String[] args)
Extends doCommand, handling special logging commands. |
boolean |
getBoolean(java.lang.String commandName,
java.lang.String[] args)
|
boolean[] |
getBooleanArray(java.lang.String commandName,
java.lang.String[] args)
|
java.lang.String[] |
getExcludedCommands()
List of Selenium commands to be excluded from logging. |
java.lang.Number |
getNumber(java.lang.String commandName,
java.lang.String[] args)
|
java.lang.Number[] |
getNumberArray(java.lang.String commandName,
java.lang.String[] args)
|
java.lang.String |
getString(java.lang.String commandName,
java.lang.String[] args)
|
java.lang.String[] |
getStringArray(java.lang.String commandName,
java.lang.String[] args)
|
boolean |
isLogMethodsAsComments()
|
boolean |
isTestFailed()
Is the current test failed. |
static LoggingBean |
presetLoggingBean(java.lang.String commandName,
java.lang.String[] args,
java.lang.String result,
long cmdStartMillis,
long cmdEndMillis)
Remember any selenium command with its result as an SeleniumLoggingBean. |
void |
setCallbackNotifier(LoggingNotifier callbackLoggingNotifier,
java.lang.Object callbackLoggingInstance)
Set the call back notifier. |
void |
setExcludedCommands(java.lang.String[] excludedCommands)
List of Selenium commands to be excluded from logging Be aware that the defaults will be overwritten. |
void |
setLogMethodsAsComments(boolean logMethodsAsComments)
|
void |
start()
|
void |
stop()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LoggingCommandProcessor(com.thoughtworks.selenium.CommandProcessor commandProcessor, LoggingResultsFormatter myFormatter)
commandProcessor
- commandProcessor to be used for communication with seleniummyFormatter
- formatter, responsible for formating all loggingEvents and writing them to file, db or whatever.public LoggingCommandProcessor(java.lang.String serverHost, int serverPort, java.lang.String browserStartCommand, java.lang.String browserUrl, LoggingResultsFormatter myFormatter)
serverHost
- -
the host name on which the Selenium Server residesserverPort
- -
the port on which the Selenium Server is listeningbrowserStartCommand
- -
the command string used to launch the browser, e.g. "*firefox" or "c:\\program files\\internet
explorer\\iexplore.exe"browserUrl
- -
the starting URL including just a domain name. We'll start the browser pointing at the Selenium resources on this
URL, e.g. "http://www.google.com" would send the browser to
"http://www.google.com/selenium-server/core/RemoteRunner.html"myFormatter
- formatter, responsible for formating all loggingEvents and writing them to file, db or whatever.Method Detail |
---|
public java.lang.String doCommand(java.lang.String commandName, java.lang.String[] args)
doCommand
in interface com.thoughtworks.selenium.CommandProcessor
public boolean getBoolean(java.lang.String commandName, java.lang.String[] args)
getBoolean
in interface com.thoughtworks.selenium.CommandProcessor
public boolean[] getBooleanArray(java.lang.String commandName, java.lang.String[] args)
getBooleanArray
in interface com.thoughtworks.selenium.CommandProcessor
public java.lang.Number getNumber(java.lang.String commandName, java.lang.String[] args)
getNumber
in interface com.thoughtworks.selenium.CommandProcessor
public java.lang.Number[] getNumberArray(java.lang.String commandName, java.lang.String[] args)
getNumberArray
in interface com.thoughtworks.selenium.CommandProcessor
public java.lang.String getString(java.lang.String commandName, java.lang.String[] args)
getString
in interface com.thoughtworks.selenium.CommandProcessor
public java.lang.String[] getStringArray(java.lang.String commandName, java.lang.String[] args)
getStringArray
in interface com.thoughtworks.selenium.CommandProcessor
public void start()
start
in interface com.thoughtworks.selenium.CommandProcessor
public void stop()
stop
in interface com.thoughtworks.selenium.CommandProcessor
public java.lang.String[] getExcludedCommands()
public void setExcludedCommands(java.lang.String[] excludedCommands)
excludedCommands
- list of commands to be excludedpublic static LoggingBean presetLoggingBean(java.lang.String commandName, java.lang.String[] args, java.lang.String result, long cmdStartMillis, long cmdEndMillis)
commandName
- the commandName for and from selenium (may be a special one like for comments)args
- 0 to 2 parameters as used by seleniumresult
- the result from selenium (and RC)cmdStartMillis
- timestamp just before command startedcmdEndMillis
- timestamp after command finished
public boolean isTestFailed()
public void setCallbackNotifier(LoggingNotifier callbackLoggingNotifier, java.lang.Object callbackLoggingInstance)
callbackLoggingNotifier
- The call back notifier objectcallbackLoggingInstance
- The calling instance to notifypublic boolean isLogMethodsAsComments()
public void setLogMethodsAsComments(boolean logMethodsAsComments)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |