version 1.0

com.actimind.actiwate.testing
Interface ActiwateSession

All Superinterfaces:
Action, PageAssert, PageObjectLookup, UserDialogExpect
All Known Implementing Classes:
ActiwateTestCase

public interface ActiwateSession
extends Action, PageObjectLookup, PageAssert, UserDialogExpect

Base interface for the test session.


Field Summary
 
Fields inherited from interface com.actimind.actiwate.testing.html.UserDialogExpect
PRESS_CANCEL, PRESS_OK
 
Method Summary
 void addAuthCredentials(java.lang.String hostname, java.lang.String realm, java.lang.String username, java.lang.String password)
          Adds credentials to a session for the given authentication realm on the given host.
 void disableJavaScript(boolean deferred)
          Disables JavaScript support in this session for all the session windows and frames.
 void enableJavaScript()
          Enables JavaScript support for all the session windows and frames.
 AsyncEvents getAsyncEvents()
          Returns AsyncEvents class containing all sheduled but not executed async events.
 boolean getAutoExecMetaRefreshes()
          Returns value specified in setAutoExecMetaRefreshes(boolean) method.
 java.lang.String getBaseURL()
          Returns base URL for this session.
 boolean getExecAsyncEventsAutomatically()
          Returns value specified in setExecAsyncEventsAutomatically(boolean).
 long getExecAsyncEventsOffset()
          Returns value specified in setExecAsyncEventsOffset(long).
 java.lang.String getURL(java.lang.String relURL)
          Returns URL for specified relative URL.
 XmlHttpRequestConfig getXmlHttpRequestConfig()
          Returns configuration for XmlHttpRequest async events.
 boolean isJavaScriptAutoRunningEnabled()
          Returns value indicating whether or not JavaScript support is enabled.
 Window newWindow()
          Creates new window.
 Page page()
          Returns current page.
 Screen screen()
          Returns the Screen interface containing parameters of the screen within this session.
 void setAutoExecMetaRefreshes(boolean enabled)
          Specifies one of two modes of processing of Meta Refreshes: parameter enabled=true - Browser will process Meta-refreshes automatically (without necessity of calling shiftTime(long) method).
 void setBaseURL(java.lang.String URL)
          Sets base URL for this session.
 void setConnectTimeout(int seconds)
          Sets the timeout until HTTP connection with a server is established.
 void setDataTimeout(int seconds)
          Sets the time which actiWATE waits for data server after connection is established.
 void setExecAsyncEventsAutomatically(boolean auto)
          Specifies one of two modes of processing of async events: parameter auto=true - Browser will execute async events automatically.
 void setExecAsyncEventsOffset(long offsetMillis)
          Sets offset for automatic async events execution.
 void setXmlHttpRequestConfig(XmlHttpRequestConfig xmlHttpRequestConfig)
          Sets configuration for XmlHttpRequest async events.
 void shiftTime(long milliseconds)
          Deprecated. replaced with getAsyncEvents().AsyncEvents.executeByTimeOffset(long)
 void switchTo(Page page)
          Switches context to the specified page.
 Window window()
          Returns window containing current context.
 Window window(int index)
          Returns window by creation index.
 Window window(java.lang.String name)
          Returns window by its name.
 Window windowWithTitle(java.lang.String windowTitle)
          Returns first window with specified title substring.
 
Methods inherited from interface com.actimind.actiwate.testing.html.Action
back, chooseFile, click, click, click, executeJavaScript, executeJavaScript, forward, goTo, goTo, reload, runPageScripts, selectOption, setFile, setFileName, setFileName, setText, setText, setText, toggleOption
 
Methods inherited from interface com.actimind.actiwate.testing.html.PageObjectLookup
button, button, button, buttonByText, checkbox, checkbox, checkboxes, fileField, fileField, fileFields, image, imageByAlt, imageByURL, imageMap, imageMap, imageMaps, images, link, linkById, linkByText, linkByTitle, links, multiSelect, passwordField, radioButton, radioButton, radioButtons, singleSelect, table, tableById, tableByText, textarea, textField, textField, textFields
 
Methods inherited from interface com.actimind.actiwate.testing.html.PageAssert
assertImageWithURLNotPresent, assertImageWithURLPresent, assertLinkWithTextNotPresent, assertLinkWithTextPresent, assertTextNotPresent, assertTextPresent, assertTitleEquals
 
Methods inherited from interface com.actimind.actiwate.testing.html.UserDialogExpect
expectAlert, expectAlert, expectAnyAlert, expectAnyConfirm, expectAnyPrompt, expectConfirm, expectConfirm, expectPrompt, expectPromptWithText, expectPromptWithTextAndValue, verifyUserDialogs
 

Method Detail

setBaseURL

public void setBaseURL(java.lang.String URL)
Sets base URL for this session.

Parameters:
URL - absolute URL, can be null

getBaseURL

public java.lang.String getBaseURL()
Returns base URL for this session.

Returns:
base URL for this session.

getURL

public java.lang.String getURL(java.lang.String relURL)
Returns URL for specified relative URL. URL is constructed from current base URL.

Parameters:
relURL - relative URL
Returns:
full URL for specified relative URL.

window

public Window window(int index)
              throws WindowNotFoundException
Returns window by creation index. Creation index is an index of window in chronological order.

Parameters:
index - creation index, starting from zero
Returns:
window with specified creation index.
Throws:
WindowNotFoundException - if window with specified creation index does not exist.

window

public Window window(java.lang.String name)
              throws WindowNotFoundException
Returns window by its name.

Parameters:
name - name of the window to search for
Returns:
window with specified name
Throws:
WindowNotFoundException - if window with specified name does not exist.

