net.sf.jameleon.plugin.watij.tags
Class WatijTitleTag

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.function.FunctionTag
                  extended by net.sf.jameleon.plugin.watij.WatijFunctionTag
                      extended by net.sf.jameleon.plugin.watij.tags.WatijTitleTag
All Implemented Interfaces:
BreakPoint, Attributable, Storable, DynaTag, LocationAware, Tag

public class WatijTitleTag
extends WatijFunctionTag

Gets the title of the page and stores it in the context. An example of its use might be to get the title and do logic on it:


 <testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
     <watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
       <watij-title
           functionId="Check that the title is 'testing'."/>
       <j:if test="${watijTitle eq 'some title'">
           <watij-click-link
               functionId="Click on the 'some link' link"
               link="some link"/>
       </j:if>
       <j:if test="${watijTitle eq 'some other title'">
           <watij-click-link
               functionId="Click on the 'some other link' link"
               link="some other link"/>
       </j:if>
     </watij-session>
 </testcase>
 
To store the title in a context variable other than the default:

 <testcase xmlns="jelly:jameleon" xmlns:j="jelly:core">
     <watij-session baseUrl="http://jameleon.sourceforge.net" beginSession="true">
       <watij-title
           functionId="Check that the title is 'testing'."
           contextVar="testingLink"/>
       <some-tag functionId="use the ${testingLink} title variable"/>
     </watij-session>
 </testcase>
 

Tag Name: <watij-title> Type: action

Field Summary
protected  String contextVar
          The context variable to store the title in
 
Fields inherited from class net.sf.jameleon.plugin.watij.WatijFunctionTag
sessionTag, STORE_SOURCE_CONFIG_NAME, storeSourceOnStateChange
 
Fields inherited from class net.sf.jameleon.function.FunctionTag
addt, breakPoint, expectException, expectFailure, fResults, functionDelay, functionId, lastFileWritten, log, NO_DELAY, params, postcondition, precondition, st, state, tct, vpt
 
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
WatijTitleTag()
           
 
Method Summary
 void testBlock()
           
 
Methods inherited from class net.sf.jameleon.plugin.watij.WatijFunctionTag
getParentBrowser, getSymbolFromString, ie, setCurrentIE, setupEnvironment, store
 
Methods inherited from class net.sf.jameleon.function.FunctionTag
addParam, addRequiredAttribute, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertFalse, assertFalse, assertMethod, assertMethodWithLevel, assertNotNull, assertNotNull, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNotSame, assertNotSame, assertNull, assertNull, assertNull, assertNull, assertRegexMatches, assertRegexMatches, assertRegexMatches, assertRegexMatches, assertSame, assertSame, assertSame, assertSame, assertTextContains, assertTextContains, assertTextContains, assertTextContains, assertTextEndsWith, assertTextEndsWith, assertTextEndsWith, assertTextEndsWith, assertTextStartsWith, assertTextStartsWith, assertTextStartsWith, assertTextStartsWith, assertTrue, assertTrue, assertTrue, assertTrue, checkParamTypes, cleanUp, cleanUpEnvironment, delay, delay, doTag, fail, fail, fail, fail, getFunctionId, getFunctionResults, getMatchingRegexText, getParam, getParamLength, getParams, getParentTags, getSessionTag, getStoreToFileName, getStringOrDefault, getTestCaseTag, getVariable, getVariableAsBoolean, getVariableAsList, getVariableAsString, isBreakPoint, isContextVariableNull, pluginTearDown, recordFunctionResult, regexMatches, removeFunctionResult, removeVariable, setDefaultVariableValue, setDefaultVariableValue, setExpectException, setExpectFailure, setFunctionDelay, setFunctionId, setup, setUpFunctionResults, setVariable, tearDown, traceMsg, validate
 
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

contextVar

protected String contextVar
The context variable to store the title in

This attribute is recognized by Jameleon
Required: true
Default Value: watijTitle
Constructor Detail

WatijTitleTag

public WatijTitleTag()
Method Detail

testBlock

public void testBlock()
               throws Exception
Overrides:
testBlock in class FunctionTag
Throws:
Exception


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