net.sf.jameleon.plugin.selenium
Class SeleniumSessionTag

java.lang.Object
  extended by org.apache.commons.jelly.TagSupport
      extended by net.sf.jameleon.LocationAwareTagSupport
          extended by net.sf.jameleon.JameleonTagSupport
              extended by net.sf.jameleon.SessionTag
                  extended by net.sf.jameleon.plugin.selenium.SeleniumSessionTag
All Implemented Interfaces:
Attributable, DataDrivableResultRecordable, FunctionResultRecordable, Storable, DynaTag, LocationAware, Tag

public class SeleniumSessionTag
extends SessionTag

A Session tag for the Selenium plug-in. An example of its use might:


 <testcase xmlns="jelly:jameleon">
     <selenium-session baseUrl="http://www.google.com" beginSession="true">
       <selenium-assert-title-equals
           functionId="Check that title is Google."
           title="Google"/>
     </session-session>
 </testcase>
 

Tag Name: <selenium-session>

Field Summary
protected  String baseUrl
           
protected  String beginAt
           
protected  String browser
           
protected  boolean multiWindowMode
           
protected  String seleniumProxyHost
           
protected  int seleniumProxyPort
           
protected  Selenium session
          A handle on the Selenium server session
protected  boolean slowResourcesMode
           
protected  boolean startSeleniumProxy
           
protected  boolean stopProxyServerOnSessionClose
           
protected  int timeoutSeconds
           
 
Fields inherited from class net.sf.jameleon.SessionTag
addt, application, beginSession, log, organization, postcondition, props, sessionDelay, sessionResults, tc
 
Fields inherited from class net.sf.jameleon.JameleonTagSupport
attributes, broker, contextVars, fp, unsupportedAttributes
 
Fields inherited from class net.sf.jameleon.LocationAwareTagSupport
columnNumber, elementTagName, lineNumber, scriptFileName
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
SeleniumSessionTag()
           
 
Method Summary
protected  void createSession()
           