windowWithTitle

public Window windowWithTitle(java.lang.String windowTitle)
                       throws WindowNotFoundException
Returns first window with specified title substring. Window title will be normalized before actual compare performed.

Parameters:
windowTitle - title substring searched window must have
Returns:
first window with specified title substring.
Throws:
WindowNotFoundException - if window with specified title does not exist.

newWindow

public Window newWindow()
Creates new window.

Returns:
new window.

window

public Window window()
Returns window containing current context.

Returns:
window containing current context.

page

public Page page()
Returns current page.


switchTo

public void switchTo(Page page)
Switches context to the specified page.

Parameters:
page - Page the context should be switched to

disableJavaScript

public void disableJavaScript(boolean deferred)
Disables JavaScript support in this session for all the session windows and frames. But you are still able to use enableJavaScript methods to execute your custom scripts. Does nothing if JavaScript already disabled.

Parameters:
deferred - if false then JavaScript will be disabled immediately. If true then JavaScript support will be disabled only after loading of a new HTML page in this session, no matter in which window or frame.
See Also:
enableJavaScript(), isJavaScriptAutoRunningEnabled(), Action.executeJavaScript(java.lang.String), Action.executeJavaScript(java.lang.String, org.w3c.dom.html.HTMLElement), Action.executeJavaScript(java.lang.String), Action.executeJavaScript(java.lang.String, org.w3c.dom.html.HTMLElement)

enableJavaScript

public void enableJavaScript()
Enables JavaScript support for all the session windows and frames. Does nothing if JavaScript already enabled. Enabling JavaScript will not automatically execute scripts associated with HTML pages in this session.

See Also:
disableJavaScript(boolean), isJavaScriptAutoRunningEnabled()

isJavaScriptAutoRunningEnabled

public boolean isJavaScriptAutoRunningEnabled()
Returns value indicating whether or not JavaScript support is enabled.

Returns:
value indicating whether or not JavaScript support is enabled.
See Also:
enableJavaScript(), disableJavaScript(boolean)

shiftTime

public void shiftTime(long milliseconds)
Deprecated. replaced with getAsyncEvents().AsyncEvents.executeByTimeOffset(long)

Moves time ahead on the specified number of milliseconds. Time is moved in all windows of this session. All timers (setTimeout() and setInterval()) and meta refresh tags fallen into specified interval will be executed.

Parameters:
milliseconds - time to shift current time for (in milliseconds)

addAuthCredentials

public void addAuthCredentials(java.lang.String hostname,
                               java.lang.String realm,
                               java.lang.String username,
                               java.lang.String password)
Adds credentials to a session for the given authentication realm on the given host. The null realm signifies default credentials for the given host, which should be used when no credentials have been explictly supplied for the challenging realm. The null host signifies default credentials, which should be used when no credentials have been explictly supplied for the challenging host. Any previous credentials for the given realm on the given host will be overwritten.

Parameters:
hostname - the host the credentials belongs to
realm - the authentication realm
username - username
password - password

screen

public Screen screen()
Returns the Screen interface containing parameters of the screen within this session.


setAutoExecMetaRefreshes

public void setAutoExecMetaRefreshes(boolean enabled)
Specifies one of two modes of processing of Meta Refreshes:

Parameters:
enabled - see above

getAutoExecMetaRefreshes

public boolean getAutoExecMetaRefreshes()
Returns value specified in setAutoExecMetaRefreshes(boolean) method.

Returns:
value specified in setAutoExecMetaRefreshes(boolean) method.

setConnectTimeout

public void setConnectTimeout(int seconds)
Sets the timeout until HTTP connection with a server is established. The value of zero means that timeout is not used. By default timeout is not used.

Parameters:
seconds - Timeout value in seconds

setDataTimeout

public void setDataTimeout(int seconds)
Sets the time which actiWATE waits for data server after connection is established. The value of zero means that timeout is not used. By default timeout is not used.

Parameters:
seconds - Timeout value in seconds

getAsyncEvents

public AsyncEvents getAsyncEvents()
Returns AsyncEvents class containing all sheduled but not executed async events.
For more information on async events see AsyncEvent.

Returns:
AsyncEvents class containing all sheduled but not executed async events.

getExecAsyncEventsAutomatically

public boolean getExecAsyncEventsAutomatically()
Returns value specified in setExecAsyncEventsAutomatically(boolean).

Returns:
value specified in setExecAsyncEventsAutomatically(boolean).

setExecAsyncEventsAutomatically

public void setExecAsyncEventsAutomatically(boolean auto)
Specifies one of two modes of processing of async events:

Parameters:
auto - see above

getExecAsyncEventsOffset

public long getExecAsyncEventsOffset()
Returns value specified in setExecAsyncEventsOffset(long).

Returns:
value specified in setExecAsyncEventsOffset(long).

setExecAsyncEventsOffset

public void setExecAsyncEventsOffset(long offsetMillis)
Sets offset for automatic async events execution.

Parameters:
offsetMillis - offset for automatic async events execution.
See Also:
setExecAsyncEventsAutomatically(boolean)

getXmlHttpRequestConfig

public XmlHttpRequestConfig getXmlHttpRequestConfig()
Returns configuration for XmlHttpRequest async events.

Returns:
configuration for XmlHttpRequest async events.

setXmlHttpRequestConfig

public void setXmlHttpRequestConfig(XmlHttpRequestConfig xmlHttpRequestConfig)
Sets configuration for XmlHttpRequest async events.

Parameters:
xmlHttpRequestConfig - configuration for XmlHttpRequest async events.


Copyright © 2007 Actimind, Inc. All Rights Reserved.