net.sf.jameleon.plugin.jiffie
Class IESessionTag

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.jiffie.IESessionTag
All Implemented Interfaces:
Attributable, BrowserCache, DataDrivableResultRecordable, FunctionResultRecordable, Storable, DynaTag, LocationAware, Tag

public class IESessionTag
extends SessionTag
implements BrowserCache, Storable

This is a Jiffie implementation of the @see SessionTag. It basically starts the application in the state provided by the baseUrl and beginAt variables and creates a new session for the function points to share. An example of its use might:


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

Tag Name: <ie-session>

Field Summary
protected  String baseUrl
          Used when the beginSession is set to true.
protected  String beginAt
          Used when the beginSession attribute is set to true.
protected  Vector browsers
          The list of all open browser windows
protected  boolean clickNoOnSecurityAlert
          Click no on the Security Alert dialog box if one appears after the session is started.
protected  boolean clickYesOnSecurityAlert
          Click yes on the Security Alert dialog box if one appears after the session is started.
protected  boolean closeIEOnExit
          If set to true, then any browsers opened by the session will be closed.
protected  boolean enableJacobAutoGc
          Turn on com.jacob.autogc
protected  int maxWaitTimeInSeconds
          The maximum time to wait before timing out.
protected  boolean selectedNo
           
protected  boolean selectedYes
           
protected  boolean visible
          If set to true, then Internet Explorer will be visible.
 
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
IESessionTag()
           
 
Method Summary
 void addBrowser(InternetExplorer ie)
          Add a browser instance to the cache.
 InternetExplorer getBrowserAt(int i)
          Get the i-th browser window from the cache.
 Vector getBrowserCache()
           
 InternetExplorer getBrowserWithTitle(String title)
          Get the browser window from the cache with the matching title.
 InternetExplorer getCurrentIE()
          Returns the last element of the list of all open browser windows.
 InternetExplorer getFirstBrowser()
          Get the first browser window from the cache.
 boolean getVisible()
           
 void removeBrowser(InternetExplorer ie)
          Remove a browser instance from the cache.
 void setUpSession()
           
protected  void setVariablesFromEnvironment()
           
 void startApplication()
          todo integrate DialogListener with IEEventListener.
 void store(String fName, int event)
           
protected  void tearDownSession()
           
 
Methods inherited from class net.sf.jameleon.SessionTag
delaySession, doTag, findParentTestCase, getApplication, getOrganization, getSessionResult, getStoreToFileName, init, recordDataDrivableResult, recordFunctionResult, recordResult, removeChildlessResult, setOrganization, setSessionDelay, 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 net.sf.jameleon.Storable
getStoreToFileName
 
Methods inherited from interface org.apache.commons.jelly.Tag
getBody, getContext, getParent, invokeBody, setBody, setContext, setParent
 

Field Detail

visible

protected boolean visible
If set to true, then Internet Explorer will be visible.

This attribute is recognized by Jameleon

baseUrl

protected String baseUrl
Used when the beginSession is set to true. This is the url, including protocol http://

This attribute is recognized by Jameleon
Context Name: baseUrl

beginAt

protected String beginAt
Used when the beginSession attribute is set to true. This the path to navigate to. It is recommended to only use baseUrl, including the entire path and not use this.

This attribute is recognized by Jameleon
Context Name: beginAt

closeIEOnExit

protected boolean closeIEOnExit
If set to true, then any browsers opened by the session will be closed. Set this attribute to false to keep the browsers open.

This attribute is recognized by Jameleon
Default Value: true

maxWaitTimeInSeconds

protected int maxWaitTimeInSeconds
The maximum time to wait before timing out. The default is one hundred twenty seconds.


clickYesOnSecurityAlert

protected boolean clickYesOnSecurityAlert
Click yes on the Security Alert dialog box if one appears after the session is started.

This attribute is recognized by Jameleon
Default Value: false

selectedYes

protected boolean selectedYes

clickNoOnSecurityAlert

protected boolean clickNoOnSecurityAlert
Click no on the Security Alert dialog box if one appears after the session is started.

This attribute is recognized by Jameleon
Default Value: false

enableJacobAutoGc

protected boolean enableJacobAutoGc
Turn on com.jacob.autogc

This attribute is recognized by Jameleon
Default Value: true

selectedNo

protected boolean selectedNo

browsers

protected Vector browsers
The list of all open browser windows

Constructor Detail

IESessionTag

public IESessionTag()
Method Detail

setUpSession

public void setUpSession()
Overrides:
setUpSession in class SessionTag

setVariablesFromEnvironment

protected void setVariablesFromEnvironment()

startApplication

public void startApplication()
todo integrate DialogListener with IEEventListener.

Overrides:
startApplication in class SessionTag

store

public void store(String fName,
                  int event)
           throws IOException
Specified by:
store in interface Storable
Overrides:
store in class SessionTag
Throws:
IOException

tearDownSession

protected void tearDownSession()
Overrides:
tearDownSession in class SessionTag

getCurrentIE

public InternetExplorer getCurrentIE()
Returns the last element of the list of all open browser windows.

Returns:
The last opened browser window.

getVisible

public boolean getVisible()

getBrowserCache

public Vector getBrowserCache()
Specified by:
getBrowserCache in interface BrowserCache

addBrowser

public void addBrowser(InternetExplorer ie)
Add a browser instance to the cache. Usually newly opened browser windows should be added to the cache.

Specified by:
addBrowser in interface BrowserCache
Parameters:
ie - The browser window that should be added to the cache.

removeBrowser

public void removeBrowser(InternetExplorer ie)
Remove a browser instance from the cache. This should usually happen on quit of the browser window.

Specified by:
removeBrowser in interface BrowserCache
Parameters:
ie - The browser window that should be removed from the cache.

getFirstBrowser

public InternetExplorer getFirstBrowser()
Get the first browser window from the cache. The first instance is usually the "root" of all subsequently opened browser windows.

Specified by:
getFirstBrowser in interface BrowserCache
Returns:
The first browse window that is in the cache.

getBrowserAt

public InternetExplorer getBrowserAt(int i)
Get the i-th browser window from the cache. If all opened browser windows are added to the cache, it returns the i-th browser window that has been opened.

Specified by:
getBrowserAt in interface BrowserCache
Parameters:
i - The index of the browser window in the cache. This is usually the i-th browser window opened.
Returns:
The i-th browser window.

getBrowserWithTitle

public InternetExplorer getBrowserWithTitle(String title)
Get the browser window from the cache with the matching title.

Specified by:
getBrowserWithTitle in interface BrowserCache
Parameters:
title - The title of the browser window in the cache.
Returns:
The matching browser window.


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