protected  void deregisterStorable()
          Deregister this tag as a storable
 String getBaseUrl()
          Gets the base URL, including the protocol (http://), the domain name and any path informtion.
 String getBeginAt()
          Gets the trailing path of the URL to begin the browser at if set.
 String getBrowser()
          Gets the browser to run the selinium tests under.
 boolean getMultiWindowMode()
          Gets the Selenium multi window mode.
protected  String getRequestUrl()
          Gets the url to request
 String getSeleniumProxyHost()
          Gets the Selenium proxy host to connect to.
 int getSeleniumProxyPort()
          Gets the Selenium proxy port to connect to.
 boolean getSeleniumStopProxyServerOnSessionClose()
          Gets the Selenium multi window mode.
 Selenium getSession()
          Gets the Selenium session used to communicate with the web application
 boolean getSlowResourcesMode()
          Gets the Selenium slow resources mode.
 int getTimeoutSeconds()
          Gets the Selenium timeout in seconds.
 boolean isStartSeleniumProxy()
          Set the Selenium proxy server to start when the session starts.
protected  void registerStorable()
          Register this tag as a storable
 void setUpSession()
           
 void startApplication()
          Loads the URL given by beginAt and baseUrl.
protected  void startSeleniumProxyServer()
          Start a selenium proxy server
protected  void startSession()
           
protected  void stopSeleniumProxyServer()
          Start a selenium proxy server
 void tearDownSession()
           
 
Methods inherited from class net.sf.jameleon.SessionTag
delaySession, doTag, findParentTestCase, getApplication, getOrganization, getSessionResult, getStoreToFileName, init, recordDataDrivableResult, recordFunctionResult, recordResult, removeChildlessResult, setOrganization, setSessionDelay, store, tearDown, trace, traceMsg
 
Methods inherited from class net.sf.jameleon.JameleonTagSupport
cleanVariablesInContext, createAttributes, describeAttributes, getAttributeBroker, getAttributes, getAttributeType, getClassAttributes, getFunctionalPoint, getUnsupportedAttributes, loadFunctionalPoint, resetFunctionalPoint, setAttribute, setVariableInContext, testForUnsupportedAttributesCaught
 
Methods inherited from class net.sf.jameleon.LocationAwareTagSupport
getColumnNumber, getElementName, getFileName, getLineNumber, setColumnNumber, setElementName, setFileName, setLineNumber
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.jelly.Tag
getBody, getContext, getParent, invokeBody, setBody, setContext, setParent
 

Field Detail

baseUrl

protected String baseUrl
This attribute is recognized by Jameleon
Context Name: baseUrl

beginAt

protected String beginAt
This attribute is recognized by Jameleon
Context Name: beginAt

browser

protected String browser
This attribute is recognized by Jameleon
Default Value: *firefox
Context Name: seleniumBrowser

multiWindowMode

protected boolean multiWindowMode
This attribute is recognized by Jameleon
Default Value: false
Context Name: seleniumMultiWindowMode

stopProxyServerOnSessionClose

protected boolean stopProxyServerOnSessionClose
This attribute is recognized by Jameleon
Default Value: false
Context Name: seleniumStopProxyServerOnSessionClose

startSeleniumProxy

protected boolean startSeleniumProxy
This attribute is recognized by Jameleon
Default Value: false
Context Name: startSeleniumProxy

seleniumProxyHost

protected String seleniumProxyHost
This attribute is recognized by Jameleon
Default Value: localhost
Context Name: seleniumProxyHost

seleniumProxyPort

protected int seleniumProxyPort
This attribute is recognized by Jameleon
Default Value: 4444
Context Name: seleniumProxyPort

timeoutSeconds

protected int timeoutSeconds
This attribute is recognized by Jameleon
Default Value: 1800
Context Name: seleniumTimeoutSeconds

session

protected Selenium session
A handle on the Selenium server session


slowResourcesMode

protected boolean slowResourcesMode
This attribute is recognized by Jameleon
Default Value: false
Context Name: seleniumSlowResourcesMode
Constructor Detail

SeleniumSessionTag

public SeleniumSessionTag()
Method Detail

deregisterStorable

protected void deregisterStorable()
Deregister this tag as a storable


getRequestUrl

protected String getRequestUrl()
Gets the url to request

Returns:
The URL to use in startApplication.

getBaseUrl

public String getBaseUrl()
Gets the base URL, including the protocol (http://), the domain name and any path informtion.

Returns:
the base URL.

getBeginAt

public String getBeginAt()
Gets the trailing path of the URL to begin the browser at if set.

Returns:
the trailing path of the URL to begin the browser at if set.

getBrowser

public String getBrowser()
Gets the browser to run the selinium tests under.

Returns:
The broswer to use.

getSeleniumStopProxyServerOnSessionClose

public boolean getSeleniumStopProxyServerOnSessionClose()
Gets the Selenium multi window mode. If set to true, then selenium will run the tests under a different window as opposed to in the same frame

Returns:
The Selenium multi window mode.

getSeleniumProxyHost

public String getSeleniumProxyHost()
Gets the Selenium proxy host to connect to.

Returns:
The Selenium proxy host to connect to

getMultiWindowMode

public boolean getMultiWindowMode()
Gets the Selenium multi window mode. If set to true, then selenium will run the tests under a different window as opposed to in the same frame

Returns:
The Selenium multi window mode.

getSeleniumProxyPort

public int getSeleniumProxyPort()
Gets the Selenium proxy port to connect to.

Returns:
The Selenium proxy port to connect to

getSlowResourcesMode

public boolean getSlowResourcesMode()
Gets the Selenium slow resources mode. If set to true, the test will run more slowly to help with debugging.

Returns:
The Selenium proxy host to connect to

getTimeoutSeconds

public int getTimeoutSeconds()
Gets the Selenium timeout in seconds.

Returns:
The Selenium timeoutSeconds

isStartSeleniumProxy

public boolean isStartSeleniumProxy()
Set the Selenium proxy server to start when the session starts. If this is set to false (the default), then the proxy server will need to be started manually.


getSession

public Selenium getSession()
Gets the Selenium session used to communicate with the web application

Returns:
Selenium

registerStorable

protected void registerStorable()
Register this tag as a storable


createSession

protected void createSession()

setUpSession

public void setUpSession()
Overrides:
setUpSession in class SessionTag

tearDownSession

public void tearDownSession()
Overrides:
tearDownSession in class SessionTag

startSeleniumProxyServer

protected void startSeleniumProxyServer()
Start a selenium proxy server


startSession

protected void startSession()

stopSeleniumProxyServer

protected void stopSeleniumProxyServer()
Start a selenium proxy server


startApplication

public void startApplication()
Loads the URL given by beginAt and baseUrl.

Overrides:
startApplication in class SessionTag


Copyright © 2006-2008 Christian Hargraves. All Rights Reserved.