Class EventStream
- All Implemented Interfaces:
HasHandlers
Experimental Features
for more information.A
EventStream
captures event details as JavaScript objects as they are handled by the EventHandler
. The event target canvas
ID and
class name as well the locator
are included, as available.
Event-specific data (for example, the String for keyboard events) are also included where appropriate. See EventStreamEvent
for more information. You can configure the stream to capture
most DOM event types and other useful events, such as relogins
and JavaScript
errors that are triggered by events:
Event Category | Includes (source DOM eventType(s) or description) | Controlling Attribute | From DOM Event? |
---|---|---|---|
click events | mouseDown , mouseUp , click ,
dblClick | captureClickEvents | Y |
move events | mouseMove , mouseOut
| captureMoveEvents | Y |
key events | keyDown , keyPress , keyUp | captureKeyEvents | Y |
drag events | dragStart , dragMove , dragStop | captureDragEvents | Y |
context menu events | contextMenu | captureMenuEvents | Y |
mouse wheel events | mouseWheel | captureWheelEvents | Y |
page events | load , unload , resize | capturePageEvents | Y |
login events | Successful relogin via the RPCManager | captureLoginEvents | N |
Reify file events |
Project and screen (auto)saves and loads | captureDSFileEvents | N |
event errors | JavaScript exceptions | captureEventErrors | N |
Note that several types of DOM events can be collapsed so that one event is
reported instead of many if they occur over the same target. You can enable collapsing for move and drag events
, key events
, wheel events
, and page events
. A stream capture limit
is also supported via circular buffering,
so that only the most recent events are preserved. All available events can be returned as an array of EventStreamEvent
via getEvents()
.
A EventStream
will start capturing events as soon as it's created by default, but if you
set autoStart
: false, you can start capturing manually
by calling start()
. Calling end()
will end capturing and return the EventStreamData
.
-
Field Summary
Fields inherited from class com.smartgwt.client.core.BaseClass
config, configOnly, factoryCreated, factoryProperties, id, scClassName
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreate()
end()
Ends event capturing and returns theEventStreamData
.Creates and returns Selenese that represents the events captured by the stream as an array ofSelenium commands
.getAsSeleneseCommands
(SeleneseSettings settings) Creates and returns Selenese that represents the events captured by the stream as an array ofSelenium commands
.Creates and returns Selenese that represents the events captured by the stream.getAsSeleneseHTML
(SeleneseSettings settings) Creates and returns Selenese that represents the events captured by the stream.boolean
Whether the stream should automatically begin capturing events.boolean
Whether mouse button-driven events (or their touch equivalents) should be captured by the stream.boolean
Whether dragging-related events should be captured by the stream.boolean
Whether to capture JavaScript errors.boolean
Whether keyboard input events should be captured by the stream.boolean
Whetherrelogin
s are captured by the stream.boolean
Whether opening a context menu should be captured by the stream.boolean
Whether mouse or touch motion-related events (other than dragging) should be captured by the stream.boolean
Whether page-level events such as a page load or resize should be captured by the stream.boolean
Whether mouse wheel events should be captured by the stream.boolean
Whether to collapse adjacentkeyPress
events into one event where possible.boolean
boolean
Whether adjacgent page events with the sameeventType
should be collapsed into a single event.boolean
Whether mouse wheel events with the sametargetID
and scroll directions should be collapsed into a single event, containing a sum of thedelta offsets
from the original events.Returns all available captured events, oldest first.getJsObj()
Maximum number of events that will be stored by thisEventStream
.int
Number of seconds that must elapse before another event error will be reported.static EventStream
getOrCreateRef
(JavaScriptObject jsObj) Returns when this stream started capturing events (i.e.boolean
setAutoStart
(boolean autoStart) Whether the stream should automatically begin capturing events.setCaptureClickEvents
(boolean captureClickEvents) Whether mouse button-driven events (or their touch equivalents) should be captured by the stream.setCaptureDragEvents
(boolean captureDragEvents) Whether dragging-related events should be captured by the stream.setCaptureEventErrors
(boolean captureEventErrors) Whether to capture JavaScript errors.setCaptureKeyEvents
(boolean captureKeyEvents) Whether keyboard input events should be captured by the stream.setCaptureLoginEvents
(boolean captureLoginEvents) Whetherrelogin
s are captured by the stream.setCaptureMenuEvents
(boolean captureMenuEvents) Whether opening a context menu should be captured by the stream.setCaptureMoveEvents
(boolean captureMoveEvents) Whether mouse or touch motion-related events (other than dragging) should be captured by the stream.setCapturePageEvents
(boolean capturePageEvents) Whether page-level events such as a page load or resize should be captured by the stream.setCaptureWheelEvents
(boolean captureWheelEvents) Whether mouse wheel events should be captured by the stream.setCollapseKeyEvents
(boolean collapseKeyEvents) Whether to collapse adjacentkeyPress
events into one event where possible.setCollapseMoveEvents
(boolean collapseMoveEvents) setCollapsePageEvents
(boolean collapsePageEvents) Whether adjacgent page events with the sameeventType
should be collapsed into a single event.setCollapseWheelEvents
(boolean collapseWheelEvents) Whether mouse wheel events with the sametargetID
and scroll directions should be collapsed into a single event, containing a sum of thedelta offsets
from the original events.void
setEventErrorListener
(EventErrorCallback callback) Installs a callback that will be called when the EventStream reports anevent error
, subject to theerror reporting interval
.void
setMaxSize
(Integer maxSize) Maximum number of events that will be stored by thisEventStream
.setMinErrorReportingInterval
(int minErrorReportingInterval) Number of seconds that must elapse before another event error will be reported.void
start()
Starts capturing all enabled events.Methods inherited from class com.smartgwt.client.core.BaseClass
addDynamicProperty, addDynamicProperty, addDynamicProperty, addDynamicProperty, applyFactoryProperties, asSGWTComponent, clearDynamicProperty, createJsObj, destroy, doAddHandler, doInit, error, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getClassName, getConfig, getHandlerCount, getID, getRef, getRuleScope, getScClassName, getTestInstance, hasAutoAssignedID, hasDynamicProperty, internalSetID, internalSetID, isConfigOnly, isFactoryCreated, onBind, onInit, registerID, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setFactoryCreated, setID, setProperty, setProperty, setProperty, setProperty, setRuleScope, setScClassName
-
Constructor Details
-
EventStream
public EventStream() -
EventStream
-
-
Method Details
-
getOrCreateRef
-
setJavaScriptObject
- Overrides:
setJavaScriptObject
in classBaseClass
-
create
-
isCreated
public boolean isCreated() -
getJsObj
-
getOrCreateJsObj
- Overrides:
getOrCreateJsObj
in classBaseClass
-
setAutoStart
Whether the stream should automatically begin capturing events. If false, the steam won't start capturing events untilstart()
is called.- Parameters:
autoStart
- New autoStart value. Default value is true- Returns:
EventStream
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the underlying component has been created
-
getAutoStart
public boolean getAutoStart()Whether the stream should automatically begin capturing events. If false, the steam won't start capturing events untilstart()
is called.- Returns:
- Current autoStart value. Default value is true
-
setCaptureClickEvents
Whether mouse button-driven events (or their touch equivalents) should be captured by the stream.Includes such
eventType
s asmouseDown
,mouseUp
,click
,doubleClk
,pointerDown
,pointerUp
,pointerCancel
,touchStart
,touchEnd
, andtouchCancel
.- Parameters:
captureClickEvents
- New captureClickEvents value. Default value is true- Returns:
EventStream
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the underlying component has been created
-
getCaptureClickEvents
public boolean getCaptureClickEvents()Whether mouse button-driven events (or their touch equivalents) should be captured by the stream.Includes such
eventType
s asmouseDown
,mouseUp
,click
,doubleClk
,pointerDown
,pointerUp
,pointerCancel
,touchStart
,touchEnd
, andtouchCancel
.- Returns:
- Current captureClickEvents value. Default value is true
-
setCaptureDragEvents
Whether dragging-related events should be captured by the stream. Multiple "drag move" type events that have the sameeventType
andtargetID
will be collapsed into one ifcollapseMoveEvents
is true.Includes such
eventType
s as:dragStart
,dragRepositionStart
,dragResizeStart
,dragSelectStart
,-
dragMove
,dragRepositionMove
,dragResizeMove
,dragSelectMove
, dragStop
,dragRepositionStop
,dragResizeStop
,dragSelectStop
,drop
,dropOver
, anddragLeave
.
- Parameters:
captureDragEvents
- New captureDragEvents value. Default value is true- Returns:
EventStream
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the underlying component has been created
-
getCaptureDragEvents
public boolean getCaptureDragEvents()Whether dragging-related events should be captured by the stream. Multiple "drag move" type events that have the sameeventType
andtargetID
will be collapsed into one ifcollapseMoveEvents
is true.Includes such
eventType
s as:dragStart
,dragRepositionStart
,dragResizeStart
,dragSelectStart
,-
dragMove
,dragRepositionMove
,dragResizeMove
,dragSelectMove
, dragStop
,dragRepositionStop
,dragResizeStop
,dragSelectStop
,drop
,dropOver
, anddragLeave
.
- Returns:
- Current captureDragEvents value. Default value is true
-
setCaptureEventErrors
Whether to capture JavaScript errors. If an already-captured event triggered the error, the details will attached to that event. Otherwise, a separate event will be created, with theeventType
of the last dispatched DOM event (i.e., there is no special "error"eventType
.)EventStreamEvent
records annotated or specially-reported with error details will contain anerrorTrace
with the error stack trace, and athreadCode
reporting the thread ID from theEventHandler
responsible for the error.- Parameters:
captureEventErrors
- New captureEventErrors value. Default value is true- Returns:
EventStream
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the underlying component has been created
-
getCaptureEventErrors
public boolean getCaptureEventErrors()Whether to capture JavaScript errors. If an already-captured event triggered the error, the details will attached to that event. Otherwise, a separate event will be created, with theeventType
of the last dispatched DOM event (i.e., there is no special "error"eventType
.)EventStreamEvent
records annotated or specially-reported with error details will contain anerrorTrace
with the error stack trace, and athreadCode
reporting the thread ID from theEventHandler
responsible for the error.- Returns:
- Current captureEventErrors value. Default value is true
-
setCaptureKeyEvents
Whether keyboard input events should be captured by the stream. For non-modifier keys, which includes all the self-inserting visible keyboard characters, we capture only thekeyPress
, askeyDown
/keyUp
are generally not useful. Conversely, for modifier keys (e.g. Shift), we capture only thekeyDown
andkeyUp
. events, and not thekeyPress
.If
collapseKeyEvents
is true, multiple adjacent keyPress events may be collapsed into a single event for greater readability and a more compact event trace.Note that if an error is thrown while handling an event, it will get reported regardless of this setting and the above capturing rules, but see
minErrorReportingInterval
. So for example an error handling akeyDown
would still generally end up in the event trace, even for a self-inserting key such as "A".- Parameters:
captureKeyEvents
- New captureKeyEvents value. Default value is false- Returns:
EventStream
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the underlying component has been created
-
getCaptureKeyEvents
public boolean getCaptureKeyEvents()Whether keyboard input events should be captured by the stream. For non-modifier keys, which includes all the self-inserting visible keyboard characters, we capture only thekeyPress
, askeyDown
/keyUp
are generally not useful. Conversely, for modifier keys (e.g. Shift), we capture only thekeyDown
andkeyUp
. events, and not thekeyPress
.If
collapseKeyEvents
is true, multiple adjacent keyPress events may be collapsed into a single event for greater readability and a more compact event trace.Note that if an error is thrown while handling an event, it will get reported regardless of this setting and the above capturing rules, but see
minErrorReportingInterval
. So for example an error handling akeyDown
would still generally end up in the event trace, even for a self-inserting key such as "A".- Returns:
- Current captureKeyEvents value. Default value is false
-
setCaptureLoginEvents
Whetherrelogin
s are captured by the stream. Login events are non-DOM events originating from theRPCManager
rather than theEventHandler
. Login events have atransaction URL
.Includes the
eventType
relogin
.- Parameters:
captureLoginEvents
- New captureLoginEvents value. Default value is true- Returns:
EventStream
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the underlying component has been created
-
getCaptureLoginEvents
public boolean getCaptureLoginEvents()Whetherrelogin
s are captured by the stream. Login events are non-DOM events originating from theRPCManager
rather than theEventHandler
. Login events have atransaction URL
.Includes the
eventType
relogin
.- Returns:
- Current captureLoginEvents value. Default value is true
-
setCaptureMenuEvents
Whether opening a context menu should be captured by the stream. This may occur due to mouse or keyboard interaction.Includes the
eventType
contextMenu
.- Parameters:
captureMenuEvents
- New captureMenuEvents value. Default value is true- Returns:
EventStream
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the underlying component has been created
-
getCaptureMenuEvents
public boolean getCaptureMenuEvents()Whether opening a context menu should be captured by the stream. This may occur due to mouse or keyboard interaction.Includes the
eventType
contextMenu
.- Returns:
- Current captureMenuEvents value. Default value is true
-
setCaptureMoveEvents
Whether mouse or touch motion-related events (other than dragging) should be captured by the stream. Multple adjacent "move events" having the sameeventType
andtargetID
will be collapsed into one ifcollapseMoveEvents
is true.Includes such
eventType
s asmouseMove
,pointerMove
,touchMove
, andmouseOut
.- Parameters:
captureMoveEvents
- New captureMoveEvents value. Default value is false- Returns:
EventStream
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the underlying component has been created
-
getCaptureMoveEvents
public boolean getCaptureMoveEvents()Whether mouse or touch motion-related events (other than dragging) should be captured by the stream. Multple adjacent "move events" having the sameeventType
andtargetID
will be collapsed into one ifcollapseMoveEvents
is true.Includes such
eventType
s asmouseMove
,pointerMove
,touchMove
, andmouseOut
.- Returns:
- Current captureMoveEvents value. Default value is false
-
setCapturePageEvents
Whether page-level events such as a page load or resize should be captured by the stream. Multple adjacent page events having the same eventType will be collapsed into one ifcollapsePageEvents
is true.Includes such
eventType
s asload
,unload
, andresize
.- Parameters:
capturePageEvents
- New capturePageEvents value. Default value is false- Returns:
EventStream
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the underlying component has been created
-
getCapturePageEvents
public boolean getCapturePageEvents()Whether page-level events such as a page load or resize should be captured by the stream. Multple adjacent page events having the same eventType will be collapsed into one ifcollapsePageEvents
is true.Includes such
eventType
s asload
,unload
, andresize
.- Returns:
- Current capturePageEvents value. Default value is false
-
setCaptureWheelEvents
Whether mouse wheel events should be captured by the stream. If the preceding "wheel event" has the sametargetID
and scroll directions, it will be replaced by the current one, subject tocollapseWheelEvents
, with thedelta offsets
in the "collapsed" event getting adjusted to be the sum of those from all the original events.Includes the
eventType
mouseWheel
.- Parameters:
captureWheelEvents
- New captureWheelEvents value. Default value is true- Returns:
EventStream
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the underlying component has been created
-
getCaptureWheelEvents
public boolean getCaptureWheelEvents()Whether mouse wheel events should be captured by the stream. If the preceding "wheel event" has the sametargetID
and scroll directions, it will be replaced by the current one, subject tocollapseWheelEvents
, with thedelta offsets
in the "collapsed" event getting adjusted to be the sum of those from all the original events.Includes the
eventType
mouseWheel
.- Returns:
- Current captureWheelEvents value. Default value is true
-
setCollapseKeyEvents
Whether to collapse adjacentkeyPress
events into one event where possible. Self-inserting keys will generally be collapsed by concatenating them into a single string,EventStreamEvent.keyNames
. On the other hand, special keys such as "Esc" and "Backspace" will only be collapsed for repeating sequences of the same key, which will be reported asEventStreamEvent.count
.Note that if an error is thrown while handling an event, it won't be collapsed, but see
minErrorReportingInterval
.- Parameters:
collapseKeyEvents
- New collapseKeyEvents value. Default value is true- Returns:
EventStream
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the underlying component has been created- See Also:
-
getCollapseKeyEvents
public boolean getCollapseKeyEvents()Whether to collapse adjacentkeyPress
events into one event where possible. Self-inserting keys will generally be collapsed by concatenating them into a single string,EventStreamEvent.keyNames
. On the other hand, special keys such as "Esc" and "Backspace" will only be collapsed for repeating sequences of the same key, which will be reported asEventStreamEvent.count
.Note that if an error is thrown while handling an event, it won't be collapsed, but see
minErrorReportingInterval
.- Returns:
- Current collapseKeyEvents value. Default value is true
- See Also:
-
setCollapseMoveEvents
Whether mouse or touch-motion related events (including dragging) with the sameeventType
andtargetID
should be collapsed into a single event.Note that if an error is thrown while handling an event, it won't be collapsed, but see
minErrorReportingInterval
.- Parameters:
collapseMoveEvents
- New collapseMoveEvents value. Default value is true- Returns:
EventStream
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the underlying component has been created- See Also:
-
getCollapseMoveEvents
public boolean getCollapseMoveEvents()Whether mouse or touch-motion related events (including dragging) with the sameeventType
andtargetID
should be collapsed into a single event.Note that if an error is thrown while handling an event, it won't be collapsed, but see
minErrorReportingInterval
.- Returns:
- Current collapseMoveEvents value. Default value is true
- See Also:
-
setCollapsePageEvents
Whether adjacgent page events with the sameeventType
should be collapsed into a single event.Note that if an error is thrown while handling an event, it won't be collapsed, but see
minErrorReportingInterval
.- Parameters:
collapsePageEvents
- New collapsePageEvents value. Default value is true- Returns:
EventStream
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the underlying component has been created- See Also:
-
getCollapsePageEvents
public boolean getCollapsePageEvents()Whether adjacgent page events with the sameeventType
should be collapsed into a single event.Note that if an error is thrown while handling an event, it won't be collapsed, but see
minErrorReportingInterval
.- Returns:
- Current collapsePageEvents value. Default value is true
- See Also:
-
setCollapseWheelEvents
Whether mouse wheel events with the sametargetID
and scroll directions should be collapsed into a single event, containing a sum of thedelta offsets
from the original events.Note that if an error is thrown while handling an event, it won't be collapsed, but see
minErrorReportingInterval
.- Parameters:
collapseWheelEvents
- New collapseWheelEvents value. Default value is true- Returns:
EventStream
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the underlying component has been created- See Also:
-
getCollapseWheelEvents
public boolean getCollapseWheelEvents()Whether mouse wheel events with the sametargetID
and scroll directions should be collapsed into a single event, containing a sum of thedelta offsets
from the original events.Note that if an error is thrown while handling an event, it won't be collapsed, but see
minErrorReportingInterval
.- Returns:
- Current collapseWheelEvents value. Default value is true
- See Also:
-
setMaxSize
Maximum number of events that will be stored by thisEventStream
. AftermaxSize
events are captured, the oldest events will be overwritten. Set this property tonull
to capture events without ever overwriting.- Parameters:
maxSize
- New maxSize value. Default value is 10000- Returns:
EventStream
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the underlying component has been created
-
getMaxSize
Maximum number of events that will be stored by thisEventStream
. AftermaxSize
events are captured, the oldest events will be overwritten. Set this property tonull
to capture events without ever overwriting.- Returns:
- Current maxSize value. Default value is 10000
-
setMinErrorReportingInterval
public EventStream setMinErrorReportingInterval(int minErrorReportingInterval) throws IllegalStateException Number of seconds that must elapse before another event error will be reported. This allows you to avoid the stream getting flooded with likely duplicate errors that may be rapidly and repeatedly reported, due to mouseMove or repeatedly executing code. Setting the property to zero disables it (avoiding any timestamp checking).Note that when an error is reported by the Framework, this property will be ignored if the last captured event triggered the error and has no
errorTrace
, so that it effectively only prevents adding new events to the stream specifically to report errors. However, anerrorTrace
attached to an event within the reporting interval of the previous error won't prevent that event from beingcollapsed
.- Parameters:
minErrorReportingInterval
- New minErrorReportingInterval value. Default value is 10- Returns:
EventStream
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the underlying component has been created- See Also:
-
getMinErrorReportingInterval
public int getMinErrorReportingInterval()Number of seconds that must elapse before another event error will be reported. This allows you to avoid the stream getting flooded with likely duplicate errors that may be rapidly and repeatedly reported, due to mouseMove or repeatedly executing code. Setting the property to zero disables it (avoiding any timestamp checking).Note that when an error is reported by the Framework, this property will be ignored if the last captured event triggered the error and has no
errorTrace
, so that it effectively only prevents adding new events to the stream specifically to report errors. However, anerrorTrace
attached to an event within the reporting interval of the previous error won't prevent that event from beingcollapsed
.- Returns:
- Current minErrorReportingInterval value. Default value is 10
- See Also:
-
end
Ends event capturing and returns theEventStreamData
. Once ended, capturing cannot be restarted without losing all stored events.- Returns:
- See Also:
-
getAsSeleneseCommands
Creates and returns Selenese that represents the events captured by the stream as an array ofSelenium commands
. Compare withgetAsSeleneseHTML()
, where you'll also find more common details.Just as when retrieving the Selenese as HTML, if a
transformSelenese()
function has been defined, it's called before returning the Selenese.- Returns:
- See Also:
-
getAsSeleneseCommands
Creates and returns Selenese that represents the events captured by the stream as an array ofSelenium commands
. Compare withgetAsSeleneseHTML()
, where you'll also find more common details.Just as when retrieving the Selenese as HTML, if a
transformSelenese()
function has been defined, it's called before returning the Selenese.- Parameters:
settings
-- Returns:
- See Also:
-
getAsSeleneseHTML
Creates and returns Selenese that represents the events captured by the stream. This Selenese contains Smart GWT-specific locators (scLocators), and Smart GWT command extensions (e.g. "waitForElementClickable") that are discussed in ourSelenium
overview.This method returns the Selenese as a string of HTML table rows, just as in an rctest.html file that you can directly execute with Selenium. Does not include the leading or trailing HTML, such as the <BODY> and <TBODY> tags; you'll need to wrap what's returned with the appropriate outer HTML tags to properly embed the table. If you'd rather have the Selenese returned as an array of
Selenium commands
, callgetAsSeleneseCommands()
instead.To customize the returned Selenese, see
transformSelenese()
. Note that if the stream hasrolled over
, the Selenese for the lost events will not be returned.For example, in your
Entrypoint
class definition, you can declare a stream member like:EventStream eventStream = new EventStream();
... time passes where end user is interacting with your app .... Then to retrieve the Selenese you can call something like:String rcTestHTML = "<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">" + "<body><table><tbody>" + MyApp.eventStream.getAsSeleneseHTML(true) + "</tbody></table></body></html>";
- Returns:
- See
HTML
- See Also:
-
getAsSeleneseHTML
Creates and returns Selenese that represents the events captured by the stream. This Selenese contains Smart GWT-specific locators (scLocators), and Smart GWT command extensions (e.g. "waitForElementClickable") that are discussed in ourSelenium
overview.This method returns the Selenese as a string of HTML table rows, just as in an rctest.html file that you can directly execute with Selenium. Does not include the leading or trailing HTML, such as the <BODY> and <TBODY> tags; you'll need to wrap what's returned with the appropriate outer HTML tags to properly embed the table. If you'd rather have the Selenese returned as an array of
Selenium commands
, callgetAsSeleneseCommands()
instead.To customize the returned Selenese, see
transformSelenese()
. Note that if the stream hasrolled over
, the Selenese for the lost events will not be returned.For example, in your
Entrypoint
class definition, you can declare a stream member like:EventStream eventStream = new EventStream();
... time passes where end user is interacting with your app .... Then to retrieve the Selenese you can call something like:String rcTestHTML = "<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">" + "<body><table><tbody>" + MyApp.eventStream.getAsSeleneseHTML(true) + "</tbody></table></body></html>";
- Parameters:
settings
-- Returns:
- See
HTML
- See Also:
-
getEvents
Returns all available captured events, oldest first. At mostmaxSize
events will be returned.- Returns:
- See Also:
-
getStartTime
Returns when this stream started capturing events (i.e. whenstart()
got called).- Returns:
- See Also:
-
setEventErrorListener
Installs a callback that will be called when the EventStream reports anevent error
, subject to theerror reporting interval
. The callback will be passed all retainedEventStreamEvent
s captured by the stream since the last time it was called.- Parameters:
callback
- Callback to fire when the stream encounters an event error, subject to the reporting interval- See Also:
-
start
public void start()Starts capturing all enabled events. See the overview ofEventStream
for a list of filter properties you can configure to control which events are captured.If called after
end()
, capturing will restart, but all previously stored events will be lost.- See Also:
-